Gentoo, ALSA, On-board sound card, and a USB DAC

Hey all

So recently i bought an amp that could also be used as a dac.

This article assumes you have ALSA, a working sound card, and another device (USB DAC, etc)

Here is what i did to get it to work with and included script to make life easier.

First, i had to ensure that the kernel was set up for USB audio:

Device Drivers   -->
    Sound Card Support  -->
        Advanced Linux Sound Architecture  -->
            USB sound devices  -->
                   USB Audio/MIDI driver

Once that is configured we need to check the device list. I made it a little easier by running:
aplay -l | awk '/^card/ {print $1,$2,$3}' | sort -u
the output that i got was :

% aplay -l | awk '/^card/ {print $1,$2,$3}' | sort -u
card 0: PCH
card 1: Q1

which is telling me that i have two devices : PCH and Q1

Now I want the audio out through the DAC so i have to edit ~/.asoundrc to look like:

pcm.!default {
    type hw
    card 1

ctl.!default {
    type hw
    card 1

where we change the “card” value to “1” since we want to use the Q1 listed above in the aplay output

Now we just restart alsa and whatever audio application you were using:
sudo /etc/init.d/alsasound restart

To set your audio back to default you just change the card value in the .asoundrc file to 0

Here is the link to the shell script i wrote that will do this for you automagically


    Leave a Reply

    Your email address will not be published. Required fields are marked *