[pulseaudio-discuss] Device name of audio headset in pulseaudio?

Colin Guthrie gmane at colin.guthr.ie
Mon Jun 20 08:18:34 PDT 2011


'Twas brillig, and Colin Beckingham at 20/06/11 15:44 did gyre and gimble:
> In OpenSUSE 11.4, I have 3 audio devices constantly connected (mobo,
> webcam and a USB Logitech headset). All of these get assigned a
> /dev/dspX number on boot, mobo = 0, USB webcam = 1, Headset = 2. All
> work fine under pulseaudio control.
> 
> From time to time I use a Bluetooth headset which connects via a dongle
> adapter. PA detects it fine and allows me to use it with many applications.
> 
> One application in particular needs me to tell it using the AUDIODEV
> environment variable what device I am using. With the 3 constantly
> attached devices this is no problem (AUDIODEV=/dev/dsp0, etc.). However
> I have not found a way of associating a /dev/??? entry with the
> temporary BT headsets. As far as I can see the list of devices in /dev
> does not change when PA picks up the headset. Is this a PA issue or
> should I be looking elsewhere?

/dev/dsp* devices are OSS and are considered legacy on Linux. What app
are you dealing with here? Does it only support /dev/dsp style API or
does it also support e.g. ALSA?

As you can imagine, /dev/dsp* can operate in in many different
"compatibility" modes. The most basic, and common is via ALSA and it's
OSS emulation. It suffers from the problem that if you use it (e.g. open
/dev/dsp1) then PulseAudio itself cannot access that device (as the OSS
emulation for ALSA is hogging it) for other applications that may want
to use it at the same time.


Another solution is osspd which emulates a single /dev/dsp device and
just passes all connections to it to PA. This then allows standard
device selection from within e.g. pavucontrol and the desktop
environment's standard audio device management tools.

I suspect strongly you are using the first one. Thus bluetooth devices
will not show up here as they are not alsa devices (they are only
supported via PulseAudio) and thus cannot be emulated by alsa's OSS
emulation layer.

The simplest solution here is just to use any /dev/dsp device but to
open your application via padsp wrapper. This wrapper hijacks any open()
calls on /dev/dsp* and forwards them to PA. This is not always the
smoothest of options, so if the app can support ALSA or PA natively
rather than /dev/dsp* OSS API, then this is likely a better solution.

Cheers

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



More information about the pulseaudio-discuss mailing list