Re: Using the 'multi' plugin

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

 



Val, with this .asoundrc file I could make my M-Audio Fast Track Pro work (see my post on this list one week ago) with two simultaneous and independent stereo channels. It is a single device but the system recognizes it as two separate usb audio devices. Hope it helps you.

>>> /home/rodrigo/.asoundrc:
pcm.ftpro {
    @args [ CARD DEV ]
    @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
            }
        }
    }
    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
        }
        slaves.a.channels 2;
        slaves.b.pcm {
            type hw
            card $CARD
            device { @func iadd integers [ $DEV 1 ] }
        }
        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;
}
# sometimes apps need matching ctl device
ctl.ttable4 {
    @args [ CARD DEV ]
    @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
            }
        }
    }
    type hw;
    card $CARD;
}


>>>
Then I point to the device as ftpro:1,0. Maybe you'll need to point to two different cards using @func iadd integers [ $CARD 1 ] }. Or maybe just forget about the $ flags and just hard code the card and device numbers.

Rodrigo


On Fri, Nov 28, 2008 at 5:36 AM, Val <vace117@xxxxxxxx> wrote:
On Fri, 2008-28-11 at 01:22 -0600, Val wrote:
> I thought that 'aplay -Dboth test.wav' would do what I want with the
> above config, but I only get sound on the nforce card.

oh, yes, I just remembered to add - the verbose output of aplay looks
correct to me, which makes this even more puzzling:

aplay -Dboth -v test.wav
------------
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,
Stereo
Route conversion PCM
 Transformation table:
   0 <- 0
   1 <- 1
   2 <- 0
   3 <- 1
Its setup is:
 stream       : PLAYBACK
 access       : RW_INTERLEAVED
 format       : S16_LE
 subformat    : STD
 channels     : 2
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 16
 buffer_size  : 6552
 period_size  : 1638
 period_time  : 37142
 tick_time    : 4000
 tstamp_mode  : NONE
 period_step  : 1
 sleep_min    : 0
 avail_min    : 1638
 xfer_align   : 1638
 start_threshold  : 6552
 stop_threshold   : 6552
 silence_threshold: 0
 silence_size : 0
 boundary     : 1717567488
Slave: Multi PCM
 Channel bindings:
   0: slave 0, channel 0
   1: slave 0, channel 1
   2: slave 1, channel 0
   3: slave 1, channel 1
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_NONINTERLEAVED
 format       : S16_LE
 subformat    : STD
 channels     : 4
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 16
 buffer_size  : 6552
 period_size  : 1638
 period_time  : 37142
 tick_time    : 4000
 tstamp_mode  : NONE
 period_step  : 1
 sleep_min    : 0
 avail_min    : 1638
 xfer_align   : 1638
 start_threshold  : 6552
 stop_threshold   : 6552
 silence_threshold: 0
 silence_size : 0
 boundary     : 1717567488
Slave #0: Plug PCM: Route conversion PCM (sformat=S32_LE)
 Transformation table:
   0 <- 0
   1 <- 1
   2 <- none
   3 <- none
   4 <- none
   5 <- none
   6 <- none
   7 <- none
   8 <- none
   9 <- none
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S16_LE
 subformat    : STD
 channels     : 2
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 16
 buffer_size  : 6552
 period_size  : 1638
 period_time  : 37142
 tick_time    : 4000
 tstamp_mode  : NONE
 period_step  : 1
 sleep_min    : 0
 avail_min    : 1638
 xfer_align   : 1638
 start_threshold  : 6552
 stop_threshold   : 6552
 silence_threshold: 0
 silence_size : 0
 boundary     : 1717567488
Slave: Hardware PCM card 0 'M Audio Audiophile 24/96' device 0 subdevice
0
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S32_LE
 subformat    : STD
 channels     : 10
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 24
 buffer_size  : 6552
 period_size  : 1638
 period_time  : 37142
 tick_time    : 4000
 tstamp_mode  : NONE
 period_step  : 1
 sleep_min    : 0
 avail_min    : 1638
 xfer_align   : 1638
 start_threshold  : 6552
 stop_threshold   : 6552
 silence_threshold: 0
 silence_size : 0
 boundary     : 1717567488
Slave #1: Plug PCM: Hardware PCM card 1 'NVidia nForce2' device 0
subdevice 0
Its setup is:
 stream       : PLAYBACK
 access       : MMAP_INTERLEAVED
 format       : S16_LE
 subformat    : STD
 channels     : 2
 rate         : 44100
 exact rate   : 44100 (44100/1)
 msbits       : 16
 buffer_size  : 6552
 period_size  : 1638
 period_time  : 37142
 tick_time    : 4000
 tstamp_mode  : NONE
 period_step  : 1
 sleep_min    : 0
 avail_min    : 1638
 xfer_align   : 1638
 start_threshold  : 6552
 stop_threshold   : 6552
 silence_threshold: 0
 silence_size : 0
 boundary     : 1717567488
------------





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url="">
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



--
Rodrigo Rodrigues da Silva
Engenharia de Computação - Coop8

"Free software is defined as software that respects four fundamental freedoms: (0) freedom to run the software as you wish, (1) freedom to study the source code and modify it to do what you wish, (2) freedom to make and redistribute copies, and (3) freedom to publish modified versions." Richard Stallman

"Não importa como morre o home, importa como vive." Carijó, velho do rio.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux