You are not logged in.

#1 2005-12-06 04:27:04

phydeaux
Member
Registered: 2005-06-13
Posts: 68

alsa cmipci dmix.. it just won't mix..

I've been having this trouble for a while now.  I have an onboard C-Media PCI CMI8738-MC6 (cmipci) chip that I just can't get to work with dmix.  Everything is fine as long as only one program is trying to play sound.  Usually its mpd and gaim fighting for control of the sound, but I've tested it with alsaplayer and aplay with the same results.

Running alsaplayer -o alsa -d plug:dmix some.mp3 & aplay some.wav
results in ALSA lib pcm_dmix.c:819:(snd_pcm_dmix_open) unable to open slave
Google wasn't very helpful to me in trying to figure this one out.  A majority of what I read pointed to a bad ~/.asoundrc or /etc/asound.conf.  I've tried several now with no luck.  Though it wouldn't surprise me that I still don't have it right
My current ~/.asound.rc looks like this.  I copied this from the gentoo forums (I think thats where this one came from anyway I've tried many plus my own concoctions.  It was posted by someone who claimed to have the same card working)

.pcm.!default {
        type plug
        slave.pcm dmixer
}
                                                                         
pcm.dmixer {
        type dmix
        ipc_key 1024 # This must be a unique IPC key (see ipcs output)
        ipc_key_add_uid true # UID will be added to IPC key
        slave {
                pcm "hw:0"
                period_time 0
                period_size 1024 # Must be power of 2 for alsa-oss
                buffer_size 8192 # ditto
                rate 44100
        }
} 

I've read enough about this to make my head spin.. the fact I have the flu right now problaby doesn't help.. and I'm not getting anywhere.  I'm running alsa 1.0.10 so dmix should be there by default.. even with no .asoundrc or asound.conf.  The other thing I'm confused on is what should be in modprobe.conf for alsa.  I've tried both what alsaconf adds in there and the examples from the gentoo wiki, neither helped..

andy

Offline

#2 2005-12-06 18:09:42

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: alsa cmipci dmix.. it just won't mix..

Try this it worked for me that time I used my onboard soundcard.


Arch - It's something refreshing

Offline

#3 2005-12-07 21:19:53

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: alsa cmipci dmix.. it just won't mix..

I've tried everything alsa releated in the wiki.  I don't really want to run oss2jack or some other driver.  I've found several reports of these onboard cards working fine, some even with the 5.1 suround, nothing I've found with those post helps my problem though.  Just for fun this is the error message I get when I do aplay and alsaplayer using hte asound.conf in the wiki

 alsaplayer -o alsa -d plug:dmix /data/mp3's/kmfdm/Attak/KMFDM - 01 - attak-reload.mp3 & aplay /usr/share/sounds/gaim/arrive.wav 
[1] 17469
Playing WAVE '/usr/share/sounds/gaim/arrive.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
ALSA lib pcm_dmix.c:819:(snd_pcm_dmix_open) unable to open slave
snd_pcm_open: Device or resource busy (plug:dmix)
Failed to initialize plugin!
Failed to register plugin: /usr/lib/alsaplayer/output/libalsa_out.so
Failed to load output plugin "alsa". Trying defaults.
ALSA lib pcm_dmix.c:819:(snd_pcm_dmix_open) unable to open slave
snd_pcm_open: Device or resource busy (plug:dmix)
Failed to initialize plugin!
/usr/lib/alsaplayer/output/libalsa_out.so failed to load
jack: server not running?
/usr/lib/alsaplayer/output/libjack_out.so failed to load
error opening /dev/dsp
Failed to initialize plugin!
/usr/lib/alsaplayer/output/liboss_out.so failed to load
NOTE: THIS IS THE NULL PLUGIN.      YOU WILL NOT HEAR SOUND!!

  I don't know why its got errors about jack in there, I don't have any of that installed.  It makes me wish my old soundblaster live card had survived storage, ESD bag and all it was dead when I tried plugging it in.  It doesn't even show up when I scan the pci bus.

andy

Offline

#4 2005-12-10 20:05:58

holskoiff
Member
From: São Paulo
Registered: 2005-03-16
Posts: 38

Re: alsa cmipci dmix.. it just won't mix..

I also have the C-Media 3738 and it works just fine... and I don't have the /etc/asound.conf... it just works.


[]'s

Felipe Weckx

Offline

#5 2005-12-12 19:11:46

phydeaux
Member
Registered: 2005-06-13
Posts: 68

Re: alsa cmipci dmix.. it just won't mix..

I've figured it out and its a really silly mistake.  I never updated my libao.conf file when alsa was updated.  So I had the line default_driver=alsa09 in libao.conf (as per the wiki untill I just edited it) telling everything that used libao to look for the wrong alsa driver, I can see how that would be a problem.  I changed it to default_driver=alsa10 and dmix seems to be working.

I was still having trouble running anything with mpd, even though dmix was working and my mpd.conf was setup correctly for dmix only root could play sound while mpd was playing.  It turns out that dmix locks itself when in use for the current user and I had mpd running as root.  Adding the line  ipc_key_add_uid 0 into the pcm.dmixer block disables this.  Things seem to be working great now.  My current asound.conf

#/etc/asound.conf start:
pcm.!default {
  type plug
  slave.pcm "dmixer"
  }
pcm.dsp0 {
  type plug
  slave.pcm "dmixer"
  }
pcm.dmixer {
  type dmix
  ipc_key 1024
  ipc_key_add_uid 0
 slave {
  pcm "hw:0,0"
  period_time 0
  period_size 1024
 buffer_size 8192
  rate 44100
  }
 bindings {
  0 0
  1 1
  }
  }

ctl.dmixer {
  type hw
  card 0
  }
#end.

andy

Offline

Board footer

Powered by FluxBB