apulse: Apulse fails when an application opens a specially configured record device
I have two audio devices. The first one is a builtin IntelHDA sound card and the second one is a USB microphone. This setup will only work if I have a specially crafted .asoundrc. Here it is:
pcm.logitech
{
type hw
card LogitechUSB
}
pcm.usb
{
type dsnoop
ipc_key 234884
ipc_perm 0666
ipc_gid audio
slave {
pcm logitech
}
}
pcm.!default
{
type asym
playback.pcm
{
type plug
slave.pcm "dmix"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}
This file makes my USB microphone the default recording device. The problem with this set up is that Skype record ~0.5 seconds of audio and then fails.
It can be easily reproduced this way. Run this command, it will work:
$ apulse ffmpeg -f pulse -i default /tmp/pulse.wav
Now run it again (it will ask to overwrite the existing file), and ffmpeg will stall after recording exactly 51,278 bytes of audio. It seems like apulse fails when a recording device is routed via dsnoop and it’s quickly reopened.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 36 (13 by maintainers)
Configured dsnoop device like this, added period_size, period and buffer_size params:
pcm.asnoop { type dsnoop ipc_key 219346 slave { pcm “hw:Loopback,0,1” period_size 256 periods 16 buffer_size 16384 channels 2 } }
Now it works like a charm