asymptotic-io / bluez

Main BlueZ tree
https://bluez.github.io/bluez/
GNU General Public License v2.0
3 stars 1 forks source link

Unable to stream audio via simple-asha script #3

Open haecker-felix opened 3 months ago

haecker-felix commented 3 months ago
haeckerfelix@fedora:~$ /home/haeckerfelix/Documents/Projekte/bluez/test/simple-asha 60:C0:BF:79:0C:82 /home/haeckerfelix/Downloads/test.mp3 
Traceback (most recent call last):
  File "/home/haeckerfelix/Documents/Projekte/bluez/test/simple-asha", line 114, in <module>
    device = bluezutils.find_device(sys.argv[1])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/haeckerfelix/Documents/Projekte/bluez/test/bluezutils.py", line 31, in find_device
    return find_device_in_objects(get_managed_objects(), device_address,
                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/haeckerfelix/Documents/Projekte/bluez/test/bluezutils.py", line 13, in get_managed_objects
    return manager.GetManagedObjects()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Remote peer disconnected

I hear continuous "click" noises, it seems like the laptop is constantly connecting and disconnecting, it only stops when I disable Bluetooth.

main.conf changes:

# Enables D-Bus experimental interfaces
# Possible values: true or false
Experimental = true
ControllerMode = le
MinConnectionInterval=16
MaxConnectionInterval=16

bluetoothd logs:

Mai 24 12:00:31 fedora bluetoothd[5700]: Bluetooth management interface 1.22 initialized
Mai 24 12:03:23 fedora bluetoothd[5700]: Battery Provider Manager created
Mai 24 12:03:23 fedora bluetoothd[5700]: profiles/audio/avrcp.c:avrcp_controller_server_probe() Unable to register AVRCP service record
Mai 24 12:03:23 fedora bluetoothd[5700]: avrcp-controller: Operation not permitted (1)
Mai 24 12:03:23 fedora bluetoothd[5700]: profiles/audio/avrcp.c:avrcp_target_server_probe() Unable to register AVRCP target service record
Mai 24 12:03:23 fedora bluetoothd[5700]: audio-avrcp-target: Operation not permitted (1)
Mai 24 12:03:23 fedora bluetoothd[5700]: profiles/audio/bap.c:bap_adapter_probe() BAP requires ISO Socket which is not enabled
Mai 24 12:03:23 fedora bluetoothd[5700]: bap: Operation not supported (95)
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:23 fedora bluetoothd[5700]: src/profile.c:ext_register_record() Failed to register service record
Mai 24 12:03:24 fedora bluetoothd[5700]: Adv Monitor Manager created with supported features:0x00000001, enabled features:0x00000001, max number of supported monitors:32, max number of supported patterns:16
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/ldac: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSink/aac: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/aac: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSink/sbc: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/sbc: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSink/sbc_xq: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/sbc_xq: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/faststream: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/faststream_duplex: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSink/opus_05: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/opus_05: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSink/opus_05_duplex: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.171:/MediaEndpoint/A2DPSource/opus_05_duplex: Success
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:client_ready_cb() No valid external Media objects found
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Mai 24 12:03:24 fedora bluetoothd[5700]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Mai 24 12:03:26 fedora bluetoothd[5700]: profiles/audio/asha.c:asha_source_endpoint_register() Could not register remote ep /org/bluez/hci0/dev_60_C0_BF_33_7D_D1/asha
haecker-felix commented 3 months ago

wireshark.zip

barolo commented 3 months ago

What's the Bluetooth version?

haecker-felix commented 3 months ago

The asha-support branch is 5.76

barolo commented 3 months ago

The asha-support branch is 5.76

I meant what's the supported BT version of your hardware.

haecker-felix commented 3 months ago

It's a Intel AX200 with BT 5.2, but given the asha-poc already worked finely I doubt it's a hardware limitation.

barolo commented 3 months ago

It's a Intel AX200 with BT 5.2, but given the asha-poc already worked finely I doubt it's a hardware limitation.

You're right, if asha-poc works that's not the issue. Do you have SELinux enabled?

haecker-felix commented 3 months ago

selinux is disabled

thewierdnut commented 3 months ago

Reading through the pcap file, I see it successfully retrieving the asha read-only-properties in packet 6783, but I don't ever see it establishing a connection. It also appears to be getting errors whenever it tries to read values from the device.

The embedded log messages also don't seem to match the current source code.

I suspect that the device has a bad gatt service cache. Can you try the following:

  1. Compile and run the latest version of the asha-support branch.
  2. Remove the device from your bluetooth configuration.
  3. Use sudo btmon -w capture_file_name.snoop to begin capturing data.
  4. Go through the bluetooth new-device dialog, for one hearing aid only.
  5. run the simple-asha script
  6. stop capturing data.