[alsa-devel] ALSA, GStreamer and surround

Takashi Iwai tiwai at suse.de
Thu Mar 29 17:11:40 CEST 2007


At Thu, 29 Mar 2007 17:05:00 +0200,
Christian F.K. Schaller wrote:
> 
> On Thu, 2007-03-29 at 16:41 +0200, Takashi Iwai wrote:
> > At Thu, 29 Mar 2007 16:37:51 +0200,
> > Christian F.K. Schaller wrote:
> > > 
> > > On Thu, 2007-03-29 at 16:17 +0200, Takashi Iwai wrote:
> > > > At Thu, 29 Mar 2007 15:57:22 +0200,
> > > > Christian F.K. Schaller wrote:
> > > > > 
> > > > > On Thu, 2007-03-29 at 14:01 +0200, Takashi Iwai wrote:
> > > > > 
> > > > > <snip>
> > > > > > > Since Jan brought up the issue of behaviour differences between
> > > > > > > plug:surround51 ad surround51 I thought I give you the output of that
> > > > > > > too.
> > > > > > > 
> > > > > > > aplay -D surround51:0 dust51.wav 
> > > > > > > Playing WAVE 'dust51.wav' : Signed 16 bit Little Endian, Rate 48000 Hz,
> > > > > > > Channels 6
> > > > > > > aplay: set_params:878: Broken configuration for this PCM: no
> > > > > > > configurations available
> > > > > > > 
> > > > > > > aplay -D plug:surround51:0 dust51.wav 
> > > > > > > Playing WAVE 'dust51.wav' : Signed 16 bit Little Endian, Rate 48000 Hz,
> > > > > > > Channels 6
> > > > > > > ALSA lib pcm_params.c:2152:(snd_pcm_hw_refine_slave) Slave PCM not
> > > > > > > usable
> > > > > > > aplay: set_params:878: Broken configuration for this PCM: no
> > > > > > > configurations available
> > > > > > 
> > > > > > Which hardware do you have and which alsa-lib version are you using?
> > > > > > surround51 should work in this case...
> > > > > 
> > > > > [cschalle at localhost Desktop]$ aplay -l
> > > > > **** List of PLAYBACK Hardware Devices ****
> > > > > card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 0: Intel ICH [Intel
> > > > > 82801DB-ICH4]
> > > > >   Subdevices: 1/1
> > > > >   Subdevice #0: subdevice #0
> > > > > card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 4: Intel ICH - IEC958
> > > > > [Intel 82801DB-ICH4 - IEC958]
> > > > >   Subdevices: 1/1
> > > > >   Subdevice #0: subdevice #0
> > > > > 
> > > > > [cschalle at localhost Desktop]$ rpm -qa|grep alsa
> > > > > alsa-lib-1.0.14-0.1.rc1.fc6
> > > > > alsa-lib-devel-1.0.14-0.1.rc1.fc6
> > > > > alsa-tools-1.0.12-4.fc6
> > > > > alsa-utils-1.0.14-0.1.rc1.fc6
> > > > 
> > > > So far, so good.  And which codec chip?
> > > > 
> > > > You may see more (sometimes too) verbose errors when you set
> > > > the environment variable LIBASOUND_DEBUG=1 or 2.  Give it a try.
> > > > 
> > > Hi Takashi
> > > 
> > > How do I figure out the codec chip?
> > 
> > Grr, sorry, I removed a line while I corected the later sentenses.
> > Look at /proc/asound/card0/codec97#0/* files.
> > 
> > > Also I am not sure what you are
> > > looking for here, are you saying that the surround51 device should work
> > > even on stereo only soundcards?
> > 
> > No, "surround51" is exclusive to 6 channels.
> > 
> > > and by using that Alsa should
> > > automatically downmix?
> > 
> > Actually, it's a bit complicated.  Currently, "default" PCM is set up
> > for two channels.  You can override it as 5.1 channels, or even a
> > virtual 5.1 surround for headphone.  The automatic upmix is also
> > possible if you set up 5.1 as default.  However, all these things are
> > not provided "as is".  This is really what we have to consider how to
> > do better.
> > 
> > I personally am not satisfied by the current implementation from
> > usability POV.  So, any suggestions for further improvements are
> > welcome.
> > 
> > 
> > thanks,
> > 
> > Takashi
> 
> 
> Ok, so the content of that file is:
> 0-0/0: SigmaTel STAC9750,51
> 
> PCI Subsys Vendor: 0x1028
> PCI Subsys Device: 0x0191
> 
> Capabilities     : -headphone out-
> DAC resolution   : 20-bit
> ADC resolution   : 20-bit
> 3D enhancement   : SigmaTel 3D Enhancement
> 
> Current setup
> Mic gain         : +20dB [+20dB]
> POP path         : pre 3D
> Sim. stereo      : off
> 3D enhancement   : off
> Loudness         : off
> Mono output      : MIX
> Mic select       : Mic1
> ADC/DAC loopback : off
> Extended ID      : codec=0 rev=1 AMAP DSA=0 SPDIF VRA
> Extended status  : SPCV SPDIF=10/11 VRA
> PCM front DAC    : 48000Hz
> PCM ADC          : 48000Hz
> SPDIF Control    : Consumer PCM Category=0x2 Generation=1 Rate=48kHz

OK this explains all.  This codec has no surround outputs.  So, 5.1
output isn't really supported.

> So my suggestion so far when we have been discussing this inside the
> GStreamer community is to use 'front' as default device instead of
> 'default'.

A drawback of "front" is that it doesn't include the software mixing
feature.  (Dito for "surround*" and "spdif")  So far, only "default"
PCM has a dmix as it is. If gstream is the only sound system, it'd be
fine, though.

> That way we will always play(downmix) all channels and nobody 'lose'
> sound. We can then provide configuration GUI's like Totem do to override
> this when people have surround capable systems (meaning both capable
> card and connected speakers). Do this sound like a reasonable approach t
> you?

It sounds reasonable to me.

Or, you can simply assume number of channels for each preset, i.e. 2ch
= default, 4ch = plug:surround40, 5.1ch = plug:surround51, without
querying alsa-lib.


Takashi


More information about the Alsa-devel mailing list