Switching between USB earphone and regular earphone

Tim Müller tim at centricular.com
Thu May 29 08:47:45 PDT 2014


On Thu, 2014-05-29 at 15:46 +0800, hustxyj wrote:

Hi,

> I am dealing with a problem with USB earphone device. On my PC, I had
> two devices: A USB earphone and a regular earphone. The USB earphone
> worked. When I plugged out the USB earphone, the sound should switch
> to the regular earphone. So I called the function before restarting a
> new pipe:
> 
> gst_element_set_state (p->playback.pipe, GST_STATE_NULL);
> 
> gst_object_unref (GST_OBJECT(p->playback.pipe));
> 
> However, the gst_element_set_state function blocked.
> 
> Now I am so confused and need your help.

Try and figure out where it gets stuck. You can do that for example by
connecting gdb to your application process:

 gdb -p $PID

and then do: (gdb) thread apply all bt

to see what they various threads are doing / waiting for.

You could also just use the pulseaudio sound server, and pulsesink in
your GStreamer application, then that should all be handled
transparently to the application. 

Cheers
 -Tim


-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list