Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Bluetooth audio lag due to cpu overload
#1
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?


Attached Files Thumbnail(s)
   
Reply
#2
(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
Reply
#3
Make sure you’re using the .20 version of mpd as there’s a conflict with the new one and bluez-alsa.
Reply
#4
(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
Reply
#5
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.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
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?
Reply
#7
I tested using a ZeroW.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
Thanks for your help and support Tim Smile
Reply
#9
Sure no prob. Btw, lowering the buffer time can reduce latency.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
I've tried to play with buffer time without any result.

The lag/scratch are really related to cpu overload.
Reply


Forum Jump: