miceagol,
I was in #alsa yesterday and got this sucker working BRILLIANTLY! Full 5.1, as well as regular upmixing with 2channels videos and songs, and also couldn't play multiple prog sounds simultaneously, but fixed all of this with wishie (a genius!!)'s help!
Here's my .asoundrc:
Code:
# <wishie[out]> that is where i force ALSA to use my "default" device, not its own internally defined one.
# <wishie[out]> type "plug" means its going through the "plug" plugin, which does sample rate/format conversion
# <wishie[out]> slave.pcm "duplex"
# <wishie[out]> means to pass the audio stream to the pcm.duplex device..
# <wishie[out]> type asym <-- makes a 'full duplex' (input/output) device.
# <wishie[out]> so for output (playback) pass the audio on to "ch51dup"
# <wishie[out]> and for input (capture) use hw:0
# <wishie[out]> hw:0 just means your first soundcard.
# <wishie[out]> now to the tricky stuff...
# <wishie[out]> pcm.ch51dup
# <wishie[out]> type route <-- means we want to route audio to other speakers/channels
# <wishie[out]> the interesting parts here, are the ttable lines
# <wishie[out]> front left/right are channels "0" and "1"
# <wishie[out]> so, we are doing the following
# <wishie[out]> ttable.0.0 1 <-- copying channel 0 to speaker 0 with gain (volume) of 1
# <wishie[out]> ttable.1.1 1 <-- copying channel 1 to speaker 1 with gain (volume) of 1
# <wishie[out]> ttable.0.2 1 <-- copying channel 0 (front left) to speaker 2 (rear left) with volume 1
# <wishie[out]> now, for the center.. we have 2 entries..
# <wishie[out]> ttable.0.4 0.5
# <wishie[out]> ttable.1.4 0.5
# <wishie[out]> first one says copy front left to the center speaker
# <wishie[out]> second one says copy the front right to the center speaker
# <wishie[out]> therefore, you are actually getting front left AND right signals from the center speaker
# <wishie[out]> same for the LFE (sub channel) which is speaker 5
# <wishie[out]> now, for the center and sub, you see i have the volume (gain) at 0.5
# <wishie[out]> since i found that using "1" was too over powering
# <wishie[out]> moving on..
# <wishie[out]> you will see it has slave.channels 6
# <wishie[out]> since we "upmixed" the 2 channel mp3 to 6 channels.
# <wishie[out]> and the "slave.pcm dmix6" tells alsa to pass the audio onto the device pcm.dmix6
# <wishie[out]> now, dmix6 basically takes 6 channels input, and passes it to its slave (which is hw:0,0)
# <wishie[out]> but, multiple programs can access dmix6 at the one time.
# <wishie[out]> where as only 1 program can access hw:0,0 at any time.
# <wishie[out]> so ALSA takes all the input via dmix6, mixes the streams together, THEN sends them to hw:0,0 (which is your soundcard)
# <wishie[out]> so, as far as your sound card is concerned, it is only getting accessed once.
# <wishie[out]> ALSA it taking care of the multiple sound streams, and making them all into one.
# 6 channel dmix:
pcm.dmix6 {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,0"
rate 48000
format "S32_LE"
channels 6
period_time 0
period_size 1024
buffer_time 0
buffer_size 8192
}
}
# upmixing:
pcm.ch51dup {
type route
slave.pcm dmix6
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 0.6
ttable.1.3 0.6
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
pcm.duplex {
type asym
playback.pcm "ch51dup" # upmix first
capture.pcm "hw:0"
}
# change default device:
pcm.!default {
type plug
slave {
pcm "duplex"
}
}
# for aoss
pcm.dsp "duplex"
pcm.dsp1 "duplex"
That gives me full 5.1 from a song in amarok or a regular video in vlc, etc.
AND, I got VLC working too! I popped in a DVD, started playing and all I need to do is click Audio > Audio Device > 5.1, and bam! Perfect, genuine 5.1 with movies, and 5.1 also plays at the same time as other programs too, so this is just a complete solution at last.
The M-Audio card is EXTREMELY recommended to anyone who wants a full, high-quality sound experience in linux!!!!
And thanks again for your help, miceagol! Now I really have no need to ever boot into windows
P.S. Also attached my /usr/share/alsa/alsa.conf for anyone who gets this card. Get it!
Bookmarks