LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2007, 08:33 PM   #1
lcbest
LQ Newbie
 
Registered: Nov 2005
Location: Arvada, CO USA
Distribution: Debian GNU/Linux
Posts: 4

Rep: Reputation: 0
ALSA, dmix, and dsnoop weirdness.


Hello All,

This is my first post here so apologies in advance for any new-poster faux pas. I'm not, however, a Linux newbie, for whatever that's worth.

The short description is this: I cannot get 'dmix' and 'dsnoop' to work at the same time. Here's a bit about my system. I'm running Debian Testing/Etch from about a week ago. I run GNOME with 'pulseaudio' instead of 'esd'. The ALSA libs and utils are 1.0.13 and the kernel stuff is whatever is in whichever kernel I choose at the time. I've tried 2.6.18 (ALSA 1.0.12rc-1), 2.6.18.8 (ALSA 1.0.13) and several minor revs of 2.6.20 including the latest (2.6.20.6, ALSA 1.0.14rc1). My sound card is a SoundBlaster PC-512 which seems to work as a SB Live! and the emu10k driver. In the past this has worked flawlessly.

So here's what happens. With no .asoundrc and no /etc/asound.conf mixing on output works flawlessly. The pulseaudio daemon and other apps share the sound card without problems. Playing MIDI files only works with the 2.6.18 kernel but I can use 'timidity' for that and that seems to be a different issue. Regardless of what kernel I use though sound capture is _not_ shared. If, say, the pulseaudio daemon is running then all programs that record sound through ALSA (like 'arecord' and 'gnome-sound-recorder') fail because "Device or resource busy'. If I kill 'pulseaudio' then, of course, one other app can record but not a second (not simultaneously that is). On the other hand, if I create a .asoundrc that sets up a plug device with dmix on output and dsnoop on input then the sound input is shared correctly but output is not! For example, if I try to run two 'aplay' instances (but no pulseaudio) the first runs fine but the second fails with:

--------
ALSA lib pcm_dmix.c:914snd_pcm_dmix_open) unable to open slave
aplay: main:550: audio open error: Invalid argument
--------

I've tried quite a few variations on the .asoundrc and all have this problem. Apparently this is unconnected with dsnoop because if I _just_ set up dmix as, say:

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

pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 0
}
--------

(copied from the alsa-project site) I still get the same error. So my question is, is this a known problem with recent ALSA/kernels/whatever? Or am I just doing something wrong? Or ... ? Any help, info, clues, etc. would be greatly appreciated. If there is any other relevant info I can post that might be of help I'd be glad to do so.

Cheers
Leland
 
Old 04-12-2007, 08:39 PM   #2
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Rep: Reputation: 31
i thought there was hardware mixing with emu10k...?
dmix is a software mixer...
 
Old 04-13-2007, 12:24 AM   #3
lcbest
LQ Newbie
 
Registered: Nov 2005
Location: Arvada, CO USA
Distribution: Debian GNU/Linux
Posts: 4

Original Poster
Rep: Reputation: 0
Bingo! Mostly.

Quote:
Originally Posted by r00tb33r
i thought there was hardware mixing with emu10k...?
dmix is a software mixer...
Yes, there is supposed to be hardware mixing with the emu10k. And now that you mention it that may be what is happening when there is no .asoundrc. Bingo! If I build a .asoundrc that just references my sound card for playback and uses 'dsnoop' for capture then everything works (well, not MIDI but ...)! Thanks! But, hmmmm? Shouldn't 'dmix' work even if there _is_ hardware mixing? Anyway, just in case someone is curious here is my .asoundrc:

--------
pcm.card0 {
type hw
card 0
}

pcm.mixin {
type dsnoop
ipc_key 2049
ipc_key_add_uid yes
slave {
pcm "card0"
period_time 0
period_size 1024
buffer_size 4096
periods 128
rate 48000
}

bindings {
0 0
1 1
}
}

pcm.mixio {
type asym
playback.pcm "card0"
capture.pcm "mixin"
}

pcm.!default {
type plug
slave.pcm "mixio"
}
--------

Thanks again! Although I am really curious about whether 'dmix' still aught to work.

Cheers
Leland
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission to use alsa dmix Ian_Hawdon Linux - Software 10 12-21-2005 09:09 AM
ALSA dmix: Permission Denied Davidian1024 Linux - Software 0 10-09-2005 12:48 PM
alsa dmix in ubuntu compujas Linux - General 2 08-17-2005 08:54 AM
ALSA dmix + Skype = no go zenith_zth Linux - Hardware 0 06-12-2005 04:38 PM
alsa and dmix for software mixing darkleaf Linux - Software 6 04-02-2005 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration