dmix+dsnoop on same device = shm problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've suffered a harddrive failure and am having to reconfigure parts I
deemed too uncritical to back up, including my asoundrc (that'll teach
me). The first part of that was getting dmix+dsnoop working on my
soundcard, so I'm starting with this:

pcm.!default {
  type plug
  slave { pcm "hwm" rate 48000 format S32_LE }
}

pcm.hw_capture {
  type dsnoop
  ipc_key 1000
  slave { pcm "hw:DG,0" format S32_LE rate 48000 }
}
pcm.hw_playback {
  type dmix
  ipc_key 1001
  slave { pcm "hw:DG,0" format S32_LE rate 48000 }
}

pcm.hwm {
  type asym
  playback.pcm "hw_playback"
  capture.pcm  "hw_capture"
}

Further information on my system: 64-bit Gentoo running a 4.0.5
kernel, with alsa-lib version 1.0.29. 

The following commands all work individually, omitting the common
parameters "-f S32_LE -r 48000 -c 2":

arecord -D hw:DG,0
arecord -D plug:hw_capture
arecord -D plug:hwm
aplay   -D hw:DG,0
aplay   -D plug:hw_playback
aplay   -D plug:hwm

It's also possible to combine them like this (either with pipes, or
using separate in-/outputs):

arecord -D plug:hw_capture | aplay -D hw:DG,0
arecord -D hw:DG,0 | aplay -D plug:hw_playback

If I however start them on hw_capture/hw_playback at the same time, I
get an error from the second process, either from aplay/dmix:

alsa-lib-1.0.29/src/pcm/pcm_dmix.c:1095:(snd_pcm_dmix_open) unable to initialize sum ring buffer

or from arecord/dsnoop:

alsa-lib-1.0.29/src/pcm/pcm_dsnoop.c:596:(snd_pcm_dsnoop_open) unable to create IPC shm instance

So there seems to be something screwy going on with the shared memory
stuff happening there.

strace on aplay shows the following shm calls just before it prints
the error:

shmget(0x33ea, 144000, IPC_CREAT|0600)  = -1 EINVAL (Invalid argument)
shmget(0x33ea, 0, 0600)                 = 9830417
shmctl(9830417, IPC_STAT, 0x7ffdea3c81b0) = 0

and on arecord it shows these:

semget(0x33ea, 1, IPC_CREAT|0600)       = 5996545
semop(5996545, {{0, 0, 0}, {0, 1, SEM_UNDO}}, 2) = 0
shmget(0x33ea, 488, IPC_CREAT|0600)     = 10027026
shmat(10027026, 0, 0)                   = 0x7f4369890000
mlock(0x7f4369890000, 488)              = 0
shmctl(10027026, IPC_STAT, 0x7ffd12287da0) = 0
shmdt(0x7f4369890000)                   = 0
shmctl(10027026, IPC_STAT, 0x7ffd12287d10) = 0

My first guess was that I had the ipc_keys configured incorrectly, but
they're different, so that shouldn't be it. /dev/shm also shows a
bunch of files owned by my user, so generally that should be working
as well. If anybody has any suggestions on how to proceed they'd be
greatly appreciated. :)

Cheers,
--Valentin

------------------------------------------------------------------------------
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux