New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Music Player Daemon and bluealsa sink #35
Comments
If the application is doing select() or poll() manually it has to call snd_pcm_poll_descriptors_revents() after poll/select to give alsa the chance to serve the socket(s). That is, unless it is using some of the API that does that internally already, such as snd_pcm_wait(). |
Well, turns out there is more. snd_pcm_writei() will perform the wait unless the audio device is in non-blocking mode, which is the case with MPD, is likely the cause here. |
MPDs input plugin opens ALSA caputure device with SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK options. Using snd_pcm_readi with bluealsa results most of the time in -EAGAIN. Using snd_pcm_readi with Onboard or USB capture device returns positive values only. |
Hi, sorry for such a late response, I've been really busy lately... It seems, that this issue is caused by the MPD ALSA input plugin implementation. I've reproduced this issue, however it seems that the bluealsa_poll_revents() function is not called at all - and it HAS TO be! Not calling this function (essentially snd_pcm_poll_descriptors_revents()) might cause the effect we can see - poll will not block any more.
If one is using poll/select in the code, then the call to the snd_pcm_poll_descriptors_revents() is mandatory. It might work with other ALSA input devices, because it is more likely, that other input devices do not perform anything fancy inside the descriptors_revents() callback - and bluealsa does... EDIT: |
Issue moved to #174 |
Try to play music from my mobile to MPD. Sound is ok. But high load on a single cpu core. Debian Strech on x64, ALSA 1.1.3, MPD and bluealsa from git.
How to reproduce
bluealsa --a2dp-force-audio-cd
bluetoothctl connect 11:22:33:44:55:66
mpc add alsa://bluealsa:HCI=hci0,DEV=11:22:33:44:55:66,PROFILE=a2dp
Please note: https://forum.musicpd.org/viewtopic.php?f=7&t=4055#p6617
Any help?
The text was updated successfully, but these errors were encountered: