[pulseaudio-discuss] Hal detect and multiple outputs
lennart at poettering.net
Fri May 23 17:04:46 PDT 2008
On Fri, 23.05.08 19:44, Jon Smirl (jonsmirl at gmail.com) wrote:
> On 5/23/08, Lennart Poettering <lennart at poettering.net> wrote:
> > On Fri, 23.05.08 16:11, Jon Smirl (jonsmirl at gmail.com) wrote:
> > > I have Intel HDA audio hardware with both a digital (S/PDIF) and
> > > analog output. When I used module-hal-detect pulse only provided one
> > > sink, 0, which was the analog device. I fixed this by manually
> > > creating two alsa sinks in pulse config, one for hw:0,0 and hw:0,1.
> > >
> > > Shouldn't pulse and hal been able to automatically figure out that I
> > > have two alsa sinks and given me the option to choose?
> > Yes, of course. Would be awesome. However, neither HAL nor ALSA
> > provide enough information about whether the SPDIF and analog outputs
> > are exclusive to each other or not.
> > If they are not exclusive (which is the case on most devices) we need
> > to be able to switch the output during runtime.
Actually I wanted to say here "If they *are* exclusive we need ...".
> When they are not exclusive there should only be one ALSA device.
> I have two playback devices.
> jonsmirl at terra:/proc/asound$ cat devices
> 0: [ 0] : control
> 6: [ 0- 2]: hardware dependent
> 16: [ 0- 0]: digital audio playback
> 17: [ 0- 1]: digital audio playback
> 24: [ 0- 0]: digital audio capture
> 33: : timer
I see only one card here, with index 0.
The mapping of ALSA devices to functionality is not as straightforward
as you might think. Even if ALSA exposes two devices for one card, they
might still be exclusive to each other and cannot be used in
parallel. (For example my HDA hw is like that)
Again: without some kind of probing there is not way to determine
which combiantions of digital/analog/recording work and which don't,
right now. I will add this eventually (unless the ALSA guys should add
some sensible API to enumerate the possible combinations).
> I expected HAL to give me a choice of the two playback devices. The
> are both visible in gnome-device-manager.
Yes, they are visible, but both have card index 0, and HAL doesn't
tell us if I can use them simultaneously or not. And ALSA doesn't tell
us that either.
The whole story is even worse BTW. On a lot of hardware if you enaeble
surround sound you loose the functionality to record at the same
time. So you can choose "Stereo Recording + Stereo Playback" or
"Surround Playback + No Recording". Right now we always default to
stereo playback and initialize playback before recording. We thus
usually get sensible behaviour by default. And yes, this is the primary
reason why we don't ship surround sound enabled by default, and still
require users to patch config files if they want to use it.
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss