thewierdnut / asha_pipewire_sink

Asha audio protocol implementation for linux.
The Unlicense
28 stars 3 forks source link

TruHearing partial success report #25

Open bcasiello opened 1 month ago

bcasiello commented 1 month ago

I have a pair of TruHearing TH 7 RIC LI hearing aids (manufactured by Signia)

Manjaro Linux 24.0.5 on an Asus TUF A15 with Bluetooth 5.1.

Installation went perfectly and after pairing and running asha_pipewire_sync I was getting audio, but in the right ear only. That's my worse ear, so I unpaired, put just the left earpiece in the charger and removed it and paired again. This time I got sound through the left side (only), but still success as far as I'm concerned.

After a few minutes, the hearing aids disconnected.

Here's what asha_pipewire_sync logged

After connection:

(process:8078): GLib-GIO-CRITICAL **: 13:49:54.230: g_dbus_proxy_new_for_bus_sync: assertion 'g_variant_is_object_path (object_path)' failed

but the connection still occurred and I got audio

At disconnection:

(process:8078): WARNING : 13:52:56.490: Disconnected from Brian's hearing aids (Left): (Connection reset by peer)

(process:8078): GLib-GObject-CRITICAL **: 13:52:56.495: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

You can see from the timestamps that the connection lasted about three minutes.

Does "(Connection reset by peer)" mean that it's my hearing aids initiating the disconnect?

Any suggestions on next steps, or would more diagnostic logging help?

barolo commented 1 month ago

It's same platform as mine, so it's definitely possible to get them both to stream without such bug.

thewierdnut commented 1 month ago

Can you collect a full capture for me, including the initial setup?

Thanks

bcasiello commented 1 month ago

25_tru_hearing.zip asha_pipewire_sync_output.txt

Similar result - only the right ear connected, audio worked for a few minutes, then disconnected.

I also included the asha_pipewire_sync output in case that helps.

Thanks for looking into this!

bcasiello commented 1 month ago

Random thought (probably just betraying my lack of Bluetooth knowledge :-) Is there a chance that my phone is causing the disconnect? The hearing aids are also paired to the phone, could it try to 'take back' the connection? Is it worth telling the phone to forget the pairing when I want to connect to the PC? Or is that a 'nope, it doesn't work that way' situation?

thewierdnut commented 1 month ago

Is there a chance that my phone is causing the disconnect? The hearing aids are also paired to the phone, could it try to 'take back' the connection?

There have been people reporting issues with this, and also with automated usb asha devices. I don't think it would cause symptoms that look like this, but It may be worth just turning bluetooth off on your phone and trying again.

barolo commented 1 month ago

The hearing aids are also paired to the phone, could it try to 'take back' the connection?

Yes, turn BT on your phone off, it will fight for connection rather aggressively. At least mine does.

bcasiello commented 1 month ago

Phone bluetooth off, or even phone off doesn't make a difference. Still disconnects after a few seconds minutes.

thewierdnut commented 1 month ago

25_tru_hearing.zip asha_pipewire_sync_output.txt

Similar result - only the right ear connected, audio worked for a few minutes, then disconnected.

Two things of note:

  1. I think your hearing-aid is auto-disconnecting when its local buffer is empty, though I would love a second capture to confirm.
  2. Your bluetooth adapter is fragmenting the packets to 31 byte packets. I don't think you can handle two devices without DLE support. What bluetooth chipset do you have?
bcasiello commented 1 month ago

25_tru_hearing_2.zip

New capture attached.

Output of inxi -Eaz: Bluetooth: Device-1: Lite-On Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-1:2 chip-ID: 04ca:4005 class-ID: e001 serial: Report: btmgmt ID: hci0 rfk-id: 5 state: up address: bt-v: 5.1 lmp-v: 10 status: discoverable: no pairing: no class-ID: 6c010c

thewierdnut commented 1 month ago

Device-1: Lite-On Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-1:2 chip-ID: 04ca:4005

That's a new one. It doesn't appear to support LE Data Length Extension, though I'm still hunting for a command you can run to double check.

The capture seems to confirm. It slowly falls behind, and once the hearing aid buffer underruns, it disconnects. Given the massive overhead of the fragmentation, you may benefit from an increased transmission interval.

I would like you to try a slightly different buffering algorithm:

./asha_pipewire_sink --buffer_algorithm poll8

I would also like you to try setting the celength to 12, 16, or 24. This will require you to give the binary CAP_NET_RAW permissions:

./asha_pipewire_sink --celength 12
barolo commented 1 month ago

25_tru_hearing_2.zip

New capture attached.

Output of inxi -Eaz: Bluetooth: Device-1: Lite-On Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-1:2 chip-ID: 04ca:4005 class-ID: e001 serial: Report: btmgmt ID: hci0 rfk-id: 5 state: up address: bt-v: 5.1 lmp-v: 10 status: discoverable: no pairing: no

Is this some sort of BT dongle? As far as I remember they used to use cards from Mediatek and Realtek. Could you give outputs of lsusb and lspci -v ?

thewierdnut commented 1 month ago

Note the usb chip id: 04ca:4005 which matches the description of a Lite-On Bluetooth device. I'm also rather surprised that it works at all, given that most google searches show up as some variant of "this device doesn't work on linux"

barolo commented 1 month ago

04ca:4005

This branding is very confusing, it's the first time I'm seeing Lite-On in relation to BT.

barolo commented 1 month ago

I'm just going go ahead and say that you should probably look into replacing your Wi-Fi card. AX211 cards can be found cheaply.

bcasiello commented 1 month ago

lspci.txt lsusb.txt

It's not a dongle, this is a 'budget' gaming laptop, could be that they leaned really hard on the 'budget' part when putting in the BT chip. :-) I was running Windows for most of its (5 or 6 year?) life so far, only recently switched to Linux.

I'm very much open to getting a BT dongle if there's a decent chance it'll get this working. Is AX211 what I should be looking for?

thewierdnut commented 1 month ago

I'm very much open to getting a BT dongle if there's a decent chance it'll get this working. Is AX211 what I should be looking for?

Anything intel seems to work ok. something like this, though I would double-check that it fits in your laptop first.

If by "dongle", you mean a small usb bluetooth adapter, note that I have bought three of them so far, and none of them have worked any better than what you already have.

thewierdnut commented 1 month ago

What is the exact model (and year) of your laptop? I'm not finding evidence that lite-on makes upgradable chips. It looks like their chipsets are meant to be soldered directly on to the motherboard.

barolo commented 1 month ago

or run sudo dmidecode -s system-product-name

bcasiello commented 1 month ago

System product name is ASUS TUF Gaming A15 FA506IH_FA506IH According to my receipt, it's FA506IH-AS53 I haven't found any info online yet that states definitively whether the chip is soldered in, but I found this listing on a parts supplier website which gives me some hope: https://www.gotlaptopparts.com/products/asus-tuf-gaming-a15-15-6-fa506ih-as53-wifi-bluetooth-card-ax210ngw-5w10v25784

I'm guessing I'll just have to crack it open at some point and nose around. :-)

thewierdnut commented 1 month ago

Does this look familiar? https://www.youtube.com/watch?v=D0hcm12i4gM

The chip that needs replaced is pulled out at about 1:45 into the video

bcasiello commented 1 month ago

YES! I've had it open a few times, upgrading RAM and SSD, but never looked for the Bluetooth chip. Thanks!

shermp commented 1 month ago

Just a tip, if you replace your laptop Wi-Fi/BT card, be very careful with the antennas. I've replaced mine, and I'm pretty sure I've damaged one of my connectors, as it just will not click into place. It's currently held in with friction, tape, and a prayer.

The antenna connectors are an absolute PITA to re-seat.

thewierdnut commented 1 month ago

I think I finally found a way to read the le features and the default data length... though its annoying:

  1. Open up two root terminals
  2. In the left terminal, run the following two commands to shutdown bluetooth:
    systemctl stop bluetooth
    modprobe -r btusb
  3. In the right terminal, begin capturing bluetooth packets:
    btmon -w 25_liteon_startup.snoop
  4. In the left terminal, re-enable your bluetooth
    modprobe usb
    systemctl start bluetooth
  5. In the right terminal, stop your capture, and post the resulting 25_liteon_startup.snoop file.

In the future, I may see if there is a reasonable way to read this data directly from asha_connection_test somehow.

bcasiello commented 1 month ago

25_liteon_startup.zip

I ordered a new chip, I'll hold off swapping for a while in case more diagnostics are needed.

thewierdnut commented 1 month ago

If you still have the lite-on chip installed, can you run asha_connection_test, and post the output here?

bcasiello commented 4 weeks ago

I tried the new card, then tried to swap back the lite-on and have yet to be able to snap those two little wires on. I'll update if (when! be positive!) I succeed.

thewierdnut commented 4 weeks ago

I would stick with the new card if you can, assuming its an intel AX2xx variant. It will be better quality. I'm not that desperate to figure out exactly which way the lite-on card is broken.