How to link sound-device names to the sound-driver?

Sean McNamara smcnam at gmail.com
Sat Jun 2 15:44:36 PDT 2012


On Sat, Jun 2, 2012 at 2:16 AM, Ajay Garg <ajaygargnsit at gmail.com> wrote:

> Hi all.
>
> I have actually two questions ::
>
> a)
> How can one get the know the sound-device name used by a particular
> sound-driver?
>
> For eg., there are multiple entries in "/dev/snd" "virtual" filesystem on
> my machine; however, I am not sure as to which device-file is used by which
> driver?
>
> I guess, there would be a way to do this via gstreamer-api; however, I am
> not sure. Doing it via a shell-script would be awesome
>
>
>
> b)
> Secondly, (more importantly), how can one "programmatically" find out as
> to which sound-device is functional?
>
> I will take an example here ::
>
> When I try "gst-launch filesrc location=/path/to/mp3 ! mad ! pulsesink", I
> am able to play the mp3 fine on one machine, but not on another, *even
> though doing "pulseaudio --check" on both machines, gives "0" as the exit
> status.*
>
>
>
>
> So, in summary, I would like to know as to which all sound-device(s)
> is(are) functional, and then accordingly use the *corresponding*sound-driver(s) in my application.
>

If you're writing an application, the most you can do is either use the
default sink, or allow the user to select a device from a dropdown list.
Don't try to be "smart" and choose what you think is a working device for
the user. 99% of the time you'll be wrong.

Also, /dev/snd/* devices are from ALSA, and have nothing to do with
pulseaudio. Don't correlate one with the other; it can't be done. If you're
supporting PulseAudio API, don't look at /dev/snd.

As a matter of fact, don't look at /dev/snd at all. Just ignore it like it
isn't there. Just read this and understand it:
http://0pointer.de/blog/projects/guide-to-sound-apis.html



>
>
>
> Will be grateful for a reply.
>
>
>
> Thanks and Regards,
> Ajay
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120602/dc6488ff/attachment.htm>


More information about the gstreamer-devel mailing list