From 11b2a36b45c4e7ee1338053d46052fb5dcabf060 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 24 May 2012 17:45:44 +0200 Subject: [PATCH] bluez: add 4 patches from Debian/Ubuntu. --- .../bluez/patches/01_lower_sink_ranking.patch | 19 ++++++ .../03-Fix-return-code-of-hid2hci.patch | 61 +++++++++++++++++++ .../10-unregister_interface_on_exit.patch | 20 ++++++ .../bluez/patches/11-explicitly_close.patch | 17 ++++++ srcpkgs/bluez/template | 2 +- 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/bluez/patches/01_lower_sink_ranking.patch create mode 100644 srcpkgs/bluez/patches/03-Fix-return-code-of-hid2hci.patch create mode 100644 srcpkgs/bluez/patches/10-unregister_interface_on_exit.patch create mode 100644 srcpkgs/bluez/patches/11-explicitly_close.patch diff --git a/srcpkgs/bluez/patches/01_lower_sink_ranking.patch b/srcpkgs/bluez/patches/01_lower_sink_ranking.patch new file mode 100644 index 00000000000..31945c8fbfe --- /dev/null +++ b/srcpkgs/bluez/patches/01_lower_sink_ranking.patch @@ -0,0 +1,19 @@ +Description: a2dpsink should have a rank < GST_RANK_MARGINAL +Author: Sebastian Dröge +Origin: Sebastian Dröge +Updated by Nobuhiro Iwamatsu +Debian BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571595 + +--- audio/gsta2dpsink.c ++++ audio/gsta2dpsink.c +@@ -725,6 +725,6 @@ static void gst_a2dp_sink_init(GstA2dpSink *self, + gboolean gst_a2dp_sink_plugin_init(GstPlugin *plugin) + { + return gst_element_register(plugin, "a2dpsink", +- GST_RANK_MARGINAL, GST_TYPE_A2DP_SINK); ++ GST_RANK_MARGINAL-1, GST_TYPE_A2DP_SINK); + } + +-- +1.7.5.4 + diff --git a/srcpkgs/bluez/patches/03-Fix-return-code-of-hid2hci.patch b/srcpkgs/bluez/patches/03-Fix-return-code-of-hid2hci.patch new file mode 100644 index 00000000000..88931f6549d --- /dev/null +++ b/srcpkgs/bluez/patches/03-Fix-return-code-of-hid2hci.patch @@ -0,0 +1,61 @@ +Description: bluez: getting a "Logitech, Inc. diNovo Edge Keyboard" working +Author: Nobuhiro Iwamatsu +Origin: Nobuhiro Iwamatsu +Debian BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626975 + +--- tools/hid2hci.c ++++ tools/hid2hci.c +@@ -240,7 +240,7 @@ int main(int argc, char *argv[]) + enum mode mode = HCI; + const char *devpath = NULL; + int err = -1; +- int rc = 1; ++ int rc = 0; + + for (;;) { + int option; +@@ -288,13 +288,16 @@ int main(int argc, char *argv[]) + } + + udev = udev_new(); +- if (udev == NULL) ++ if (udev == NULL) { ++ rc = errno; + goto exit; ++ } + + snprintf(syspath, sizeof(syspath), "%s/%s", udev_get_sys_path(udev), devpath); + udev_dev = udev_device_new_from_syspath(udev, syspath); + if (udev_dev == NULL) { + fprintf(stderr, "error: could not find '%s'\n", devpath); ++ rc = errno; + goto exit; + } + +@@ -312,6 +315,7 @@ int main(int argc, char *argv[]) + dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"); + if (dev == NULL) { + fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath); ++ rc = errno; + goto exit; + } + } +@@ -320,6 +324,7 @@ int main(int argc, char *argv[]) + if (handle == NULL) { + fprintf(stderr, "error: unable to handle '%s'\n", + udev_device_get_syspath(dev)); ++ rc = errno; + goto exit; + } + err = usb_switch(handle, mode); +@@ -331,6 +336,7 @@ int main(int argc, char *argv[]) + device = udev_device_get_devnode(udev_dev); + if (device == NULL) { + fprintf(stderr, "error: could not find hiddev device node\n"); ++ rc = errno; + goto exit; + } + err = hid_switch_logitech(device); +-- +1.7.5.4 + diff --git a/srcpkgs/bluez/patches/10-unregister_interface_on_exit.patch b/srcpkgs/bluez/patches/10-unregister_interface_on_exit.patch new file mode 100644 index 00000000000..659f44c5122 --- /dev/null +++ b/srcpkgs/bluez/patches/10-unregister_interface_on_exit.patch @@ -0,0 +1,20 @@ +From: Jesse Sung +Subject: Unregister the SAP dummy interface on exit. + +This fixes error messages when the rfkill switch is toggled: + +bluetoothd[5416]: sap/manager.c:sap_server_probe() path /org/bluez/5416/hci0 +bluetoothd[5416]: sap-dummy interface org.bluez.SimAccessTest init failed on path /org/bluez/test +bluetoothd[5416]: Sap driver initialization failed. +bluetoothd[5416]: sap-server: Operation not permitted (1 + +--- sap/sap-dummy.c 2012-03-16 17:07:43.626644579 +0800 ++++ sap/sap-dummy.c 2012-03-16 17:10:32.774636738 +0800 +@@ -340,6 +340,7 @@ + + void sap_exit(void) + { ++ g_dbus_unregister_interface(connection, SAP_DUMMY_PATH, SAP_DUMMY_IFACE); + dbus_connection_unref(connection); + connection = NULL; + } diff --git a/srcpkgs/bluez/patches/11-explicitly_close.patch b/srcpkgs/bluez/patches/11-explicitly_close.patch new file mode 100644 index 00000000000..3739e471cb7 --- /dev/null +++ b/srcpkgs/bluez/patches/11-explicitly_close.patch @@ -0,0 +1,17 @@ +From: Jesse Sung +Subject: Shutdown the IO channel for the HFP server on exit. + +When the rfkill switch is toggled, the channel is unref'd before being closed, +which lead to issues with the interfaces properly getting brought back up +when the rfkill switch gets back to a non-blocked state. + +--- audio/manager.c 2012-03-21 16:27:23.000000000 +0800 ++++ audio/manager.c 2012-03-21 16:29:52.340242119 +0800 +@@ -990,6 +990,7 @@ + } + + if (adp->hfp_hs_server) { ++ g_io_channel_shutdown(adp->hfp_hs_server, TRUE, NULL); + g_io_channel_unref(adp->hfp_hs_server); + adp->hfp_hs_server = NULL; + } diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template index 69d356ac31a..e73f817c29b 100644 --- a/srcpkgs/bluez/template +++ b/srcpkgs/bluez/template @@ -1,7 +1,7 @@ # Template file for 'bluez' pkgname=bluez version=4.99 -revision=3 +revision=4 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz" build_style=gnu-configure configure_args="--libexecdir=/lib --enable-gstreamer --enable-dund