[pulseaudio-discuss] [PATCH] alsa-mixer: More output modes for SB Omni Surround 5.1 and cleanup

Tanu Kaskinen tanuk at iki.fi
Wed May 30 16:16:40 UTC 2018


On Fri, 2018-05-25 at 22:02 +0300, Nazar Mokrynskyi wrote:
> 20.05.18 14:09, Tanu Kaskinen пише:
> > You don't need to write C code, the alsa configuration system should
> > allow you to do this (the alsa configuration system is arguably even
> > more difficult than C, though). I had a look at
> > /usr/share/alsa/cards/USB-Audio.conf, and it already has a section for
> > defining surround40 on 6-channel hardware:
> > 
> > USB-Audio.pcm.surround40_six_channels {
> >         @args [ CARD ]
> >         @args.CARD { type string }
> >         type route
> >         ttable.0.0 1
> >         ttable.1.1 1
> >         ttable.2.4 1
> >         ttable.3.5 1
> >         slave {
> >                 pcm {
> >                         type hw
> >                         card $CARD
> >                         device 0
> >                 }
> >                 channels 6
> >         }
> > }
> > 
> > Using "type route" and the ttable parameters can be used to choose what
> > channels of the surround40 device are mapped to which channels on the
> > hardware.
> > 
> > The surround40_six_channels definition is used if the sound card is
> > configured appropriately in the surround40_type section:
> > 
> > USB-Audio.pcm.surround40_type {
> >         "AudioPhile" two_stereo_devices
> >         "Audiophile USB (tm)" two_stereo_devices
> >         "OmniStudio" two_stereo_devices
> >         "Quattro" two_stereo_devices
> >         "SB Audigy 2 NX" six_channels
> >         "USB AudioSport Quattro (tm)" two_stereo_devices
> > }
> > 
> > The first string is obviously used for matching the hardware, but I
> > don't know what identifier that is and where to find it for your sound
> > card (I'd start from /proc/asound/cards).
> 
> I've looked at that and don't think that it is possible to configure
> anything without proper syntax description, it is too cryptic.
> 
> However, this is not specific to my sound card or even to USB sound
> cards. Any 5.1-capable sound card should also support 2.0, 2.1, 4.0,
> 4.1, 5.0 and on Windows I believe there is even 3.1 mode (Left,
> Right, Center, Subwoofer). The same logic applies to 7.1-capable
> devices too.
> 
> Do you think this can be resolved in a generic way instead?

Solving this for any 7.1 or 5.1 card would require first testing if the
card can be opened with lesser number of cards, and if not, then
configuring the device with some silent channels. I don't know if the
alsa configuration syntax allows this kind of conditionality.
PulseAudio's configuration system doesn't support this.

> 
> > > BTW, it would be nice to support more advanced syntax in profile file like this:
> > > 
> > > > front-left,front-right,none,none,none,lfe
> > > 
> > > This would allow to avoid moving LFE to wrong position too without code changes.
> > 
> > Yes, that would be nice. It can already be approximated:
> > 
> >     front-left,front-right,aux1,aux2,aux3,lfe
> > 
> > will create a sink that has three aux channels that generally won't be
> > used. It doesn't look nice in UIs, though.
> 
> This actually works well from my testing so far (tried this and also
> added `aux1` for 4.1 mode), can you tweak this directly or should I
> send a patch separately?

Please send a patch.

-- 
Tanu

https://liberapay.com/tanuk
https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list