GithubHelp home page GithubHelp logo

Comments (5)

kuikka avatar kuikka commented on June 4, 2024

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.

kuikka avatar kuikka commented on June 4, 2024

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.

skidoo23 avatar skidoo23 commented on June 4, 2024

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.

arkq avatar arkq commented on June 4, 2024

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.

arkq avatar arkq commented on June 4, 2024

Issue moved to #174

from bluez-alsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.