Outils pour utilisateurs

Outils du site


alsa-4sorties

Différences

Ci-dessous, les différences entre deux révisions de la page.


alsa-4sorties [2024/02/09 17:10] (Version actuelle) – créée - modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +====== alsa 4 sorties avec 2 cartes USB ======
  
 +mettre dans .asoundrc
 +<code>
 +# Utilise card "les2" par defaut a travers le plugin "plug"
 +# converti automatiquement channels, rate et format.
 +pcm.!default {
 +  type plug
 +  slave {
 +    pcm "les2"
 +    rate 44100
 +    channels 2
 +  }
 +}
 +
 +ctl.!default {
 +  type hw
 +  card "CODEC"
 +}
 +
 +pcm.usb1 {
 +  type hw
 +  card "CODEC"
 +  channels 2
 +  rate 44100
 +}
 +
 +ctl.usb1 {
 +  type hw
 +  card "CODEC"
 +}
 +
 +pcm.usb2 {
 +  type hw
 +  card "Device"
 +  channels 2
 +  rate 44100
 +}
 +
 +ctl.usb2 {
 +  type hw
 +  card "Device"
 +}
 +
 +# Creer card "les2", wrapper autour du plugin : "route".
 +pcm.les2 {
 +  # The "route" plugin routes channels from its input card to its output.
 +  type route
 +
 +  # Slave is the input card.
 +  slave {
 +    # The virtual input card has 4 channels. Yes, this is circumstantial and
 +    # also must be specified explicitly.
 +    channels 4
 +
 +    # Unnamed definition of the input card.
 +    pcm {
 +      # The "les2" plugin merges several cards into one. This is necessary,
 +      # because the "route" plugin can only handle one card.
 +      type multi
 +  
 +      # Definition of the child cards.
 +      slaves {
 +        # Definition of child card "a".
 +        a {
 +          pcm {
 +            type dmix
 +            ipc_key 1024
 +            slave.pcm "usb1"
 +          }
 +          channels 2
 +        }
 +        b {
 +          pcm {
 +            type dmix
 +            ipc_key 2048
 +            slave.pcm "usb2"
 +          }
 +          channels 2
 +        }
 +      }
 +
 +      # Definition of the card's channels.
 +      bindings {
 +        # Channel 0...
 +        0 {
 +          # ... bound to child card "a"'s...
 +          slave a
 +          # ... channel 0.
 +          channel 0
 +        }
 +        1 {
 +          slave a
 +          channel 1
 +        }
 +        2 {
 +          slave b
 +          channel 0
 +        }
 +        3 {
 +          slave b
 +          channel 1
 +        }
 +      }
 +    }
 +  }
 +  ttable {
 +    # Channel 0...
 +    0 {
 +      # ... bound to child card's channel 0 at full volume...
 +      0 1.0
 +      # ... AND child child card's channel 1 at full volume.
 +      1 1.0
 +    }
 +    1 {
 +      2 1.0
 +      3 1.0
 +    }
 +  }
 +}
 +
 +
 +</code>