ALSA configuration

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
berarma
Posts: 63
Joined: 2008-03-22 21:13

ALSA configuration

#1 Post by berarma »

I've been having some problems since udev decided to change the module loading order at every boot for my ALSA devices. Finally, I've taken the time to find a solution and I'm sharing it here. I'm using ALSA card names as recommended. Other solutions and/or improvements welcomed.

First, list your ALSA cards to choose your default one. You can list your available cards by doing "cat /proc/asound/cards", the card name is shown between brackets. In the following, you should replace <CARDNAME> with the name of the card you want to use as default card.

Contents for /etc/asound.conf:

Code: Select all

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm dmix:<CARDNAME>
    }
    capture.pcm {
        type plug
        slave.pcm dsnoop:<CARDNAME>
    }
}
ctl.!default {
    type hw
    card <CARDNAME>
}
This is not related to the problem above, but I think it's handy to have here. I want to be able to use the Jack server and Alsa apps at the same time, so I have set ~/.asoundrc up like this:

Code: Select all

pcm.!default {
    type plug 
    slave.pcm jack
}
pcm.jack {
   type jack
   playback_ports {
       0 alsa_pcm:playback_1
       1 alsa_pcm:playback_2
   }
   capture_ports {
       0 alsa_pcm:capture_1
       1 alsa_pcm:capture_2
   }
}
ctl.!default {
    type hw
    card <CARDNAME>
}
Since I'm not always using the Jack server, I've set qjackctl up so that it calls a start/stop script that moves this file from/to a different name. You should also configure the ALSA device for Jack as "hw:<CARDNAME>" to avoid some warnings and get better performance.

I hope this gets solved in Debian soon so it's handled automatically with minimal manual configuration.

Jesse2004
Posts: 20
Joined: 2011-09-07 13:23

Re: ALSA configuration

#2 Post by Jesse2004 »

Thanks, berarma. It helps me a lot!

Post Reply