Monday, November 29, 2010

ALSA, two cards

My nVidia on-board analog sound output is busted for some reason. Bought an Asus Sonar DX. Now, I blacklisted snd-pcsp to make sure it does not mess with devices index. My /etc/modprobe.conf looks like (audio portion):

alias char-major-116 snd
options snd-virtuoso index=0     # sonar
options snd-hda-intel index=1    #nvidia
alias sound-card-0 snd-virtuoso
alias sound-card-1 snd-hda-intel

alias sound-slot-0 snd-virtuoso
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss 
alias sound-service-0-3 snd-pcm-oss 
alias sound-service-0-8 snd-seq-oss 
alias sound-service-0-12 snd-pcm-oss

alias sound-slot-1 snd-hda-intel
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss 
alias sound-service-1-3 snd-pcm-oss 
alias sound-service-1-8 snd-seq-oss 
alias sound-service-1-12 snd-pcm-oss

My /etc/asound.conf is like this in order to map stereo to all channels:

pcm.!default ch51dup

pcm.DX {
    type hw
    card 0
}
ctl.DX {
    type hw
    card 0
}

pcm.ch51dup {                     
  slave.pcm surround51:DX
   slave.channels 6
    type route
     hint {
             show on
                description "Stereo to Surround 5.1"
        }
         ttable.0.0 1
         ttable.1.1 1
         ttable.0.2 1
         ttable.1.3 1
         ttable.0.4 1
         ttable.1.4 1
         ttable.0.5 1
         ttable.1.5 1
         }

The only user using the (still working) nVidia HDMI audio is mythtv so
/var/lib/mythtv/.asoundrc is:

pcm.!default hdmi:NVidia

Firefox will pick up the defaut device (ch51dup) but others apps do not necessarily (Amarok for instance). Had to configure multimedia settings in KDE to use the ch51dup alsa virtual device, but it only shows up in the list if the "hint" portion is there in the device's definition (from  http://userbase.kde.org/Phonon). Using the xine backend, best support apparently...

No comments: