[alsa-devel] Issue with Alsa and PulseAudio

Colin Guthrie gmane at colin.guthr.ie
Wed Aug 27 00:13:03 CEST 2008

Ash wrote:
> Thanks Colin, Takashi.
> The thing is, I've noticed other applications such as aplay or amarok
> call the same function and not exhibit the same behavior. That's why
> I am  not sure what I am doing wrong.

Well amarok presumably uses xine... aplay tho' is probably more 
interesting. I presume you are passing the same values etc. as e.g. aplay?

> Also intersetingly enough, if I do not use the "default"
> ALSA_DEVICE_DEFAULT, and instead use "front" (which I believe is
> direct access to alsa driver, whereas "default" goes through
> pulseaudio), strange things happen. For example, setting a rate or
> channels returns -22 Invalid Argument.

Don't use "front", you should use "default". "front" will only exist on 
some sound hardware AFAIK, and in the case that the user has selected 
their "default" device to route through pulseaudio, you should respect this.

I'm sure there is probably a technical reason why "front" does not let 
you set rate or channels (probably because it represents the front 
speakers system of a multi-channel setup), but I'm sure someone more 
familiar with the API will be able to enlighten you :)

> I am not sure if I need to change or upgrade alsa. I just want to get
> to the bottom of this with existing pulseaudio/alsa since other
> players seem to work.

Indeed. If aplay is calling this function and works via pulseaudio, then 
it stands to reason so should you!



Colin Guthrie

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]

More information about the Alsa-devel mailing list