GNOME Bugzilla – Bug 434260
PulseAudio plugin takes long to determine whether PulseAudio server is running.
Last modified: 2007-04-29 04:32:34 UTC
Whenever I launch a GStreamer-based application and the Audio output settings are set to Autodetect, GStreamer first tries to see if pulseaudiosink is a good output and it takes around ten seconds to figure out that the PulseAudio server is not running to then fall into a plugin that works. Setting the output plugin to ALSA for example, works instantly. The PulseAudio plugin has a Rank of 256 while alsasink has 253, so the first is chosen probed first.
Here's the output when GST_DEBUG is set to autodetect:5,pulse:5 1. Setting pipeline to PAUSED ... 2. 0:00:02.573913000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:268:gst_auto_audio_sink_detect:<audiosink> Creating new kid 3. 0:00:02.574640000 13188 0x804e050 LOG autodetect gstautoaudiosink.c:195:gst_auto_audio_sink_find_best:<audiosink> Trying to find usable audio devices ... 4. 0:00:02.875399000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:204:gst_auto_audio_sink_find_best:<audiosink> Testing pulsesink 5. 0:00:13.111420000 13188 0x804e050 WARN pulse pulsesink.c:326:gst_pulsesink_open:<audiosink-actual-sink-pulse> error: Failed to connect: Connection refused 6. 0:00:13.111673000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:217:gst_auto_audio_sink_find_best:<audiosink> error message error message from element 'audiosink-actual-sink-pulse': GstMessageError, gerror=(GstGError)(NULL), debug=(string)"pulsesink.c\(326\):\ gst_pulsesink_open\ \(\):\ /audiosink-actual-sink-pulse" 7. 0:00:13.328954000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:204:gst_auto_audio_sink_find_best:<audiosink> Testing jackaudiosink 8. 0:00:13.329919000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:217:gst_auto_audio_sink_find_best:<audiosink> error message error message from element 'audiosink-actual-sink-jackaudio': GstMessageError, gerror=(GstGError)(NULL), debug=(string)"gstjackaudiosink.c\(363\):\ gst_jack_ring_buffer_open_device\ \(\):\ /audiosink-actual-sink-jackaudio:\012Cannot\ connect\ to\ the\ Jack\ server\ \(status\ 17\)" 9. 0:00:13.498492000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:204:gst_auto_audio_sink_find_best:<audiosink> Testing alsadmixsink 10. 0:00:13.702348000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:209:gst_auto_audio_sink_find_best:<audiosink> This worked! 11. 0:00:13.702579000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:229:gst_auto_audio_sink_find_best:<audiosink> done trying 12. 0:00:13.706017000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:278:gst_auto_audio_sink_detect:<audiosink> Re-assigning ghostpad 13. 0:00:13.710489000 13188 0x804e050 DEBUG autodetect gstautoaudiosink.c:282:gst_auto_audio_sink_detect:<audiosink> done changing auto audio sink 14. Pipeline is PREROLLING ... 15. Pipeline is PREROLLED ... 16. Setting pipeline to PLAYING ... 17. New clock: GstAudioSinkClock 18. Caught interrupt -- handling interrupt. 19. Interrupt: Setting pipeline to PAUSED ... 20. Execution ended after 5934853000 ns. 21. Setting pipeline to PAUSED ... 22. Setting pipeline to READY ... 23. Setting pipeline to NULL ... 24. FREEING pipeline ...
Created attachment 87215 [details] Output of strace gst-launch playbin uri="cdda://" 2> ~/Desktop/strace.txt
It stops here: send(7, "<\377\1\0\0\1\0\0\0\0\0\0\tlocalhost\rno-domain"..., 52, MSG_NOSIGNAL) = 52 And does it twice.
It appears that hostname lookups for localhost are timing out. Which probably means that you don't have '127.0.0.1 localhost' in your /etc/hosts. That being said, I don't know why pulseaudiosink would need to look up localhost.
Oh yeah -- pulseaudiosink bugs aren't recorded here, since it's maintained outside the GStreamer project (for now).