Greetings,

I want to make a universal multi mapping. So far I have the following 4 
channel version based on 
http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php#jackplug

But it has some shortcomings I'd like to fix, don't know how

Q1: is there any way I can inherit all the @args [ CARD DEV SUBDEV ] etc from 
a common definition somewhere.

Q2: can I get the actual assigned subdevice index for slaves.a, and use it to 
calculate the subdev for slaves.b
Because using "ttable4:1,0,0" works but "ttable4:1" doesnt because of the 
calculation of the 2nd subdevice index:
 subdevice { @func iadd integers [ $SUBDEV 1 ] }

Q3: I'd like to parameterise the number of channels, so I can make 3,4,5,6,7, 
or 8 channel. Can I do this rather than repeat the whole thing 6 times with 
differing channel counts?  ?Another way to ask this may be "Can I use looping 
constructs in asoundrc?"

for n in 0 to 5:
   ttable.$n.$n 1



pcm.ttable4 {
        @args [ CARD DEV SUBDEV ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_PCM_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.pcm.card
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars [
                                ALSA_PCM_DEVICE
                        ]
                        default {
                                @func refer
                                name defaults.pcm.device
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default 0
        }
        type route;
        hint {
                show {
                        @func refer
                        name defaults.namehint.basic
                }
                description "4 channel multi route"
        }
        slave.pcm {
                type multi;
                slaves.a.pcm {
                        type hw
                        card $CARD
                        device $DEV
                        subdevice $SUBDEV
                        #mmap_emulation true
                }
                slaves.a.channels 2;
                slaves.b.pcm {
                        type hw
                        card $CARD
                        device $DEV
                        subdevice { @func iadd integers [ $SUBDEV 1 ] }
                        #mmap_emulation true
                }
                slaves.b.channels 2;
                bindings.0.slave a;
                bindings.0.channel 0;
                bindings.1.slave a;
                bindings.1.channel 1;
                bindings.2.slave b;
                bindings.2.channel 0;
                bindings.3.slave b;
                bindings.3.channel 1;
        }
        ttable.0.0 1;
        ttable.1.1 1;
        ttable.2.2 1;
        ttable.3.3 1;
}


thanks

--
Eliot

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to