| c3613b8a |
monitor: parse Google's Opus A2DP vendor codec capabilities
Support parsing Opus (Google) A2DP vendor codec capabilities.
AOSP & Google Pixel Buds Pro has this implemented.
> ACL Data RX: Handle 256 flags 0x02 dlen 21 #419 [hci0] 26.905032
Channel: 65 len 17 [PSM 25 mode Basic (0x00)] {chan 4}
AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 3 nosp 0
Service Category: Media Transport (0x01)
Service Category: Media Codec (0x07)
Media Type: Audio (0x00)
Media Codec: Non-A2DP (0xff)
Vendor ID: Google (0x000000e0)
Vendor Specific Codec ID: Opus (Google) (0x0001)
Frequency: 0x80
48000
Frame Duration: 0x18
10 ms
20 ms
Channel Mode: 0x07
Mono
Stereo
Dual Mono
Reserved: 0x60
Service Category: Delay Reporting (0x08) |
Pauli Virtanen |
1 year ago |
1 file, +48, -0 |
| d5c1c0e8 |
emulator/btdev: Send page timeout after 5.12 secs delay
Real bluetooth adapters wouldn't send the page timeout immediately
when trying to page a device, instead it would take a few seconds.
Try to behave more realistically in the emulator and send the page
timeout after 5.12 seconds, which is the default page timeout. |
Jonas Dreßler |
1 year ago |
1 file, +33, -1 |
| 6a264df7 |
mgmt-tester: Adjust a test for recent kernel changes
With the changes in the kernel to move to hci_sync for connecting ACL
devices (see kernel commit "Bluetooth: hci_conn: Only do ACL connections
sequentially"), the "ETIMEDOUT" error path for the "HCI Create
Connection" command was changed, sending a "HCI Create Connection
Cancel" command after the timeout.
This leads to the returned error in the "Pair Device - Power off 1"
test to change from NOT_POWERED to DISCONNECTED, so adjust for that. |
Jonas Dreßler |
1 year ago |
1 file, +1, -1 |
| 141513cd |
mgmt-tester: Add a 0-entry to expect_hci_list lists
In add_expect_hci_list() we iterate through the entries of the
expect_hci_list as long as there is an opcode, which means currently
this relies on overflowing the buffer to detect the end of the list.
This is not great and when running with address sanitizer, the
out-of-bounds read gets detected and mgmt-tester aborts. Fix it by
adding a trailing zero-entry to all those lists. |
Jonas Dreßler |
1 year ago |
1 file, +7, -0 |
| de8c249f |
btdev: Fix crash on BIG Sync Terminate command
When receiving BIG Sync Terminate command the following crash could be
observed:
Invalid read of size 8
at 0x15FC9F: cmd_big_term_sync (btdev.c:6417)
by 0x15D19D: run_cmd (btdev.c:7269)
by 0x16E7DF: process_cmd (btdev.c:7425)
by 0x16E7DF: btdev_receive_h4 (btdev.c:7516)
by 0x143AB9: vhci_read_callback (vhci.c:77)
by 0x185AAE: io_callback (io-mainloop.c:110)
by 0x187158: mainloop_run (mainloop.c:106)
by 0x188357: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x4EA6B89: (below main) (in /usr/lib64/libc.so.6)
Address 0x53cf678 is 8 bytes inside a block of size 16 free'd
at 0x4845B2C: free (vg_replace_malloc.c:985)
by 0x17E0FE: queue_remove (queue.c:256)
by 0x1497F0: conn_remove (btdev.c:537)
by 0x15FC8A: cmd_big_term_sync (btdev.c:6427)
by 0x15D19D: run_cmd (btdev.c:7269)
by 0x16E7DF: process_cmd (btdev.c:7425)
by 0x16E7DF: btdev_receive_h4 (btdev.c:7516)
by 0x143AB9: vhci_read_callback (vhci.c:77)
by 0x185AAE: io_callback (io-mainloop.c:110)
by 0x187158: mainloop_run (mainloop.c:106)
by 0x188357: mainloop_run_with_signal (mainloop-notify.c:188)
by 0x4EA6B89: (below main) (in /usr/lib64/libc.so.6) |
Luiz Augusto von Dentz |
1 year ago |
1 file, +1, -0 |
| 05efcccd |
bap: Remove incorrect assignment of listen io
For a broadacst sink, the io that is notified in iso_bcast_confirm_cb
is the stream io, so the listen io should not be updated. |
Iulia Tanasescu |
1 year ago |
1 file, +0, -1 |
| 35032a60 |
bap: Fix incorrect parsing of caps and meta in parse_base
This adds a fix to properly parse the stream capabilities and
metadata in parse base. |
Iulia Tanasescu |
1 year ago |
1 file, +25, -15 |
| 29dee7b5 |
shared/bap: Properly cleanup bap remote endpoints
When freeing a remote bap endpoint, the endpoint reference inside the
stream should be set to NULL, to avoid later use after free errors. |
Iulia Tanasescu |
1 year ago |
1 file, +11, -1 |
| d14e0b5e |
shared/bap: Make broadcast disable and release more consistent
This makes bt_bap_stream_disable and bt_bap_stream_release use disabling
and releasing states to be more consistent with their procedures. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +8, -7 |
| 8527a218 |
transport: Fix crash when disable bcast stream
bt_bap_stream_disable does cause the stream to go to releasing state
removing the owner in the process so calling bap_disable_complete
passing the existing owner would likely cause a crash. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +2, -1 |
| b4aae7f3 |
shared/bap: Fix not being able to reconfigure Broadcast Source
This fixes not being able to reconfigure broadcast source due to it
being in Releasing:
bluetoothd[37]: src/shared/bap.c:stream_set_state_broadcast() stream
0x8919e0 dir 0x00: streaming -> releasing
bluetoothd[37]: profiles/audio/bap.c:setup_new() ep 0x8802d0 setup
0x88d3e0
bluetoothd[37]: src/shared/bap.c:bt_bap_stream_new() Unable to find
unused ASE |
Luiz Augusto von Dentz |
1 year ago |
1 file, +1, -0 |
| 75095a99 |
bap: Fix crash when a broadcast strean setup is pending
This fixes the following crash when a broadcast stream setup is
pending and the device is remove:
bluetoothd[37]: src/device.c:device_free() 0x89a500
bluetoothd[37]: GLib: Invalid file descriptor.
bluetoothd[37]: ++++++++ backtrace ++++++++
bluetoothd[37]: #1 g_logv+0x270 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557e3120]
bluetoothd[37]: #2 g_log+0x93 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557e3403]
bluetoothd[37]: #3 g_io_channel_error_from_errno+0x4a (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557cd9da]
bluetoothd[37]: #4 g_io_unix_close+0x53 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb55839d53]
bluetoothd[37]: #5 g_io_channel_shutdown+0x10f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557cdf7f]
bluetoothd[37]: #6 g_io_channel_unref+0x39 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557ce1e9]
bluetoothd[37]: #7 g_source_unref_internal+0x24f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557db79f]
bluetoothd[37]: #8 g_main_context_dispatch+0x288 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557dd638]
bluetoothd[37]: #9 g_main_context_iterate.isra.0+0x318 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb5583b6b8]
bluetoothd[37]: #10 g_main_loop_run+0x7f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557dcaff]
bluetoothd[37]: #11 mainloop_run+0x15 (src/shared/mainloop-glib.c:68) [0x662e65]
bluetoothd[37]: #12 mainloop_run_with_signal+0x128 (src/shared/mainloop-notify.c:190) [0x663368]
bluetoothd[37]: #13 main+0x154b (src/main.c:1454) [0x41521b]
bluetoothd[37]: #14 __libc_start_call_main+0x7a (/usr/lib64/libc.so.6) [0x7feb54e1fb8a]
bluetoothd[37]: #15 __libc_start_main@@GLIBC_2.34+0x8b (/usr/lib64/libc.so.6) [0x7feb54e1fc4b]
bluetoothd[37]: #16 _start+0x25 (src/main.c:1197) [0x416305]
bluetoothd[37]: +++++++++++++++++++++++++++ |
Luiz Augusto von Dentz |
1 year ago |
1 file, +9, -0 |
| b983c31d |
shared/bap: Allow using bt_bap_attach for broadcast
This enables use of bt_bap_attach for broadcast by checking if there is
a client or ATT instance. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +2, -1 |
| 59bf065b |
device: Don't remove object if a service is connecting
If a service is connecting just restart the timer to give it more time
to complete the connection or disconnect. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +7, -0 |
| 17c1a9b4 |
bap: Fix passing ep instead of setup to config_cb
config_cb expects setup pointer not ep. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +1, -1 |
| 17623000 |
client/mgmt: Add missing settings strings
This adds "iso-broadcaster" and "sync-receiver" which were missing. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +2, -0 |
| a692cc44 |
client/player: Update bcast endpoint input prompts
This updates the input prompts for broadcast endpoint register and
config.
To register a broadcast endpoint, the user will be asked to enter
the supported stream locations and context types.
At broadcast source endpoint config, the user will provide stream
config options: The BIG that the new stream will be part of, the
stream Channel Allocation, and the metadata of the subgroup to
include the stream. These options will be used to configure the
BASE and the BIG.
The flow to create a Broadcast Source is the following:
[bluetooth]# endpoint.register 00001852-0000-1000-8000-
00805f9b34fb 0x06
[/local/endpoint/ep0] Auto Accept (yes/no): y
[/local/endpoint/ep0] Max Transports (auto/value): a
[/local/endpoint/ep0] Locations: 3
[/local/endpoint/ep0] Supported Context (value): 15
[NEW] Endpoint /org/bluez/hci0/pac_bcast0
Endpoint /local/endpoint/ep0 registered
[bluetooth]# endpoint.config /org/bluez/hci0/pac_bcast0
/local/endpoint/ep0 16_2_1
[/local/endpoint/ep0] BIG (auto/value): 1
[/local/endpoint/ep0] Enter channel location (value/no): 3
[/local/endpoint/ep0] Enter Metadata (value/no): 0x03 0x02
0x04 0x00
To create a Broadcast Sink, enter the following:
[bluetooth]# endpoint.register 00001851-0000-1000-8000-
00805f9b34fb 0x06
[/local/endpoint/ep0] Auto Accept (yes/no): y
[/local/endpoint/ep0] Max Transports (auto/value): a
[/local/endpoint/ep0] Locations: 3
[/local/endpoint/ep0] Supported Context (value): 15
[bluetooth]# scan on
[NEW] Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/
pac_bcast0
[bluetooth]# endpoint.config
/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0
/local/endpoint/ep0 16_2_1 |
Iulia Tanasescu |
1 year ago |
1 file, +190, -48 |
| 71181457 |
shared/lc3: Add macro for Channel Allocation LTV len
This adds a macro for the Audio_Channel_Allocation LTV len. |
Iulia Tanasescu |
1 year ago |
1 file, +3, -1 |
| 5c90ef8d |
shared/bap: Set bcast stream metadata
This updates bt_bap_stream_metadata to handle broadcast streams,
by setting stream medatada. |
Iulia Tanasescu |
1 year ago |
1 file, +14, -6 |
| 2aecc09a |
bap: Parse BIG handle at endpoint config
This adds support to parse the "BIG" key in bcast qos parser, at
endpoint configuration. |
Iulia Tanasescu |
1 year ago |
1 file, +6, -1 |
| e98bbe3f |
Monitor: Avoid printing stale address on connection event
We now remove potentially stale handle when assigning a new handle.
However, that is done after printing the handle and the stale address
associated with it.
Directly use print_field instead of print_handle to avoid printing the
stale address. We still print the correct address on the following
line anyway. |
Archie Pusaka |
1 year ago |
1 file, +4, -4 |
| 12ccf5ea |
Monitor: Remove handle before assigning
It is possible to have some handles not removed, for example the host
may decide not to wait for disconnection complete event when it is
suspending. In this case, when the peer device reconnected, we might
have two of the some handle assigned and create problem down the road.
This patch solves the issue by always removing any previous handles
when assigning a new handle if they are the same.
Reviewed-by: Zhengping Jiang <jiangzp@google.com> |
Archie Pusaka |
1 year ago |
1 file, +43, -36 |
| 0273602c |
client/player: Enable endpoint.show to work with local endpoints
This enables local endpoints to be printed with endpoint.show:
[bluetooth]# endpoint.show /local/endpoint/pac_snk/lc3
Endpoint /local/endpoint/pac_snk/lc3
UUID 00002bc9-0000-1000-8000-00805f9b34fb
Codec 0x06 (6)
Capabilities.#0: len 0x03 type 0x01
Capabilities.Sampling Frequencies: 0x00ff
Capabilities.Sampling Frequency: 8 Khz (0x0001)
Capabilities.Sampling Frequency: 11.25 Khz (0x0002)
Capabilities.Sampling Frequency: 16 Khz (0x0004)
Capabilities.Sampling Frequency: 22.05 Khz (0x0008)
Capabilities.Sampling Frequency: 24 Khz (0x0010)
Capabilities.Sampling Frequency: 32 Khz (0x0020)
Capabilities.Sampling Frequency: 44.1 Khz (0x0040)
Capabilities.Sampling Frequency: 48 Khz (0x0080)
Capabilities.#1: len 0x02 type 0x02
Capabilities.Frame Duration: 0x03
Capabilities.Frame Duration: 7.5 ms (0x01)
Capabilities.Frame Duration: 10 ms (0x02)
Capabilities.#2: len 0x02 type 0x03
Capabilities.Audio Channel Count: 0x03
Capabilities.Audio Channel Count: 1 channel (0x01)
Capabilities.Audio Channel Count: 2 channel (0x02)
Capabilities.#3: len 0x05 type 0x04
Capabilities.Frame Length: 30 (0x001e) - 240 (0x00f0)
Locations 0x00000003 (3)
SupportedContext 0x00000fff (4095)
Context 0x00000fff (4095) |
Luiz Augusto von Dentz |
1 year ago |
1 file, +77, -26 |
| 74e49f67 |
client/player: Add .name field to struct capabilities
This adds .name field to struct capabilities which is then used to form
the endpoint object path so it is easier to identify the endpoint
capabilities:
[bluetooth]# endpoint.list local
/local/endpoint/pac_snk/lc3
/local/endpoint/pac_src/lc3
/local/endpoint/bcaa/lc3 |
Luiz Augusto von Dentz |
1 year ago |
1 file, +29, -25 |
| 2faff4ca |
client/player: Use util_iov_dup/util_iov_free whenever possible
This uses util_iov_dup/util_iov_free whenever possible. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +31, -40 |
| 423fcc4c |
client/player: Add metadata support to struct capabilities
This enables defining metadata as part of the struct capabilities. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +46, -46 |
| 8e472230 |
util: Add UTIL_IOV_INIT
This adds UTIL_IOV_INIT macro which can be used to init elements of
struct iovec with a byte array. |
Luiz Augusto von Dentz |
1 year ago |
2 files, +16, -16 |
| f59f4902 |
android: export only (android) entrypoint from the modules
The android specific modules, have a designated HMI entrypoint. Hide
everything else with -fvisibility=hidden. |
Emil Velikov |
1 year ago |
4 files, +6, -0 |
| f174724c |
bluetoothd: change plugin loading alike obexd
Currently, we print "Loading foobar" for every plugin, before we try the
respective init() callback. Instead we handle the latter in a bunch, at
the end of the process.
Do the init() call early, print "Loaded" once it's actually successful
and drop the no-longer "active" tracking. |
Emil Velikov |
1 year ago |
1 file, +29, -24 |
| 7a1d3c7c |
bluetoothd: don't export internal API
... when building without external plugins. |
Emil Velikov |
1 year ago |
1 file, +4, -1 |
| 109cc8a0 |
bluetoothd: factor out external plugin support
As a whole all plugins should be built-in, otherwise they would be using
internal, undocumented, unversioned, unstable API.
Flesh out the external plugin support and simplify the normal path.
Guard the external plugin support behind a runtime check, which will be
dead-code eliminated in the default case. |
Emil Velikov |
1 year ago |
4 files, +62, -40 |
| 9f71892b |
bluetoothd: convert external sixaxis plugin to builtin
Convert the only known external plugin to built-in. It's a tiny 20K
binary that distros ship a separate package for.
Make it a builtin, which allows distros to drop the separate package, it
also enables us to compile out support for external modules - both in
terms of extra code and hide the internal bluetoothd API.
This means that libudev.so is pulled in, which is fine since its ABI has
been stable for over a decade. |
Emil Velikov |
1 year ago |
1 file, +3, -5 |
| 1db7a00e |
bluetoothd: remove external-dummy plugin
The external plugins infra is getting deprecated and disabled by
default. Remove this dummy plugin. |
Emil Velikov |
1 year ago |
2 files, +0, -36 |
| 004b5b28 |
obexd: factor out external plugin support
As a whole all plugins should be built-in, otherwise they would be using
internal, undocumented, unversioned, unstable API.
Flesh out the external plugin support into a few blocks and simplify the
normal path. Guard the external plugin support behind a runtime check,
which will be dead-code eliminated in the default case.
Hide the internal API (omit export-dynamic) when built without external
plugins. |
Emil Velikov |
1 year ago |
4 files, +66, -31 |
| 2a5c9cf6 |
configure, README: introduce --enable-external-plugins
As the README chunk says, disabled by default, since they rely on
internal API/ABI and can break at any point.
Instead everyone affected should work and upstream their plugin into the
bluez project. |
Emil Velikov |
1 year ago |
2 files, +23, -0 |
| 0de32f67 |
btgatt-client: Add function to search all primary services
This is requested to pass PTS GATT/CL/GAD/BV-01-C test. |
Frédéric Danis |
1 year ago |
1 file, +23, -7 |
| 647adf92 |
btgatt-client: Add function to search characteristics
This is requested to pass PTS GATT/CL/GAD/BV-05-C test.
This search characteristics based on UUID, start and end handles. |
Frédéric Danis |
1 year ago |
1 file, +82, -0 |
| 68cd2ae6 |
btgatt-client: Add function to search service based on UUID
This is requested to pass PTS GATT/CL/GAD/BV-02-C test. |
Frédéric Danis |
1 year ago |
1 file, +69, -0 |
| f0cef854 |
btgatt-client: Add command to prevent security level change
Some PTS GATT tests like GATT/CL/GAR/BI-04-C request to be able to get the
security error and do not try to change the security level.
This commit adds the ability to prevent to change the security level. |
Frédéric Danis |
1 year ago |
1 file, +72, -12 |
| 6c15afef |
shared/gatt: Prevent security level change for PTS GATT tests
Some PTS GATT tests like GATT/CL/GAR/BI-04-C request to be able to get the
security error and do not try to change the security level.
This commit adds the ability to prevent to change the security level for
an operation. |
Frédéric Danis |
1 year ago |
4 files, +49, -0 |
| 2e2e5001 |
bap: Fix update of context
Fix context getting updated with support_context. |
Kiran K |
1 year ago |
1 file, +1, -1 |
| d3971990 |
bap: Fix crash when attempting to set device as connectable
Broadcast source endpoints don't have a device object. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +2, -1 |
| 1cd6c874 |
build: install dbus-org.bluez.obex.service symlink
obex.service has an alias(dbus-org.bluez.obex.service) which is created
as it's enabled. At the same time, the dbus service references the alias
itself.
Thus the dbus socket activation can happen, only when the service is
already enabled/running... Which defeats the whole purpose.
Create/install the respective symlink/alias, so that any user looking
for the dbus will start it.
Note: we need a hook here instead of LN_S to create the in-tree file,
since `install' aggressively dereferences it. |
Emil Velikov |
1 year ago |
1 file, +6, -0 |
| 10d6d908 |
build: enable gc/dead code removal
Currently, there's plenty of unused code in most binaries. Enable
-fdata/function-sections, which allows the linker garbage collection to
do its job.
On a maintainer build, this reduces the (unstriped) binaries from 117 to
114MiB. |
Emil Velikov |
1 year ago |
1 file, +2, -0 |
| 116524c0 |
build: manage .service.in files via configure.ac
Considering we do basic substitution, we don't need to manually sed,
track dependencies, dist nor clean. Just add the files to
AC_CONFIG_FILES() call it a day - it does everything for us. |
Emil Velikov |
1 year ago |
9 files, +19, -26 |
| 808d008a |
build: remove explicit DEPENDENCIES handling
We currently duplicate the DEPENDENCIES handling that autotools does for
us. We have two types of objects - libraries or generated headers.
Former are part of the LDADD, the latter in BUILT_SOURCES. |
Emil Velikov |
1 year ago |
3 files, +0, -10 |
| 14c7f212 |
build: remove .service files from DEPENDENCIES lists
The DEPENDENCES lists are for binary objects, while the service files
are required by systemd (et al) after the install stage. The services
files are referenced by _DATA, so the service.in -> service conversion
can happen then. |
Emil Velikov |
1 year ago |
3 files, +3, -6 |
| 215e6c70 |
build: remove unused variable builtin_nodist |
Emil Velikov |
1 year ago |
1 file, +1, -2 |
| 35858e17 |
bap: Mark device as connectable if a broadcast Endpoint is found
If a broadcast Endpoint is found this uses btd_device_set_connectable to
make it as connectable since the Endpoint can be used to setup a
broadcast stream which requires the device object. |
Luiz Augusto von Dentz |
1 year ago |
1 file, +6, -0 |
| 7a1c6f31 |
device: Add btd_device_set_connectable
In case of devices advertising BCAA, aka. Broadcast Source, it shall be
possible to connect to them using something LE Audio Broadcast
procedures so this introduces btd_device_set_connectable so driver can
inform the core when the device is connectable even when it is
advertising using GAP broadcaster role for example. |
Luiz Augusto von Dentz |
1 year ago |
2 files, +6, -0 |