All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Lindgren <john.lindgren@tds.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa-lib: snd_device_name_hint misbehaving
Date: Mon, 02 Nov 2009 09:43:14 -0500	[thread overview]
Message-ID: <1257172994.2856.2.camel@dark-knight> (raw)
In-Reply-To: <s5hy6mpvzus.wl%tiwai@suse.de>

On Mon, 2009-11-02 at 14:08 +0100, Takashi Iwai wrote:
> > * Remove erroneous snd_config_delete calls that cause later calls to
> > snd_pcm_open to fail.
> 
> This is bad indeed.  Could you make a small test case to reproduce the
> problem more easily?

Sure.

------

#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 ("front");
    try_open ("pulse");
    try_open ("default");
    try_open ("front");
    try_open ("pulse");

    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 ("front");
    try_open ("pulse");
    try_open ("default");
    try_open ("front");
    try_open ("pulse");

    return 0;
}

------

$ ./pcmtest
Opened default.
Opened front.
Opened pulse.
Opened default.
Opened front.
Opened pulse.
Calling snd_device_name_hint().
Opened default.
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
Failed to open front: No such file or directory.
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM pulse
Failed to open pulse: No such file or directory.
Opened default.
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
Failed to open front: No such file or directory.
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM pulse
Failed to open pulse: No such file or directory.

  reply	other threads:[~2009-11-02 14:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  2:23 [PATCH] alsa-lib: snd_device_name_hint misbehaving John Lindgren
2009-11-02  6:21 ` Jaroslav Kysela
2009-11-02 18:12   ` John Lindgren
2009-11-03  7:13     ` Takashi Iwai
2009-11-02  6:49 ` Raymond Yau
2009-11-02 13:08 ` Takashi Iwai
2009-11-02 14:43   ` John Lindgren [this message]
2009-11-02 14:55     ` Takashi Iwai
2009-11-02 17:58       ` John Lindgren
2009-11-03  7:09         ` Takashi Iwai
2009-11-03  8:03           ` Takashi Iwai
2009-11-03 15:28             ` John Lindgren
2009-11-03 15:48               ` Jaroslav Kysela
2009-11-02 18:23 John Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257172994.2856.2.camel@dark-knight \
    --to=john.lindgren@tds.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.