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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2018-05-19 at 21:31 +0300, Nazar Mokrynskyi wrote:
> 19.05.18 18:29, Tanu Kaskinen пиÑ?е:
> > Thanks! I applied this to the "next" branch.
> > 
> > If you feel like doing more polishing work, it would be nice if you
> > could add the surround21, surround40 and surround41 device definitions
> > for this card to alsa-lib in a way that doesn't move the LFE channel to
> > a wrong position, and then change this configuration to use the
> > appropriate alsa devices rather than using surround51.
> 
> That would be a perfect solution, but I'm not a C developer and have
> no idea how to approach it.

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).

> 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.

-- 
Tanu

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


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux