How to handle disconnecting the headphones?

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

How to handle disconnecting the headphones?

Ralph
This post was updated on .
I'm writing a C# WPF application using GStreamer 0.10.35 (OSSBuild-vs2010 2012.06.15 with .NET4 C# bindings).

I'm using gnonlin and my pipeline contains two chains: one for audio and the other for video.
On my machine when I disconnect the headphones while playing the pipeline, the playback pauses for a second and continues playing.  On another machine with a different sound card disconnecting the headphones causes the application to freeze.  Some *idiot* wrote sound card drivers in such a way that the audio device becomes disabled when the headphones are disconnected.

When looking at GStreamer logs I can see the following warnings:

0:00:22.761000000  7120   0B3C2EF8 WARN            waveformsink gstwaveformsink.c:507:gst_waveform_sink_write:<autoaudiosink1-actual-sink-waveform> gst_waveform_sink_write: Error preparing header => There is no driver installed on your system.

0:00:22.761000000  7120   0B3C2EF8 WARN            waveformsink gstwaveformsink.c:514:gst_waveform_sink_write:<autoaudiosink1-actual-sink-waveform> gst_waveform_sink_write: Error writting buffer to the device => The wave header was not prepared.  Use the Prepare function to prepare the header, and then try again.

What can I do in such situations?  How to make the pipeline continue playback even if the headphones are disconnected?
Reply | Threaded
Open this post in threaded view
|

Re: How to handle disconnecting the headphones?

Ralph
Does anyone have any idea how to solve this problem?

Ralph wrote
I'm writing a C# WPF application using GStreamer 0.10.35 (OSSBuild-vs2010 2012.06.15 with .NET4 C# bindings).

I'm using gnonlin and my pipeline contains two chains: one for audio and the other for video.
On my machine when I disconnect the headphones while playing the pipeline, the playback pauses for a second and continues playing.  On another machine with a different sound card disconnecting the headphones causes the application to freeze.  Some *idiot* wrote sound card drivers in such a way that the audio device becomes disabled when the headphones are disconnected.

When looking at GStreamer logs I can see the following warnings:

0:00:22.761000000  7120   0B3C2EF8 WARN            waveformsink gstwaveformsink.c:507:gst_waveform_sink_write:<autoaudiosink1-actual-sink-waveform> gst_waveform_sink_write: Error preparing header => There is no driver installed on your system.

0:00:22.761000000  7120   0B3C2EF8 WARN            waveformsink gstwaveformsink.c:514:gst_waveform_sink_write:<autoaudiosink1-actual-sink-waveform> gst_waveform_sink_write: Error writting buffer to the device => The wave header was not prepared.  Use the Prepare function to prepare the header, and then try again.

What can I do in such situations?  How to make the pipeline continue playback even if the headphones are disconnected?