Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RK3566 Bluetooth #102

Merged
merged 14 commits into from
Apr 26, 2024
6 changes: 3 additions & 3 deletions packages/network/bluez/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="bluez"
PKG_VERSION="5.72"
PKG_VERSION="5.75"
PKG_LICENSE="GPL"
PKG_SITE="http://www.bluez.org/"
PKG_URL="https://www.kernel.org/pub/linux/bluetooth/${PKG_NAME}-${PKG_VERSION}.tar.xz"
Expand Down Expand Up @@ -91,6 +91,6 @@ EOF

post_install() {
enable_service bluetooth-defaults.service
#enable_service bluetooth.service
#enable_service obex.service
enable_service bluetooth.service
enable_service obex.service
}
15 changes: 0 additions & 15 deletions packages/network/bluez/patches/bluez-06-AVRCP_TG_MDI_BV-04-C.patch

This file was deleted.

14 changes: 14 additions & 0 deletions packages/network/bluez/patches/bluez-07-trust-sixaxis.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c.new
index 544ab399ad..b68b0f46fb 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c.new
@@ -350,7 +350,8 @@ static bool setup_device(int fd, const char *sysfs_path,

btd_device_device_set_name(device, cp->name);
btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version);
- btd_device_set_temporary(device, true);
+ btd_device_set_temporary(device, false);
+ btd_device_set_trusted(device, true);

closure = g_new0(struct authentication_closure, 1);
if (!closure) {
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,39 @@ Date: 2015-06-15 18:28:26 GMT (36 weeks, 4 days, 21 hours and 32 minutes ago)
Navigation Controller is using PID 0x042f over USB but PID 0x0268
(same as Dualshock 3) over BT.
---
plugins/sixaxis.c | 8 +++++++-
plugins/sixaxis.c | 5 +++++
profiles/input/sixaxis.h | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
2 files changed, 7 insertions(+)

diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 939fed7..f6baea7 100644
index 1653491..6330001 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -364,7 +364,13 @@ static bool setup_device(int fd, const char *sysfs_path,
info("sixaxis: setting up new device");
@@ -350,6 +350,11 @@ static bool setup_device(int fd, const char *sysfs_path,

btd_device_device_set_name(device, cp->name);
- btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version);
+
btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version);
+ /* if device reports different pid/vid on BT prefer those over USB */
+ if (cp->bt_pid)
+ btd_device_set_pnpid(device, cp->source, cp->vid, cp->bt_pid, cp->version);
+ else
+ btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version);
+
btd_device_set_temporary(device, true);
btd_device_set_temporary(device, false);
btd_device_set_trusted(device, true);

closure = g_new0(struct authentication_closure, 1);
diff --git a/profiles/input/sixaxis.h b/profiles/input/sixaxis.h
index 8e6f3cc..321a918 100644
index ab88319..0fe3732 100644
--- a/profiles/input/sixaxis.h
+++ b/profiles/input/sixaxis.h
@@ -38,6 +38,7 @@ struct cable_pairing {
@@ -25,6 +25,7 @@ struct cable_pairing {
uint16_t vid;
uint16_t pid;
uint16_t version;
+ uint16_t bt_pid;
CablePairingType type;
};

@@ -59,6 +60,7 @@ get_pairing(uint16_t vid, uint16_t pid)
@@ -54,6 +55,7 @@ get_pairing(uint16_t vid, uint16_t pid, const char *name)
.vid = 0x054c,
.pid = 0x042f,
.version = 0x0000,
Expand All @@ -54,3 +51,4 @@ index 8e6f3cc..321a918 100644
{
--
2.7.4

40 changes: 0 additions & 40 deletions packages/network/bluez/patches/bluez-12-fix-obexd-after-5_50.patch

This file was deleted.

41 changes: 41 additions & 0 deletions packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/Makefile.obexd b/Makefile.obexd
index b7e9f2d33..9a9e9a0a0 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-if OBEX
-
if SYSTEMD
systemduserunitdir = $(SYSTEMD_USERUNITDIR)
systemduserunit_DATA = obexd/src/obex.service
@@ -41,6 +39,8 @@ obexd_builtin_sources += obexd/plugins/opp.c
obexd_builtin_modules += ftp
obexd_builtin_sources += obexd/plugins/ftp.c obexd/plugins/ftp.h

+if OBEX
+
obexd_builtin_modules += irmc
obexd_builtin_sources += obexd/plugins/irmc.c

@@ -57,6 +57,8 @@ obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \
obexd/plugins/messages.h \
obexd/plugins/messages-dummy.c

+endif
+
obexd_builtin_modules += mns
obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \
obexd/client/map-event.h
@@ -103,11 +105,6 @@ obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \
-D_FILE_OFFSET_BITS=64 \
-I$(builddir)/obexd/src

-else
-obexd-add-service-symlink:
-obexd-remove-service-symlink:
-endif
-
obexd_src_obexd_SHORTNAME = obexd

obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From e679b29bcf4890d61294e4110bace5f783632e5a Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <[email protected]>
Date: Sat, 9 Mar 2024 08:55:24 +0000
Subject: [PATCH] Revert "build: Fix distcheck"

This reverts commit d5a9195a6269e703c6e3a47c40982ec94d8cc838.
---
Makefile.tools | 6 +-----
configure.ac | 8 +-------
2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/Makefile.tools b/Makefile.tools
index 27a753762..c17244677 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -539,11 +539,7 @@ endif

if CUPS

-if CUPS_SERVERBIN
-cupsdir = $(CUPS_SERVERBIN)/backend
-else
-cupsdir = $(libdir)/cups/backend
-endif
+cupsdir = $(CUPSDIR)

cups_PROGRAMS = profiles/cups/bluetooth

diff --git a/configure.ac b/configure.ac
index 9ebc250cf..0190e8271 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,13 +247,7 @@ AC_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups],
[disable CUPS printer support]), [enable_cups=${enableval}])
AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no")
if (test "${enable_cups}" != "no"); then
- AC_MSG_CHECKING([cups directory])
- cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin`
- AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "")
- if (test "${cups_serverbin}" != ""); then
- AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin})
- fi
- AC_MSG_RESULT([${cups_serverbin}])
+ AC_SUBST(CUPSDIR, `$PKG_CONFIG cups --variable=cups_serverbin`/backend)
fi

AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh],
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From b94f1be656f34ea1363f5566ef63b847234c6dea Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <[email protected]>
Date: Mon, 15 Apr 2024 10:48:58 -0400
Subject: [PATCH] shared/uhid: Fix crash if bt_uhid_destroy free replay
structure

Id replay structured has been allocated it shall be set back to NULL
after calling uhid_replay_free otherwise it may cause the following
crash:

Invalid read of size 1
at 0x1D8FC4: bt_uhid_record (uhid.c:116)
by 0x1D912C: uhid_read_handler (uhid.c:158)
by 0x201A64: watch_callback (io-glib.c:157)
by 0x48D4198: g_main_dispatch.lto_priv.0 (gmain.c:3344)
by 0x49333BE: UnknownInlinedFun (gmain.c:4152)
by 0x49333BE: g_main_context_iterate_unlocked.isra.0 (gmain.c:4217)
by 0x48D4DC6: g_main_loop_run (gmain.c:4419)
by 0x2020F4: mainloop_run (mainloop-glib.c:66)
by 0x20254B: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x12D6D4: main (main.c:1456)
Address 0x53ae9c0 is 0 bytes inside a block of size 40 free'd
at 0x48468CF: free (vg_replace_malloc.c:985)
by 0x1D8E19: uhid_replay_free (uhid.c:68)
by 0x1D8E19: uhid_replay_free (uhid.c:59)
by 0x1D8E19: bt_uhid_destroy (uhid.c:509)
by 0x1591F5: uhid_disconnect (device.c:183)

Fixes: https://github.com/bluez/bluez/issues/815
---
src/shared/uhid.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/shared/uhid.c b/src/shared/uhid.c
index c1092b707..1f071b958 100644
--- a/src/shared/uhid.c
+++ b/src/shared/uhid.c
@@ -507,6 +507,7 @@ int bt_uhid_destroy(struct bt_uhid *uhid)

uhid->created = false;
uhid_replay_free(uhid->replay);
+ uhid->replay = NULL;

return err;
}
10 changes: 6 additions & 4 deletions projects/Rockchip/devices/RK3566/linux/linux.aarch64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ CONFIG_BT_RFCOMM=y
# CONFIG_BT_RFCOMM_TTY is not set
# CONFIG_BT_BNEP is not set
# CONFIG_BT_CMTP is not set
CONFIG_BT_HIDP=y
CONFIG_BT_HIDP=m
CONFIG_BT_HS=y
CONFIG_BT_LE=y
CONFIG_BT_LE_L2CAP_ECRED=y
Expand Down Expand Up @@ -5526,6 +5526,8 @@ CONFIG_HID_PENMOUNT=y
CONFIG_HID_PETALYNX=y
# CONFIG_HID_PICOLCD is not set
CONFIG_HID_PLANTRONICS=y
CONFIG_HID_PLAYSTATION=y
CONFIG_PLAYSTATION_FF=y
# CONFIG_HID_PXRC is not set
# CONFIG_HID_RAZER is not set
CONFIG_HID_PRIMAX=y
Expand All @@ -5536,7 +5538,7 @@ CONFIG_HID_SAMSUNG=y
# CONFIG_HID_SEMITEK is not set
# CONFIG_HID_SIGMAMICRO is not set
CONFIG_HID_SONY=y
# CONFIG_SONY_FF is not set
CONFIG_SONY_FF=y
CONFIG_HID_SPEEDLINK=y
# CONFIG_HID_STEAM is not set
CONFIG_HID_STEELSERIES=y
Expand Down Expand Up @@ -5969,8 +5971,8 @@ CONFIG_MMC_HSQ=y
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_CLASS_FLASH is not set
# CONFIG_LEDS_CLASS_MULTICOLOR is not set
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_CLASS_MULTICOLOR=y
# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set

#
Expand Down
Loading