Even if the linux audio stack is not as complicated as the graphics stack, I still had a hard time to know how to tweak my config from just reading the official documentation. I will try to cover different views of the system.

The stack from application to hardware

alsa_stack

Mismatch between configuration and logical pcm views

config_vs_logical

An example of configuration

  pcm.slave0 {
    type slave
    pcm "hw:2,0"
  }

  pcm_slave.slave1 {
    pcm "hw:2,0"
  }

  pcm.alsa_test {
    type plug
    #slave slave0       # KO pcm.slave0 {type slave}
    #slave slave1       # OK pcm_slave.slave1
    #slave.pcm "hw:2,0"
    #slave.pcm "dmix:2,0"

    #slave.pcm "pcm.default"        # not the same as cards.pcm.default
    #slave.pcm "cards.pcm.default"  # works but has never been defined

    #slave.pcm "cards.USB-Audio.pcm.iec958.0:2,4,130,0,2"
    #slave.pcm "cards.USB-Audio.pcm.front.0:2"
    #slave.pcm "cards.USB-Audio.pcm.default:2"

    #slave.pcm "pcm.iec958:2,0"
    #slave.pcm "cards.pcm.iec958:2,0"
  }

Interfaces

Unresolved questions

Sources