On Mon, 2009-11-02 at 15:55 +0100, Takashi Iwai wrote:
Thanks. I guess this depends on the config files. Could you attach your ones?
I can reproduce with only the stock /usr/share/alsa/alsa.conf from Debian installed if I try to use the "null" device after snd_device_name_hint. /usr/share/alsa/alsa.conf is attached.
------
#include <stdio.h> #include <alsa/asoundlib.h>
void try_open (const char * pcm) { snd_pcm_t * handle; int error;
error = snd_pcm_open (& handle, pcm, SND_PCM_STREAM_PLAYBACK, 0);
if (error < 0) printf ("Failed to open %s: %s.\n", pcm, snd_strerror (error)); else { printf ("Opened %s.\n", pcm); snd_pcm_close (handle); } }
int main (void) { void * * hints;
try_open ("default"); try_open ("null"); try_open ("default"); try_open ("null");
printf ("Calling snd_device_name_hint().\n"); snd_device_name_hint (-1, "pcm", & hints); snd_device_name_free_hint (hints);
try_open ("default"); try_open ("null"); try_open ("default"); try_open ("null");
return 0; }
------
$ ./pcmtest Opened default. Opened null. Opened default. Opened null. Calling snd_device_name_hint(). Opened default. ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM null Failed to open null: No such file or directory. Opened default. ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM null Failed to open null: No such file or directory.