All of lore.kernel.org
 help / color / mirror / Atom feed
* alsa-lib functions reporting conflicting information with two sound cards
@ 2007-04-19 14:30 nick smethurst
  2007-04-19 15:46 ` Lee Revell
  0 siblings, 1 reply; 17+ messages in thread
From: nick smethurst @ 2007-04-19 14:30 UTC (permalink / raw)
  To: alsa-devel

Hey guys

I am rather confused that I am getting crossed information when
calling snd_names_list
and snd_pcm_info in order to gather information about pcm devices.

I have two sound cards in my development pc: RME Digi 96/8 PCI and an
onboard VIA 8237.

I'm trying to develop a piece of code that generates a list of objects
containing pcm device information, including information on virtual
devices.

My current idea is to use snd_names_list() to get a full list of
devices, and then get information about them by opening each device
and querying.

The bizzare thing is that snd_names_list() is returning comments that
do not agree with the associated device.

For example, given the following code:

#include <alsa/asoundlib.h>
int main()
{
    snd_devname_t * list;
    snd_config_update();

    snd_names_list("pcm", &list);
    while (list) {
        if (!strcmp(list->name, "hw:0,0")) {
            printf("hw:0,0 comment: %s\n", list->comment);
            break;
        }
        list = list->next;
    }
    snd_names_list_free(list);

    snd_pcm_t * pcm;
    snd_pcm_info_t * pcm_info;
    snd_pcm_info_malloc(&pcm_info);
    snd_pcm_open(&pcm, "hw:0,0", SND_PCM_STREAM_PLAYBACK, 0);
    snd_pcm_info(pcm, pcm_info);
    printf("id: %s\n", snd_pcm_info_get_id(pcm_info));
    snd_pcm_close(pcm);
    snd_pcm_info_free(pcm_info);

    return 0;
}

The result on my pc is:
    hw:0,0 comment: Physical Device - VIA 8237 (Duplex)
    id: Digi96 IEC958

So I'm apparently doing something very wrong here.

I would like to ask if there is an easier and more reliable way of
getting a list of pcm devices and querying them, and if not, what I am
doing wrong here?

Regards

Nicholas

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-05-14 12:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19 14:30 alsa-lib functions reporting conflicting information with two sound cards nick smethurst
2007-04-19 15:46 ` Lee Revell
2007-04-19 18:08   ` Nicholas Smethurst
2007-04-19 18:45     ` Lee Revell
2007-05-11 10:28       ` Getting a full device list (was: alsa-lib functions reporting conflicting information with two sound cards) Nicholas Smethurst
2007-05-11 10:35         ` Jaroslav Kysela
2007-05-11 11:05           ` Getting a full device list Nicholas Smethurst
2007-05-11 11:46             ` Jaroslav Kysela
2007-05-11 15:13             ` Takashi Iwai
2007-05-11 17:01               ` Nicholas Smethurst
2007-05-14  8:36               ` Nicholas Smethurst
2007-05-14  9:18                 ` Takashi Iwai
2007-05-14  9:27                   ` Nicholas Smethurst
2007-05-14  9:57                     ` Takashi Iwai
2007-05-14 10:38                       ` Nicholas Smethurst
2007-05-14 12:55                         ` Takashi Iwai
2007-04-20 10:13     ` alsa-lib functions reporting conflicting information with two sound cards Takashi Iwai

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.