alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: how to enumerate useful ALSA devices?
@ 2012-01-04 19:49 Andrew Eikum
  2012-01-04 20:47 ` Anssi Hannula
  2012-01-05  9:59 ` Joerg-Cyril.Hoehle
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew Eikum @ 2012-01-04 19:49 UTC (permalink / raw)
  To: alsa-devel; +Cc: Joerg-Cyril.Hoehle

> The 2008 audio guide recommends
> http://0pointer.de/blog/projects/guide-to-sound-apis.html
> "Do not use the snd_card_xxx() APIs. For enumerating use
>  snd_device_name_hint() (and related functions).
>  snd_card_xxx() is obsolete... Bluetooth audio are not included"
> 
> Is that correct advice?
> 
> Wine still uses snd_card, so it knows only about "default" and
> "plughw:x,y".  I believe that's wrong but don't know what should be
> used instead in order not to come up with a long list of artificial
> names mentioned in /usr/share/alsa/alsa.conf such as surround51 when
> the poor on-board card knows nothing but 16 bit stereo.
> 
> I'm looking for a list of working devices on this machine, which likely
> should contain "default" (usually leading to PA on a recent Ubuntu machine),
> "plug:dmix" (PA getting out of the way when trying to use other devices),
> "hw:0,0" and presumably not much more.

Bump, still hoping for an answer to this.

I tried experimenting with snd_device_name_hint(). It gave me what
looked like a promising list, consisting of:

null
front:CARD=SB,DEV=0
surround40:CARD=SB,DEV=0
surround41:CARD=SB,DEV=0
surround50:CARD=SB,DEV=0
surround51:CARD=SB,DEV=0
surround71:CARD=SB,DEV=0
iec958:CARD=SB,DEV=0

This is identical to the list from "aplay -L".

But, passing these to aplay fails if I have PulseAudio running
("device in use"). If I kill PA, then they don't fail, but give
warnings about rate conversion and suggest the plug plugin. So I stick
"plug:" in front of the device name, and they fail again ("unknown
parameter front:CARD"). Clearly I'm doing something very wrong. But I
don't know what!

Then it occurred to me that this list also contains neither "default"
nor the "pulse" device in my asound.conf[1]. Both of these work when
passed to aplay.

Looking to other projects for help, I find that VLC uses the snd_card_
functions, just like Wine currently does. Of course, that fails to
find the "pulse" device from asound.conf. And mplayer's libao2 uses a
couple of hard-coded device names, which is even worse (right?).

So I'm really stuck here. Where am I supposed to get a list of devices
that I can present to the user, including their Bluetooth devices and
virtual devices from asound.conf?

[1] asound.conf from Arch Linux pulseaudio-alsa package:
http://projects.archlinux.org/svntogit/packages.git/tree/trunk/asound.conf?h=packages/pulseaudio-alsa

Andrew

^ permalink raw reply	[flat|nested] 13+ messages in thread
* how to enumerate useful ALSA devices?
@ 2011-12-21 14:37 Joerg-Cyril.Hoehle
  2011-12-22  6:27 ` Raymond Yau
  0 siblings, 1 reply; 13+ messages in thread
From: Joerg-Cyril.Hoehle @ 2011-12-21 14:37 UTC (permalink / raw)
  To: alsa-devel

Hi,

The 2008 audio guide recommends
http://0pointer.de/blog/projects/guide-to-sound-apis.html
"Do not use the snd_card_xxx() APIs. For enumerating use
 snd_device_name_hint() (and related functions).
 snd_card_xxx() is obsolete... Bluetooth audio are not included"

Is that correct advice?

Wine still uses snd_card, so it knows only about "default" and
"plughw:x,y".  I believe that's wrong but don't know what should be
used instead in order not to come up with a long list of artificial
names mentioned in /usr/share/alsa/alsa.conf such as surround51 when
the poor on-board card knows nothing but 16 bit stereo.

I'm looking for a list of working devices on this machine, which likely
should contain "default" (usually leading to PA on a recent Ubuntu machine),
"plug:dmix" (PA getting out of the way when trying to use other devices),
"hw:0,0" and presumably not much more.

Thank you for your help,
	Jörg Höhle
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2012-03-11  3:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 19:49 how to enumerate useful ALSA devices? Andrew Eikum
2012-01-04 20:47 ` Anssi Hannula
2012-01-04 21:04   ` Andrew Eikum
2012-01-04 21:16   ` Anssi Hannula
2012-01-05 23:06     ` Raymond Yau
2012-01-06  0:36       ` Anssi Hannula
2012-03-11  3:01         ` Raymond Yau
2012-01-05  5:35   ` Raymond Yau
2012-01-05  9:59 ` Joerg-Cyril.Hoehle
2012-01-05 13:30   ` Raymond Yau
2012-01-05 17:26   ` Anssi Hannula
  -- strict thread matches above, loose matches on Subject: below --
2011-12-21 14:37 Joerg-Cyril.Hoehle
2011-12-22  6:27 ` Raymond Yau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).