Moode Forum
[PROBLEM] Bluetooth audio lag due to cpu overload - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [PROBLEM] Bluetooth audio lag due to cpu overload (/showthread.php?tid=1684)

Pages: 1 2


Bluetooth audio lag due to cpu overload - Norde - 09-02-2019

Thank you for this 6.1 version of moOde Smile


I'm experiencing audio lag when i stream audio from phone (android) or computer (windows / linux) via bluetooth (with others protocols like airplay, or dlna there's no problem).

I took a look at the CPU load and these audio lags correspond to cpu overload peaks (cf. attachment).
I also noted peaks of activity for dbus-daemon process without knowing whether it was her fault or not.




Do you have any idea where the problem might come from?


RE: Bluetooth audio lag due to cpu overload - TheOldPresbyope - 09-02-2019

(09-02-2019, 08:14 PM)Norde Wrote: Thank you for this 6.1 version of moOde Smile


I'm experiencing audio lag when i stream audio from phone (android) or computer (windows / linux) via bluetooth (with others protocols like airplay, or dlna there's no problem).

I took a look at the CPU load and these audio lags correspond to cpu overload peaks (cf. attachment).
I also noted peaks of activity for dbus-daemon process without knowing whether it was her fault or not.




Do you have any idea where the problem might come from?


Come on, spill the hardware details...what RPi model, what DAC? 

I just grabbed the system at hand to try replicating your finding. BT from my Nexus 6P phone to a moOde 6.1 player  on an RPi4B. The top 3 processes are bluesalsa, bluesalsa, and htop, each consuming roughly the same as their counterparts in your output. No hint of any big dbus activity in the brief time I observed htop. [edit] Total CPU consumption never over 20% and usually considerably less.

Regards,
Kent

Regards,
Kent


RE: Bluetooth audio lag due to cpu overload - swizzle - 09-02-2019

Make sure you’re using the .20 version of mpd as there’s a conflict with the new one and bluez-alsa.


RE: Bluetooth audio lag due to cpu overload - TheOldPresbyope - 09-02-2019

(09-02-2019, 09:44 PM)swizzle Wrote: Make sure you’re using the .20 version of mpd as there’s a conflict with the new one and bluez-alsa.

Ah, well, about that. I've only seen the conflict when using moOde as the BT source to a BT speaker.

To be sure, I just switched the same system as above to MPD 0.21.13 and it seems to be working fine as the BT sink to my phone's BT output. Same low CPU usage.

Oh, of course. It's Bluetooth-->ALSA. Bypasses MPD.

Regards,
Kent


RE: Bluetooth audio lag due to cpu overload - Tim Curtis - 09-02-2019

Ran a quick test and I'm not experiencing any BT lag from iPhone. Connection and playback happen almost instantly.

@Norde - maybe try changing the buffer length in BlueZ Config.


RE: Bluetooth audio lag due to cpu overload - Norde - 09-03-2019

Sorry for the lack of information :
I'm experiencing this on a rpi zero w with a HiFimeDIY Sabre USB DAC (so I2S audio device is set to "none")

Buffer lenth is at default (max) : 500ms

Also UAC2 fix doesn't have any effect.


(09-02-2019, 09:44 PM)TheOldPresbyope Wrote: Oh, of course. It's Bluetooth-->ALSA. Bypasses MPD.

Right, MDP version doesn't change anything


Does rpi zero does not have enough power for this purpose?


RE: Bluetooth audio lag due to cpu overload - Tim Curtis - 09-03-2019

I tested using a ZeroW.


RE: Bluetooth audio lag due to cpu overload - Norde - 09-03-2019

Thanks for your help and support Tim Smile


RE: Bluetooth audio lag due to cpu overload - Tim Curtis - 09-03-2019

Sure no prob. Btw, lowering the buffer time can reduce latency.


RE: Bluetooth audio lag due to cpu overload - Norde - 09-03-2019

I've tried to play with buffer time without any result.

The lag/scratch are really related to cpu overload.