GNOME Bugzilla – Bug 329106
HAL sound device wrapper plugins
Last modified: 2006-02-15 12:25:56 UTC
It's currently not possible to specify one specific ALSA device in a pipeline such that the same pipeline is guaranteed to work across machine reboots. The problem is that ALSA card numbers are generated on each system startup. The result depends on the random order of which kernel module gets loaded first. When hotplugging USB audio devices, the card number changes may even happen without machine reboots. I propose to use HAL's UDI (Unique Device Id) as persistent ALSA sound device identifier. A patch to make HAL's UDI independent of ALSA's card number has already been committed to HAL CVS HEAD. Patch will follow soon. This bug is part of my sound configuration patches to allow sane graphical selection of sound cards in GNOME.
Created attachment 58341 [details] [review] Patch to add halaudiosink and halaudiosrc plugins First attempt to create halaudiosink and halaudiosrc plugins.
Looks pretty good to me. For it to go into -good you will need documentation support and example pipelines -- see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-xvimagesink.html for example output, and http://cvs.freedesktop.org/gstreamer/gst-plugins-base/sys/xvimage/xvimagesink.c?view=annotate on how to write the docs. Note that render_from_description and get_unconnected_pad will soon be going into core via bug #329069, please remove them from your patch.
Jurg, we would really like to see this go in, any chance of an update of the patch per Wingo's request?
Created attachment 58953 [details] [review] Add basic documentation, use default alsa device The patch update is almost complete. The only missing part is integrating the plugin documentation with the build system, I hadn't yet time to look where I have to reference it. I've attached my current patch. I'm probably able to look into it on Friday or is this too late for the next release? A pointer which files have to be modified would of course help, too ;) An additional change I've integrated is to use the "default:X" PCM/capture device instead of "plughw:X,Y" if device 0 is requested. This avoids the problem that dmix/dsnoop set-up by alsa-lib get ignored.
Tested the patch today on my FC5 system. I am able to play sound find when sending it to halaudiosink. Getting this message on the console though: 20440: arguments to dbus_message_new_method_call() were incorrect, assertion "path != NULL" failed in file dbus-message.c line 793. This is normally a bug in some application using the D-BUS library. libhal.c 1058 : Couldn't allocate D-BUS message
Created attachment 59273 [details] [review] Complete patch Sorry for the delay. I've attached a first candidate patch including basic documentation hooked up. (In reply to comment #5) > Tested the patch today on my FC5 system. I am able to play sound find when > sending it to halaudiosink. Getting this message on the console though: > > 20440: arguments to dbus_message_new_method_call() were incorrect, assertion > "path != NULL" failed in file dbus-message.c line 793. > This is normally a bug in some application using the D-BUS library. > libhal.c 1058 : Couldn't allocate D-BUS message > I haven't seen this error message before, running hal 0.5.6 and dbus 0.60 here. But it rather looks like a bug in libhal, not in the GStreamer plugins.
* configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-good-plugins-docs.sgml: * docs/plugins/gst-plugins-good-plugins-sections.txt: * docs/plugins/gst-plugins-good-plugins.hierarchy: * ext/Makefile.am: * ext/hal/Makefile.am: * ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init), (gst_hal_audio_sink_class_init), (gst_hal_audio_sink_reset), (gst_hal_audio_sink_init), (gst_hal_audio_sink_dispose), (do_toggle_element), (gst_hal_audio_sink_set_property), (gst_hal_audio_sink_get_property), (gst_hal_audio_sink_change_state): * ext/hal/gsthalaudiosink.h: * ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init), (gst_hal_audio_src_class_init), (gst_hal_audio_src_reset), (gst_hal_audio_src_init), (gst_hal_audio_src_dispose), (do_toggle_element), (gst_hal_audio_src_set_property), (gst_hal_audio_src_get_property), (gst_hal_audio_src_change_state): * ext/hal/gsthalaudiosrc.h: * ext/hal/gsthalelements.c: (plugin_init): * ext/hal/gsthalelements.h: * ext/hal/hal.c: (gst_hal_get_string), (gst_hal_render_bin_from_udi), (gst_hal_get_audio_sink), (gst_hal_get_audio_src): * ext/hal/hal.h: Add HAL sound device wrapper plugins. Closes #329106