Skip to contentSkip to conversation

list all available devices

DISCUSSION Timo Steuerwald 4 participants 8 messages Feb 6, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

can someone point me to the right location where I can find information about listing all available devices in ALSA? A code sample will be also very nice :-)

Cheers,

Timo

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#1 lore raw
Quoted 5 lines · Timo Steuerwald

Hi all,

can someone point me to the right location where I can find information about listing all available devices in ALSA?
A code sample will be also very nice :-)

aplay -l
arecord -l

--
Giuliano.

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#2 lore raw
Quoted 4 lines · Giuliano Pochini

aplay -l
arecord -l

Hi Giuliano,

thanks a lot! That's what I was searching for! :-)

Cheers,

Timo

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#3 lore raw
In reply to Giuliano Pochini
Quoted 11 lines · Giuliano Pochini
Quoted 5 lines · Timo Steuerwald

Hi all,

can someone point me to the right location where I can find information about listing all available devices in ALSA?
A code sample will be also very nice :-)

aplay -l
arecord -l

Are you sure that's good enough? It does not list the PCMs in a format useful to the application (like "default", hw:0", "surround51", "dmix" etc). AFAICT "aplay -l" doesn't give an application enough information to populate a drop-down list.

This is a problem already for apps like "wengophone" - ALSA does not provide a sane API for enumerating all usable PCMs so it only lists "hw:x" PCMS and whatever is directly defined in .asoundrc (but NOT the PCMs defined under /usr/share/alsa/* - probably it parses .asoundrc directly, ugh)

Lee

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#4 lore raw
Quoted 7 lines · Lee Revell

Are you sure that's good enough? It does not list the PCMs in a format useful to the application (like "default", hw:0", "surround51", "dmix" etc). AFAICT "aplay -l" doesn't give an application enough information to populate a drop-down list.

Hmmh, I haven't already taken a look at the code, but I thought this can be extended easily...

Quoted 8 lines

This is a problem already for apps like "wengophone" - ALSA does not provide a sane API for enumerating all usable PCMs so it only lists "hw:x" PCMS and whatever is directly defined in .asoundrc (but NOT the PCMs defined under /usr/share/alsa/* - probably it parses .asoundrc directly, ugh)

Uh, not very good :-/

Cheers,

Timo

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#5 lore raw
Quoted 4 lines · Timo Steuerwald

Hmmh, I haven't already taken a look at the code, but I thought this can
be extended easily...

It's insane to expect every app to use 100 lines of code list to list available PCMs. It should be a single function call.

Lee

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#6 lore raw

Hi,

Quoted 2 lines · Lee Revell

It's insane to expect every app to use 100 lines of code list to list available PCMs. It should be a single function call.

Hmm, doesn't this exist already? What about this:

int snd_names_list(const char *iface, snd_devname_t **list) Give a list of device names and associated comments for selected interface.

Regards,
Matthias

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

#7 lore raw
Quoted 4 lines · Matthias König

Hi,

Lee Revell <[email protected]> writes:

Quoted 8 lines
Quoted 2 lines

It's insane to expect every app to use 100 lines of code list to list available PCMs. It should be a single function call.

Hmm, doesn't this exist already? What about this:

int snd_names_list(const char *iface, snd_devname_t **list) Give a list of device names and associated comments for selected interface.

No, that's something different (and does not even work here):

$ aplay -n
ALSA lib names.c:173:(snd_names_list) cannot access
file /etc/asound.names
aplay: names_list:199: snd_names_list error: No such file or directory

Lee

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642