Getting names and description of the "Source" devices.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting names and description of the "Source" devices.

Osmo Maatta
Hello,

I am writing a small sound-recording application/applet in C. It will do approx. the same task as this command line.
$ gst-launch-0.10 pulsesrc device="xxxx" ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=test.oga

My platform is GNOME on Ubuntu-Linux 10.04.

In my GTK app, I would like to fill a listbox with names and description of the "Source" devices; such as
"Audio card X"
"Micro phone 1"
so the user can select the source of the recording. See the devive= parameter in the above command line.

How can I find the device names + description using c and GStreamer libraries?

I have poked the "gstreamer-properties" application and it finds the device names like

PulseAudio Audio Source (pulsesrc):
Device name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor 
Description: Unknown

PulseAudio Audio Source (pulsesrc):
Device name: device alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono
Description: Unknown

The device name is ok, but the human readable description is empty/"Unknown".

See this picture:
http://www.futuredesktop.com/tmp/audio-recorder/picture1.png
The device description for Source #0 and #1 are set to "Unknown".

However the "pactl list" command shows the description right.
http://www.futuredesktop.com/tmp/audio-recorder/picture2.png
Source #0
 State: RUNNING
 Name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor  <-- I WANT THIS
 Description: Monitor of SB0400 Audigy2 Value Analog Stereo <--- AND THIS

Source #1
 State: SUSPENDED
 Name: alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono <- I WANT THIS
 Description: QuickCam E2500 series Analog Mono <--- AND THIS

Test code:
http://www.futuredesktop.com/tmp/audio-recorder/t1.c

Kindly
  Gstreamer newbie.
  Moma Antero M (osmo)
  www.futuredesktop.org (com)



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting names and description of the "Source" devices.

Osmo Maatta
Re-hello,

This piece of PulseAudio code seems to list the input/output devices; their names and human readable _descriptions_.
http://pulseaudio.org/wiki/SampleAsyncDeviceList

Should GStreamer be able to do the same?


On 07/19/2010 09:25 AM, Osmo Maatta wrote:
Hello,

I am writing a small sound-recording application/applet in C. It will do approx. the same task as this command line.
$ gst-launch-0.10 pulsesrc device="xxxx" ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=test.oga

My platform is GNOME on Ubuntu-Linux 10.04.

In my GTK app, I would like to fill a listbox with names and description of the "Source" devices; such as
"Audio card X"
"Micro phone 1"
so the user can select the source of the recording. See the devive= parameter in the above command line.

How can I find the device names + description using c and GStreamer libraries?

I have poked the "gstreamer-properties" application and it finds the device names like

PulseAudio Audio Source (pulsesrc):
Device name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor 
Description: Unknown

PulseAudio Audio Source (pulsesrc):
Device name: device alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono
Description: Unknown

The device name is ok, but the human readable description is empty/"Unknown".

See this picture:
http://www.futuredesktop.com/tmp/audio-recorder/picture1.png
The device description for Source #0 and #1 are set to "Unknown".

However the "pactl list" command shows the description right.
http://www.futuredesktop.com/tmp/audio-recorder/picture2.png
Source #0
 State: RUNNING
 Name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor  <-- I WANT THIS
 Description: Monitor of SB0400 Audigy2 Value Analog Stereo <--- AND THIS

Source #1
 State: SUSPENDED
 Name: alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono <- I WANT THIS
 Description: QuickCam E2500 series Analog Mono <--- AND THIS

Test code:
http://www.futuredesktop.com/tmp/audio-recorder/t1.c

Kindly
  Gstreamer newbie.
  Moma Antero M (osmo)
  www.futuredesktop.org (com)




------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting names and description of the "Source" devices.

Agostino De Matteis
In reply to this post by Osmo Maatta
Osmo Maatta wrote:

> The device name is ok, but the human readable description is
> empty/"Unknown".
>

First you set the device:

g_object_set (G_OBJECT (element), "device", device, NULL);

and after that you can read the device-name:

g_object_get(G_OBJECT(element), "device-name", &devicename, NULL);


Agostino

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting names and description of the "Source" devices.

Stefan Sauer
In reply to this post by Osmo Maatta
Am 19.07.2010 10:25, schrieb Osmo Maatta:

> Hello,
>
> I am writing a small sound-recording application/applet in C. It will do
> approx. the same task as this command line.
> $ gst-launch-0.10 pulsesrc device="xxxx" ! queue ! audioconvert !
> vorbisenc ! oggmux ! filesink location=test.oga
>
> My platform is GNOME on Ubuntu-Linux 10.04.
>
> In my GTK app, I would like to fill a listbox with names and description
> of the "Source" devices; such as
> "Audio card X"
> "Micro phone 1"
> so the user can select the source of the recording. See the devive=
> parameter in the above command line.
>
> How can I find the device names + description using c and GStreamer
> libraries?

You can use the GstPropertyProbe interface on the audiosrc element.
>
> I have poked the "gstreamer-properties" application and it finds the
> device names like

This is available audiosource element and that is retieved from the registry.

Stefan

>
> PulseAudio Audio Source (pulsesrc):
> Device name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor
> Description: Unknown
>
> PulseAudio Audio Source (pulsesrc):
> Device name: device alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono
> Description: Unknown
>
> The device name is ok, but the human readable description is
> empty/"Unknown".
>
> See this picture:
> http://www.futuredesktop.com/tmp/audio-recorder/picture1.png
> The device description for Source #0 and #1 are set to "Unknown".
>
> However the "pactl list" command shows the description right.
> http://www.futuredesktop.com/tmp/audio-recorder/picture2.png
> Source #0
>  State: RUNNING
>  Name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor  <-- I WANT THIS
>  Description: Monitor of SB0400 Audigy2 Value Analog Stereo <--- AND THIS
>
> Source #1
>  State: SUSPENDED
>  Name: alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono <- I WANT THIS
>  Description: QuickCam E2500 series Analog Mono <--- AND THIS
>
> Test code:
> http://www.futuredesktop.com/tmp/audio-recorder/t1.c
> <http://www.futuredesktop.com/tmp/audio-recorder/>
> Kindly
>   Gstreamer newbie.
>   Moma Antero M (osmo)
>   www.futuredesktop.org (com)
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel