Closed MadSpindel closed 5 months ago
Can you post the output of lsusb -t
?
Sure:
lsusb -t
/: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 480M
|__ Port 001: Dev 002, If 0, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 001: Dev 002, If 1, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 001: Dev 002, If 2, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 001: Dev 002, If 3, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 001: Dev 002, If 4, Class=Vendor Specific Class, Driver=[none], 12M
|__ Port 007: Dev 006, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 008: Dev 007, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 008: Dev 007, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/: Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
|__ Port 001: Dev 002, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 001: Dev 002, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 001: Dev 002, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 003: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 003: Dev 003, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 004: Dev 004, If 0, Class=Vendor Specific Class, Driver=[none], 12M
/: Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
|__ Port 002: Dev 004, If 0, Class=Human Interface Device, Driver=usbhid, 5000M
|__ Port 002: Dev 004, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 002: Dev 004, If 2, Class=Video, Driver=uvcvideo, 5000M
Btw, it works better now after I rebooted. Still stable but I will test some more.
It got unstable after some interference from my iPhone. And now it's unstable even if I turned Bluetooth off on my phone. Maybe reboot will fix it again? Restarting asha_pipewire_sink didn't help.
./asha_pipewire_sink
on_change_state old: UNCONNECTED new: CONNECTING
on_change_state old: CONNECTING new: PAUSED
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 5 Total: 5
** (process:4143): WARNING **: 22:04:23.589: Disconnected from Fredrik (Right): (Connection reset by peer)
** (process:4143): WARNING **: 22:04:26.250: Disconnected from Fredrik (Left): (Connection reset by peer)
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 3 Total: 8
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 18446744073709551608 Total: 0
on_change_state old: UNCONNECTED new: CONNECTING
on_change_state old: CONNECTING new: PAUSED
on_change_state old: PAUSED new: STREAMING
Why was process called with no buffers?
Ring Occupancy: 5 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 4 Total: 4
** (process:4143): WARNING **: 22:04:47.082: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:04:47.103: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:04:47.327: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:04:47.382: Dropping frame for Fredrik (Right)
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
on_change_state old: STREAMING new: PAUSED
on_change_state old: PAUSED new: STREAMING
on_change_state old: STREAMING new: PAUSED
on_change_state old: PAUSED new: STREAMING
** (process:4143): WARNING **: 22:04:55.269: Dropping frame for Fredrik (Right)
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 8 Total: 12
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 12
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 12
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 12
** (process:4143): WARNING **: 22:05:34.466: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:34.625: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:34.646: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:34.666: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:34.708: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:34.728: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.126: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.266: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.328: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.406: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.468: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.489: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.530: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.546: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.546: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.566: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.587: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:35.706: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.806: Dropping frame for Fredrik (Left)
** (process:4143): WARNING **: 22:05:35.888: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:36.049: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:05:36.106: Dropping frame for Fredrik (Left)
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 1 Total: 13
** (process:4143): WARNING **: 22:05:39.267: Disconnected from Fredrik (Left): (Connection reset by peer)
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 13
** (process:4143): WARNING **: 22:05:46.387: Dropping frame for Fredrik (Right)
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 1 Total: 14
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 14
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 3 Total: 17
** (process:4143): WARNING **: 22:06:22.532: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:06:22.548: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:06:23.412: Dropping frame for Fredrik (Right)
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 17
** (process:4143): WARNING **: 22:06:26.809: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:06:27.828: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:06:28.032: Dropping frame for Fredrik (Right)
** (process:4143): WARNING **: 22:06:28.610: Disconnected from Fredrik (Left): (Connection reset by peer)
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 17
Ring Occupancy: 4 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 17
can you run with the G_MESSAGES_DEBUG=all
environment variable?
Sure, just some more info. Disabled Bluetooth on my iPhone. Rebooted computer, connected to hearing aids in the Bluetooth settings -> Streamed for like 10 min without any issues at all (when it works like that it feels like magic). Enabled iPhone again, started a Youtube video -> Hearing aids got disconnected from computer. Disabled Bluetooth again on iPhone, connected hearing aids to computer but now asha_pipewire_sink refuses to start again.
./asha_pipewire_sink
** INFO: 22:44:25.589: Starting...
(process:4885): GLib-GIO-DEBUG: 22:44:25.589: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
** INFO: 22:44:25.601: Adding bluetooth device Fredrik
** INFO: 22:44:25.635: Name: Fredrik
** INFO: 22:44:25.635: HiSyncId 3980162077088088327
** INFO: 22:44:25.635: Side: left (binaural)
** INFO: 22:44:25.635: Delay: 89 ms
** INFO: 22:44:25.635: Streaming: supported
** INFO: 22:44:25.635: Codecs: G.722
on_change_state old: UNCONNECTED new: CONNECTING
** INFO: 22:44:25.638: Adding Sink 3980162077088088327 Fredrik
on_change_state old: CONNECTING new: PAUSED
** INFO: 22:44:25.640: Adding bluetooth device Fredrik
on_change_state old: PAUSED new: STREAMING
** INFO: 22:44:25.679: Name: Fredrik
** INFO: 22:44:25.679: HiSyncId 3980162077088088327
** INFO: 22:44:25.679: Side: right (binaural)
** INFO: 22:44:25.679: Delay: 89 ms
** INFO: 22:44:25.679: Streaming: supported
** INFO: 22:44:25.679: Codecs: G.722
** INFO: 22:44:25.689: Adding left device to Fredrik
** (process:4885): WARNING **: 22:44:25.775: Failed to connect l2cap channel: Connection refused
** (process:4885): ERROR **: 22:44:25.815: Failed to connect to Fredrik (Left)
Trace/breakpoint trap (core dumped)
I will reboot and try again...
I had to reboot the hearing aids...
Is it possible to have asha_pipewire_sink to connect to the hearing aids when it starts? And that it tries to reconnect if disconnected?
Anyway:
export G_MESSAGES_DEBUG=all
./asha_pipewire_sink
** INFO: 22:57:53.594: Starting...
(process:4930): GLib-GIO-DEBUG: 22:57:53.594: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
** INFO: 22:57:53.605: Adding bluetooth device Fredrik
** INFO: 22:57:53.633: Name: Fredrik
** INFO: 22:57:53.633: HiSyncId 3980162077088088327
** INFO: 22:57:53.633: Side: left (binaural)
** INFO: 22:57:53.633: Delay: 89 ms
** INFO: 22:57:53.633: Streaming: supported
** INFO: 22:57:53.633: Codecs: G.722
on_change_state old: UNCONNECTED new: CONNECTING
** INFO: 22:57:53.636: Adding Sink 3980162077088088327 Fredrik
on_change_state old: CONNECTING new: PAUSED
** INFO: 22:57:53.638: Adding bluetooth device Fredrik
on_change_state old: PAUSED new: STREAMING
** INFO: 22:57:53.689: Name: Fredrik
** INFO: 22:57:53.689: HiSyncId 3980162077088088327
** INFO: 22:57:53.689: Side: right (binaural)
** INFO: 22:57:53.689: Delay: 89 ms
** INFO: 22:57:53.689: Streaming: supported
** INFO: 22:57:53.689: Codecs: G.722
** INFO: 22:57:53.691: Adding left device to Fredrik
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
** INFO: 22:57:53.933: Adding right device to Fredrik
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Why was process called with no buffers?
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 7 Total: 7
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
** (process:4930): WARNING **: 22:58:28.230: Dropping frame for Fredrik (Right)
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 4 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 2 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
** (process:4930): WARNING **: 22:59:05.972: Dropping frame for Fredrik (Left)
** (process:4930): WARNING **: 22:59:12.251: Dropping frame for Fredrik (Right)
** (process:4930): WARNING **: 22:59:12.271: Dropping frame for Fredrik (Right)
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
Ring Occupancy: 3 High: 5 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 7
** INFO: 22:59:39.370: Removing bluetooth device Fredrik
** (process:4930): WARNING **: 22:59:39.371: Disconnected from Fredrik (Right): (Connection reset by peer)
** INFO: 22:59:39.433: Removing bluetooth device Fredrik
** (process:4930): WARNING **: 22:59:39.452: Disconnected from Fredrik (Left): (Connection reset by peer)
** INFO: 22:59:39.521: Removing Sink 3980162077088088327 Fredrik
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 18446744073709551609 Total: 0
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 0
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 0
Ring Occupancy: 0 High: 0 Ring Dropped: 0 Total: 0 Adapter Dropped: 0 Total: 0
Are your hearing devices paired with your iphone? Is it trying to take control of them?
When I switch my hearing aids from my laptop to my phone to my desktop, I usually have to delete any existing pairings, restart my hearing aids, and re-pair them from scratch.
Trace/breakpoint trap (core dumped)
Do you know how to load that core in gdb and produce a backtrace? If not, can you rerun cmake with cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=1
so that next time it dumps the backtrace to the console?
Are your hearing devices paired with your iphone? Is it trying to take control of them?
When I switch my hearing aids from my laptop to my phone to my desktop, I usually have to delete any existing pairings, restart my hearing aids, and re-pair them from scratch.
Yes, my hearing aids are connected to my iPhone, one Oticon ConnectClip and an Oticon TV Adapter. They connect automatically to my phone as MFI hearing aids. If I start my Oticon ConnectClip, it will connect to my hearing aids as well. As long as I don't use any audio (listening on Spotify, Youtube, calls etc.) on my iPhone, it will stream from my ConnectClip as long it's on and receiving audio from my computer. But as soon as I receive any audio from my iPhone, it will take over the connection. (It's only when audio btw, I can use the Oticon Companion app and stream audio from asha_pipewire_sink at the same time with no issues.) And when the audio from my iPhone stops, the ConnectClip will try to reconnect again (often it takes a couple of seconds - which could be a little bit annoying when I'm on a Teams call on my computer).
Something similar should be possible with ASHA, I guess. If possible, it would be great if asha_pipewire_sink could try to reconnect when the hearing aids are Disconnected. It looks like asha_pipewire_sink works really well if it doesn't get interfered by my iPhone. In fact, it works much better than the Oticon ConnectClip. With the Oticon ConnectClip the latency is higher, the sound quality is lower/harsher - it's not even close!
To use the Oticon TV Adapter, I need to switch to it from the Oticon Companion app or use the buttons on the hearing aids (hold the volume up button for some seconds).
Trace/breakpoint trap (core dumped)
Do you know how to load that core in gdb and produce a backtrace? If not, can you rerun cmake with
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=1
so that next time it dumps the backtrace to the console?
No, but I will try, thanks.
Those are probably responding to service advertisements. I don't have that implemented, but I'll see what I can do.
I've added a reconnect issue (#15) and added your device to the wiki. Please continue testing and let me know if you run across any other issues.
Thank you for this project! I've tried the code with my Oticon Mores. It works, but it's not stable and latency is sometimes quite high. And range seems limited if I stream to both ears at the same time. If I move maybe 1-2 meters away from the my Intel AX200 Bluetooth adapter it will disconnect one of them. When I'm streaming only with one ear, it's more stable and range seems to be pretty OK.
Some data:
and: