Skip to contentSkip to conversation

BlueZ 5 as bluetooth alternative stack

PATCH New Cristian Iorga 1 participant 12 messages Feb 17, 2015

lore
Share & tools
lore
#0 lore raw

v2 cover BlueZ 5 as bluetooth alternative stack

Based on Peter A. Bigot Bluez5 switch patchset.
Full credit given to original authors.
Some changes/adaptations needed, all done and implemented by Cristian Iorga. Tested with each Bluetooth stack provider.
Version 2 brings in an improvement to qt-mobility.

The following changes since commit 6ae933b75c1c34a9d39e1aff0a0cb26a7ce4677f:

bitbake: tests/fetch.py: latest_versionstring add set of PN (2015-02-16 09:13:06 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ciorga/bluez5_switch_t2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ciorga/bluez5_switch_t2

Cristian Iorga (1):
conf/distro/include/default-providers: updated bluez-hcidump providers

Peter A. Bigot (9):
bluetooth.bbclass: simplify recipe inference of bluetooth provider
packagegroup-base: select distro preference for bluez provider
pulseaudio: select distro preference for bluez provider
neard: select distro preference for bluez provider
libpcap: select distro preference for bluez provider
ofono: select distro preference for bluez provider gstreamer1.0-plugins-bad: select distro preference for bluez provider
connman: depend on distro provider of bluez
qt-mobility: select distro preference for bluez provider

Richard Purdie (1):
default-providers: Set the preferred provider for bluez based on
version

 meta/classes/bluetooth.bbclass                             | 14 ++++++++++++++
 meta/conf/distro/include/default-providers.inc             |  4 ++--
 meta/recipes-connectivity/connman/connman.inc              |  8 +++++---
 meta/recipes-connectivity/libpcap/libpcap.inc              |  6 ++++--
 meta/recipes-connectivity/neard/neard.inc                  |  4 ++--
 meta/recipes-connectivity/ofono/ofono.inc                  |  6 +++---
 meta/recipes-core/packagegroups/packagegroup-base.bb       |  3 ++-
 .../gstreamer/gstreamer1.0-plugins-bad.inc                 |  4 ++--
 .../gstreamer/gstreamer1.0-plugins-bad_git.bb              |  1 -
 meta/recipes-multimedia/pulseaudio/pulseaudio.inc          |  4 ++--
 meta/recipes-qt/qt4/qt-mobility_1.2.0.inc                  |  8 +++++---
 11 files changed, 41 insertions(+), 21 deletions(-)
 create mode 100644 meta/classes/bluetooth.bbclass
Signature · 1 line
2.1.0
#2 lore raw

PATCH v2 2/11 packagegroup-base: select distro preference for bluez provider

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-core/packagegroups/packagegroup-base.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/packagegroups/packagegroup-base.bb +2 -1
index f4b2cd5..369b63e 100644
@@ -8,6 +8,7 @@ PR = "r83"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 inherit packagegroup
+inherit bluetooth
 
 PROVIDES = "${PACKAGES}"
 PACKAGES = ' \
@@ -203,7 +204,7 @@ RRECOMMENDS_packagegroup-base-pcmcia = "\
 
 SUMMARY_packagegroup-base-bluetooth = "Bluetooth support"
 RDEPENDS_packagegroup-base-bluetooth = "\
-    bluez4 \
+    ${BLUEZ} \
     ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'libasound-module-bluez', '',d)} \
     "
 
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/11 bluetooth.bbclass: simplify recipe inference of bluetooth provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

Defines ${BLUEZ} to be the provider of bluez services as specified by DISTRO_FEATURES.

Example recipe fragment:
inherit bluetooth
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4" PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5"

[YOCTO #5031]

---
 meta/classes/bluetooth.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 meta/classes/bluetooth.bbclass
meta/classes/bluetooth.bbclass new file +14 -0
new file mode 100644
index 0000000..f88b4ae
@@ -0,0 +1,14 @@
+# Avoid code duplication in bluetooth-dependent recipes.
+
+# Define a variable that expands to the recipe (package) providing core
+# bluetooth support on the platform:
+# "" if bluetooth is not in DISTRO_FEATURES
+# else "bluez5" if bluez5 is in DISTRO_FEATURES
+# else "bluez4"
+
+# Use this with:
+#  inherit bluetooth
+#  PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}
+#  PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4"
+
+BLUEZ ?= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez5', 'bluez4', d), '', d)}"
Signature · 1 line
2.1.0
#3 lore raw

PATCH v2 3/11 pulseaudio: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-multimedia/pulseaudio/pulseaudio.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-multimedia/pulseaudio/pulseaudio.inc +2 -2
index 99cad76..b73576e 100644
@@ -12,7 +12,7 @@ DEPENDS = "libatomics-ops liboil libsamplerate0 libsndfile1 libtool"
 DEPENDS += "udev alsa-lib glib-2.0 dbus gconf"
 DEPENDS += "json-c gdbm speex libxml-parser-perl-native libcap"
 
-inherit autotools pkgconfig useradd gettext perlnative
+inherit autotools pkgconfig useradd gettext perlnative bluetooth
 
 # *.desktop rules wont be generated during configure and build will fail
 # if using --disable-nls
@@ -31,7 +31,7 @@ EXTRA_OECONF = "\
                 ac_cv_header_valgrind_memcheck_h=no \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
Signature · 1 line
2.1.0
#4 lore raw

PATCH v2 4/11 neard: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-connectivity/neard/neard.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-connectivity/neard/neard.inc +2 -2
index 31bc6dd..6b6b1da 100644
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
  file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
  "
 
-inherit autotools pkgconfig systemd update-rc.d
+inherit autotools pkgconfig systemd update-rc.d bluetooth
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
 
@@ -45,7 +45,7 @@ RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
 
 # Bluez & Wifi are not mandatory except for handover
 RRECOMMENDS_${PN} = "\
-                     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \
+                     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
                      ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
                     "
 
Signature · 1 line
2.1.0
#5 lore raw

PATCH v2 5/11 libpcap: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-connectivity/libpcap/libpcap.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-connectivity/libpcap/libpcap.inc +4 -2
index a12eb16..979665c 100644
@@ -10,8 +10,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867 \
                     file://pcap.h;beginline=1;endline=32;md5=39af3510e011f34b8872f120b1dc31d2"
 DEPENDS = "flex-native bison-native"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluetooth', '', d)}"
-PACKAGECONFIG[bluetooth] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+inherit bluetooth
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}"
+PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
 PACKAGECONFIG[canusb] = "--enable-canusb,--enable-canusb=no,libusb"
 PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
 
Signature · 1 line
2.1.0
#6 lore raw

PATCH v2 6/11 ofono: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-connectivity/ofono/ofono.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-connectivity/ofono/ofono.inc +3 -3
index bf44fca..c415a39 100644
@@ -5,7 +5,7 @@ LICENSE  = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
                     file://src/ofono.h;beginline=1;endline=20;md5=3ce17d5978ef3445def265b98899c2ee"
 
-inherit autotools pkgconfig update-rc.d systemd
+inherit autotools pkgconfig update-rc.d systemd bluetooth
 
 DEPENDS  = "dbus glib-2.0 udev mobile-broadband-provider-info"
 
@@ -14,10 +14,10 @@ INITSCRIPT_PARAMS = "defaults 22"
 
 PACKAGECONFIG ??= "\
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth','bluetooth', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
     "
 PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
-PACKAGECONFIG[bluetooth] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}"
 
 EXTRA_OECONF += "--enable-test"
 
Signature · 1 line
2.1.0
#7 lore raw

PATCH v2 7/11 gstreamer1.0-plugins-bad: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc    | 4 ++--
 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc +2 -2
index 9c15f2b..69a15a2 100644
@@ -9,7 +9,7 @@ S = "${WORKDIR}/gst-plugins-bad-${PV}"
 SRC_URI += "file://configure-allow-to-disable-libssh2.patch \
            "
 
-inherit gettext
+inherit gettext bluetooth
 
 # opengl packageconfig factored out to make it easy for distros
 # and BSP layers to pick either (desktop) opengl, gles2, or no GL
@@ -49,7 +49,7 @@ PACKAGECONFIG[bz2]             = "--enable-bz2,--disable-bz2,bzip2"
 PACKAGECONFIG[fluidsynth]      = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
 PACKAGECONFIG[schroedinger]    = "--enable-schro,--disable-schro,schroedinger"
 PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2"
-PACKAGECONFIG[bluez]           = "--enable-bluez,--disable-bluez,bluez4"
+PACKAGECONFIG[bluez]          = "--enable-bluez,--disable-bluez,${BLUEZ}"
 PACKAGECONFIG[rsvg]            = "--enable-rsvg,--disable-rsvg,librsvg"
 PACKAGECONFIG[sndfile]         = "--enable-sndfile,--disable-sndfile,libsndfile1"
 PACKAGECONFIG[webp]            = "--enable-webp,--disable-webp,libwebp"
meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb +0 -1
index 75859f9..309505f 100644
@@ -11,7 +11,6 @@ S = "${WORKDIR}/git"
 
 SRCREV = "6e5db57d2446a753aaa76bee268e1f95600b14ce"
 
-PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,bluez4"
 PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc"
 PACKAGECONFIG[hls] = "--enable-hls,--disable-hls,gnutls"
 
Signature · 1 line
2.1.0
#8 lore raw

PATCH v2 8/11 conf/distro/include/default-providers: updated bluez-hcidump providers

In reply to Cristian Iorga

If BlueZ5 is added to a build as a replacement for BlueZ4, the provider for bluez-hcidump will be bluez5.

---
 meta/conf/distro/include/default-providers.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/distro/include/default-providers.inc +1 -1
index 4dc42a7..25118fa 100644
@@ -44,7 +44,7 @@ PREFERRED_PROVIDER_udev ?= "${@bb.utils.contains('DISTRO_FEATURES','systemd','sy
 # There are issues with runtime packages and PREFERRED_PROVIDER, see YOCTO #5044 for details
 # on this rather strange entry.
 PREFERRED_PROVIDER_bluez4 ?= "bluez4"
-PREFERRED_PROVIDER_bluez-hcidump ?= "bluez-hcidump"
+PREFERRED_PROVIDER_bluez-hcidump ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez-hcidump',d)}"
 # Alternative is ltp-ddt in meta-oe: meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.4.bb
 PREFERRED_PROVIDER_ltp ?= "ltp"
 PREFERRED_PROVIDER_getopt ?= "util-linux-getopt"
Signature · 1 line
2.1.0
#9 lore raw

PATCH v2 9/11 connman: depend on distro provider of bluez

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

connman currently supports both bluez4 and bluez5 without distinguishing them at configuration time.

---
 meta/recipes-connectivity/connman/connman.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-connectivity/connman/connman.inc +5 -3
index 736b324..1062641 100644
@@ -13,6 +13,8 @@ LICENSE  = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
                     file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
 
+inherit bluetooth
+
 DEPENDS  = "dbus glib-2.0 ppp iptables"
 
 INC_PR = "r20"
@@ -32,7 +34,7 @@ EXTRA_OECONF += "\
 PACKAGECONFIG ??= "wispr \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth','bluetooth', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)} \
 "
 
@@ -42,7 +44,7 @@ PACKAGECONFIG ??= "wispr \
 
 PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
 PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant"
-PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez4"
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}"
 PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono"
 PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
 PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
@@ -114,7 +116,7 @@ RPROVIDES_${PN} = "\
 
 RDEPENDS_${PN} = "\
 	dbus \
-	${@bb.utils.contains('PACKAGECONFIG', 'bluetooth', 'bluez4', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', 'bluetooth', '${BLUEZ}', '', d)} \
 	${@bb.utils.contains('PACKAGECONFIG', 'wifi','wpa-supplicant', '', d)} \
 	${@bb.utils.contains('PACKAGECONFIG', '3g','ofono', '', d)} \
 	xuser-account \
Signature · 1 line
2.1.0
#10 lore raw

PATCH v2 10/11 default-providers: Set the preferred provider for bluez based on version

In reply to Cristian Iorga

From: Richard Purdie <[email protected]>

bitbake will currently 'selecting bluez4 to satisfy runtime libasound-module-bluez due to PREFERRED_PROVIDER_bluez4 = bluez4' which in the case of bluez5 isn't correct.
This slightly unusual construct avoids this.
Ultimately this is a bitbake issue that needs fixing in a better way but this means we can merge the bluez5 changes until bitbake gets fixed.

---
 meta/conf/distro/include/default-providers.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/distro/include/default-providers.inc +1 -1
index 25118fa..8d92c2e 100644
@@ -43,7 +43,7 @@ PREFERRED_PROVIDER_make ?= "make"
 PREFERRED_PROVIDER_udev ?= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','udev',d)}"
 # There are issues with runtime packages and PREFERRED_PROVIDER, see YOCTO #5044 for details
 # on this rather strange entry.
-PREFERRED_PROVIDER_bluez4 ?= "bluez4"
+PREFERRED_PROVIDER_bluez4 ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez4',d)}"
 PREFERRED_PROVIDER_bluez-hcidump ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez-hcidump',d)}"
 # Alternative is ltp-ddt in meta-oe: meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.4.bb
 PREFERRED_PROVIDER_ltp ?= "ltp"
Signature · 1 line
2.1.0
#11 lore raw

PATCH v2 11/11 qt-mobility: select distro preference for bluez provider

In reply to Cristian Iorga

From: "Peter A. Bigot" <[email protected]>

---
 meta/recipes-qt/qt4/qt-mobility_1.2.0.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-qt/qt4/qt-mobility_1.2.0.inc +5 -3
index ae1769d..5758e1e 100644
@@ -1,9 +1,11 @@
 HOMEPAGE = "http://qt-project.org/"
 DEPENDS = "gstreamer util-linux"
 
+inherit bluetooth
+
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluetooth', '', d)}"
-PACKAGECONFIG[bluetooth] = ",,bluez4"
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}"
+PACKAGECONFIG[bluez4] = ",,bluez4"
 PACKAGECONFIG[pulseaudio] = ",,pulseaudio"
 
 LICENSE = "LGPLv2.1"
@@ -65,7 +67,7 @@ maemo5-contacts_enabled = no
 maemo5-calendar_enabled = no
 maemo6-landmarks_enabled = no
 bme_enabled = no
-bluez_enabled = ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth', 'yes', 'no', d)}
+bluez_enabled = ${@bb.utils.contains('PACKAGECONFIG', 'bluez4', 'yes', 'no', d)}
 proj_enabled = no
 gstreamer-photography_enabled = no
 gstreamer-appsrc_enabled = yes
Signature · 1 line
2.1.0