Comments (5)
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().
from bluez-alsa.
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.
from bluez-alsa.
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.
from bluez-alsa.
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.
Unfortunately I find the alsa documentation ambiguous on whether snd_pcm_poll_descriptors_revents() is meant to be mandatory so it is arguable whether this is a bug in bluealsa or mpd.
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:
I've reproduced this bug with the MPD v0.19.21 - I was not able to compile current master snapshot due to this bug.
from bluez-alsa.
Issue moved to #174
from bluez-alsa.
Related Issues (20)
- v4.1.1 fails to build on on Debian buster i386 HOT 8
- No sound from Onkyo receiver HOT 90
- Potential server lockup in PCM drain HOT 2
- Sink producing no audio with aptX codec HOT 2
- allow build with different dbus name HOT 2
- Bluealsa with Google Pixel 8 Android Version 14 (Call sounds like a robot) HOT 9
- Fedora includes a fork of libopenaptx, libfreeaptx HOT 1
- No sound on speakers with PipeWire. HOT 8
- Occasional crashes when streaming from iPhone to bluealsa HOT 10
- Buttons not working during callback recording HOT 2
- build/install: LC3Plus libraries?? HOT 2
- HSP HS profile: "arecord -d" duration is ignored HOT 1
- Routing audio to bluealsa from hw:0,1 HOT 31
- Test all deps with pkgconfig HOT 10
- arecord Unable to install hw params, record from bluetooth failed HOT 3
- Error compiling with aptx HOT 1
- Audio cut off in the beginning of the file HOT 3
- how can an SCO link be reestablished after it has been disconnected by the HF device? HOT 2
- How to pipe bluealsa PCM to fifo? HOT 18
- aplay Unable to install hw params HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluez-alsa.