Skip to contentSkip to conversation

Use of default device with snd_pcm_link()

DISCUSSION Devin Heitmueller 2 participants 2 messages Dec 28, 2009

lore
Share & tools
lore
#0 lore raw

I am working on some code which captures from one PCM device and plays to another, based off of the latency.c found in alsa-lib. I noticed something strange:

The code works if I set the capture device to hw:1,0 and playback device to hw:0,0. However, if I change the playback device to "default:0", the snd_pcm_link() call fails with -ENOSYS (error 38).

If I dump out the properties, I can see that the the default device *is* mapped to device 0,0, so it's not clear why the behaviour would differ.

My goal was just to playback to whatever the default device is, and I was under the impression that default:0 should be equivalent to "hw:0,0". Can anyone offer any brief explanation as to why the snd_pcm_link() call would fail?

Thanks in advance,

Devin

Signature · 2 lines
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
#1 lore raw
Quoted 8 lines · Devin Heitmueller

I am working on some code which captures from one PCM device and plays to another, based off of the latency.c found in alsa-lib. I noticed something strange:

The code works if I set the capture device to hw:1,0 and playback device to hw:0,0. However, if I change the playback device to "default:0", the snd_pcm_link() call fails with -ENOSYS (error 38).

Quoted 8 lines

If I dump out the properties, I can see that the the default device *is* mapped to device 0,0, so it's not clear why the behaviour would differ.

My goal was just to playback to whatever the default device is, and I was under the impression that default:0 should be equivalent to "hw:0,0". Can anyone offer any brief explanation as to why the snd_pcm_link() call would fail?

Some alsa-lib plugins do not have the link feature implemented. If you use snd_pcm_dump(), you may list all plugins in chain. I think that dmix is in path. And no, "default:0" is NOT equivalent to "hw:0,0".

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.