You are not logged in.

#1 2006-07-04 19:11:57

omgwtfbyobbq
Member
Registered: 2006-07-04
Posts: 226

How to specify which dmix device to use if possible?

When using two sound cards, I know I can set up my ~/.asoundrc such that alsa uses dmix for one card, and the other uses oss (no mixing), but I was wondering if alsa can have multiple software mixing devices for multiple cards, and if so, how would I specify what device/card to use in various *configs since the default alsa10, or alsa will only go to the first card.

*/etc/mplayer/mplayer.conf, /etc/libao.conf, xmms' preferences, etc..

Offline

#2 2006-07-04 19:32:57

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: How to specify which dmix device to use if possible?

Looking at my ~/.asoundrc I would guess something like this:

pcm.dsp0 {
    type plug
    slave.pcm "dmix"
}

ctl.mixer0 {
    type hw
    card 0
}

pcm.dsp1 {
    type plug
    slave.pcm "dmix"
}

ctl.mixer1 {
    type hw
    card 1
}

I don't have 2 audio cards and can't test it - but you can wink
Not sure how to configure mplayer.conf and such though. In audacious and iirc also xmms you can change output device under output plugin preferences.

Offline

#3 2006-07-04 23:09:15

omgwtfbyobbq
Member
Registered: 2006-07-04
Posts: 226

Re: How to specify which dmix device to use if possible?

Here's the weird thing, when I slap in the extra card, it appears that alsa configures everything correctly. Using your suggested ~/.asoundrc and no ~/.asoundrc results in the same output since the same devices are created at boot.

ls -l /dev/sound
total 0
crw-rw---- 1 root audio 14, 12 2006-07-04 00:57 adsp
crw-rw---- 1 root audio 14, 28 2006-07-04 00:57 adsp1
crw-rw---- 1 root audio 14,  4 2006-07-04 00:57 audio
crw-rw---- 1 root audio 14, 20 2006-07-04 00:57 audio1
crw-rw---- 1 root audio 14,  3 2006-07-04 00:57 dsp
crw-rw---- 1 root audio 14, 19 2006-07-04 00:57 dsp1
crw-rw---- 1 root audio 14,  0 2006-07-04 00:57 mixer
crw-rw---- 1 root audio 14, 16 2006-07-04 00:57 mixer1
crw-rw---- 1 root audio 14,  1 2006-07-04 00:57 sequencer
crw-rw---- 1 root audio 14,  8 2006-07-04 00:57 sequencer2

When I configure xmms, I can only get sound from the second card (ice1724) if I specify that xmms use /dev/dsp1 (At least I know it works). Everything else, including hw:1,0 and hd:1,1 produces nothing on the second sound card (Please check your sound card is configured... etc). If I specify the use of alsa and the default PCM then everything gets mixed through the onboard sound card (intel8x0). I go to vlc, and try to use /dev/dsp1, but get nothing.

VLC media player 0.8.5 Janus
[00000330] main audio output error: no decoder thread
[00000330] main audio output error: no decoder thread

Since I've had luck using this config for the ice1724 card I found in the Gentoo wiki

pcm.!default {
   type plug
   slave.pcm "dmixer"
}

pcm.dmixer  {
   type dmix
   ipc_key 1024
   slave {
      pcm "hw:1,0"
      format S32_LE
      period_time 0
      period_size 1024

# increased buffer_size because in my system 1024 cause bad
# audio performance (for totem media player and mplayer)
      buffer_size 8192

      rate 44100
   }
   bindings {
      0 0
      1 1
   }
}

ctl.dmixer {
   type hw
   card 1
   device 0
} 

I tried it and found some serious weirdness. This will allow both cards to mix at the same time (Like firefox running two of google's videos with default_driver=alsa10 on intel8x0, while two instances of vlc (or any combo of mplayer, vlc and xmms) are running using default alsa on ice1724). However, since I'm not sure what to specify so each app goes to the other sound card, I'm in a bit of a rut. How can I tell vlc I want it to use the onboard card (intel8x0), or tell libao to use the pci card (ice1724)?

Something else that's odd, hw:1,1 is consistently spelled as IEC1724 (as opposed to ICE1724 for hw:1,0) for both vlc and xmms when I have it detect/refresh the list of available outputs. I wonder if this is related to the trouble I'm having and why I can't specify either one of those devices successfully? In any event, with that config alsa can mix for both cards, but due to the limitations of specifying what device a program should use, I can't configure stuff correctly.  :?

edited for clarity

Offline

Board footer

Powered by FluxBB