librepods icon indicating copy to clipboard operation
librepods copied to clipboard

Hearing aid script settings don't seem to stick

Open RBastianini opened this issue 1 month ago • 9 comments

I've attempted to use the linux/hearing-aid-adjustments.py (incorrectly referenced in the linux/README.md as hearing_aid.py) to configure hearing aid on a pair of Airpods Pro 2 using Ubuntu 22.04.5 LTS. In order to make the script run I first applied the patch from PR 355, then I added the recommended deviceID configuration DeviceID = bluetooth:004C:0000:0000 to /etc/bluetooth/main.conf, downloaded PyQt5 using pip and installed libbluetooth-dev (without which, the script would fail to run).

With this setup in place, the dialog pops up and I can see communication happening in the console when I interact with the controls, but I can't hear any difference in the headphones. Also, if I close and relaunch the script, everything resets to default, and the logs seem to confirm that the settings were not saved (because the response when reading the hearing aid after relaunching the script is the same as the previous execution).

As a last resort I also attempted using the windows script from PR 333, but after setting it up, the result is the same: I can't hear any difference and the settings seem to reset every time I relaunch the script.

Am I doing something wrong?

Here are the logs when running the linux script.

2025-12-07 12:34:38,821 - INFO - Starting app
2025-12-07 12:34:38,830 - INFO - ATTManager initialized
2025-12-07 12:34:38,830 - INFO - HearingAidConfig initialized
2025-12-07 12:34:38,830 - DEBUG - Initializing UI
2025-12-07 12:34:38,854 - DEBUG - UI initialized
2025-12-07 12:34:38,854 - INFO - Connecting to ATT in UI
2025-12-07 12:34:38,854 - INFO - Attempting to connect to ATT socket
2025-12-07 12:34:38,938 - INFO - Starting notification listener thread
2025-12-07 12:34:38,939 - INFO - Connected to ATT socket
2025-12-07 12:34:38,939 - DEBUG - Sending CCCD write request for handle HEARING_AID: 122b000100
2025-12-07 12:34:38,940 - DEBUG - Sent PDU: 122b000100
2025-12-07 12:34:38,989 - DEBUG - Received PDU: 13
2025-12-07 12:34:38,990 - DEBUG - Response received: 
2025-12-07 12:34:38,990 - DEBUG - CCCD write response received for handle HEARING_AID
2025-12-07 12:34:38,990 - INFO - Enabled notifications for handle HEARING_AID
2025-12-07 12:34:38,990 - DEBUG - Registered listener for handle 42
2025-12-07 12:34:38,991 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:34:38,991 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:34:39,020 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,021 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,021 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,022 - DEBUG - Parsing hearing aid settings from data: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,022 - INFO - Parsing hearing aid settings, starting read at offset 4, value: 00
2025-12-07 12:34:39,022 - DEBUG - HearingAidSettings created: amp=0.0, balance=0.0, tone=0.0, anr=0.0, conv=False
2025-12-07 12:34:39,022 - INFO - Parsed settings: amp=0.0, balance=0.0
2025-12-07 12:34:39,023 - DEBUG - Updating UI with settings
2025-12-07 12:34:39,023 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,023 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,024 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,025 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,026 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,026 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,026 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,027 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,027 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,027 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,027 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,028 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,028 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,028 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,029 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,029 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,029 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,030 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,030 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:39,030 - INFO - Initial settings loaded
2025-12-07 12:34:39,167 - INFO - Sending settings from UI
2025-12-07 12:34:39,167 - DEBUG - HearingAidSettings created: amp=0.0, balance=0.0, tone=0.0, anr=0.0, conv=False
2025-12-07 12:34:39,168 - INFO - Sending hearing aid settings
2025-12-07 12:34:39,168 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:34:39,168 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:34:39,221 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,222 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,222 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,222 - DEBUG - Sending write request for handle HEARING_AID: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,222 - DEBUG - Sent PDU: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:39,230 - DEBUG - Received PDU: 13
2025-12-07 12:34:39,230 - DEBUG - Response received: 
2025-12-07 12:34:39,230 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 12:34:39,230 - INFO - Hearing aid settings sent
2025-12-07 12:34:46,565 - DEBUG - UI value changed, starting debounce
... more debounce lines ...
2025-12-07 12:34:47,876 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:47,977 - INFO - Sending settings from UI
2025-12-07 12:34:47,978 - DEBUG - HearingAidSettings created: amp=0.0, balance=0.0, tone=0.0, anr=0.94, conv=False
2025-12-07 12:34:47,978 - INFO - Sending hearing aid settings
2025-12-07 12:34:47,979 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:34:47,979 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:34:48,017 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:48,017 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:48,018 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:48,018 - DEBUG - Sending write request for handle HEARING_AID: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d7a3703f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d7a3703f0000003f
2025-12-07 12:34:48,018 - DEBUG - Sent PDU: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d7a3703f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d7a3703f0000003f
2025-12-07 12:34:48,039 - DEBUG - Received PDU: 13
2025-12-07 12:34:48,040 - DEBUG - Response received: 
2025-12-07 12:34:48,040 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 12:34:48,040 - INFO - Hearing aid settings sent
2025-12-07 12:34:54,081 - DEBUG - UI value changed, starting debounce
... more debounce lines ...
2025-12-07 12:34:54,834 - DEBUG - UI value changed, starting debounce
2025-12-07 12:34:54,940 - INFO - Sending settings from UI
2025-12-07 12:34:54,941 - DEBUG - HearingAidSettings created: amp=0.69, balance=0.0, tone=0.0, anr=0.94, conv=False
2025-12-07 12:34:54,941 - INFO - Sending hearing aid settings
2025-12-07 12:34:54,942 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:34:54,942 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:34:54,958 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:54,959 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:54,959 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:34:54,959 - DEBUG - Sending write request for handle HEARING_AID: 122a00020064000000000000000000000000000000000000000000000000000000000000000000d7a3303f0000000000000000d7a3703f0000000000000000000000000000000000000000000000000000000000000000d7a3303f0000000000000000d7a3703f0000003f
2025-12-07 12:34:54,960 - DEBUG - Sent PDU: 122a00020064000000000000000000000000000000000000000000000000000000000000000000d7a3303f0000000000000000d7a3703f0000000000000000000000000000000000000000000000000000000000000000d7a3303f0000000000000000d7a3703f0000003f
2025-12-07 12:34:55,010 - DEBUG - Received PDU: 13
2025-12-07 12:34:55,010 - DEBUG - Response received: 
2025-12-07 12:34:55,010 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 12:34:55,011 - INFO - Hearing aid settings sent
2025-12-07 12:35:05,217 - INFO - Closing app
2025-12-07 12:35:05,218 - INFO - Disconnecting from ATT socket
2025-12-07 12:35:05,218 - INFO - Closing socket
2025-12-07 12:35:05,218 - INFO - Stopping notification thread
2025-12-07 12:35:05,254 - INFO - Notification listener thread stopped, trying to reconnect
2025-12-07 12:35:05,254 - INFO - Disconnected from ATT socket

and the log from immediately reopening the tool

2025-12-07 12:35:08,526 - INFO - Starting app
2025-12-07 12:35:08,535 - INFO - ATTManager initialized
2025-12-07 12:35:08,536 - INFO - HearingAidConfig initialized
2025-12-07 12:35:08,536 - DEBUG - Initializing UI
2025-12-07 12:35:08,566 - DEBUG - UI initialized
2025-12-07 12:35:08,566 - INFO - Connecting to ATT in UI
2025-12-07 12:35:08,566 - INFO - Attempting to connect to ATT socket
2025-12-07 12:35:08,639 - INFO - Starting notification listener thread
2025-12-07 12:35:08,639 - INFO - Connected to ATT socket
2025-12-07 12:35:08,640 - DEBUG - Sending CCCD write request for handle HEARING_AID: 122b000100
2025-12-07 12:35:08,640 - DEBUG - Sent PDU: 122b000100
2025-12-07 12:35:08,684 - DEBUG - Received PDU: 13
2025-12-07 12:35:08,685 - DEBUG - Response received: 
2025-12-07 12:35:08,686 - DEBUG - CCCD write response received for handle HEARING_AID
2025-12-07 12:35:08,686 - INFO - Enabled notifications for handle HEARING_AID
2025-12-07 12:35:08,686 - DEBUG - Registered listener for handle 42
2025-12-07 12:35:08,687 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:35:08,687 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:35:08,695 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,695 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,695 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,696 - DEBUG - Parsing hearing aid settings from data: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,696 - INFO - Parsing hearing aid settings, starting read at offset 4, value: 00
2025-12-07 12:35:08,696 - DEBUG - HearingAidSettings created: amp=0.0, balance=0.0, tone=0.0, anr=0.0, conv=False
2025-12-07 12:35:08,696 - INFO - Parsed settings: amp=0.0, balance=0.0
2025-12-07 12:35:08,697 - DEBUG - Updating UI with settings
2025-12-07 12:35:08,697 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,697 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,697 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,699 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,699 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,699 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,700 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,700 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,701 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,701 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,701 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,702 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,702 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,702 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,702 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,703 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,703 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,703 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,704 - DEBUG - UI value changed, starting debounce
2025-12-07 12:35:08,704 - INFO - Initial settings loaded
2025-12-07 12:35:08,805 - INFO - Sending settings from UI
2025-12-07 12:35:08,805 - DEBUG - HearingAidSettings created: amp=0.0, balance=0.0, tone=0.0, anr=0.0, conv=False
2025-12-07 12:35:08,805 - INFO - Sending hearing aid settings
2025-12-07 12:35:08,805 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 12:35:08,805 - DEBUG - Sent PDU: 0a2a00
2025-12-07 12:35:08,813 - DEBUG - Received PDU: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,813 - DEBUG - Response received: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,813 - DEBUG - Read response for handle HEARING_AID: 020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,813 - DEBUG - Sending write request for handle HEARING_AID: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,813 - DEBUG - Sent PDU: 122a00020064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
2025-12-07 12:35:08,843 - DEBUG - Received PDU: 13
2025-12-07 12:35:08,843 - DEBUG - Response received: 
2025-12-07 12:35:08,843 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 12:35:08,843 - INFO - Hearing aid settings sent
2025-12-07 12:35:14,996 - INFO - Closing app
2025-12-07 12:35:14,996 - INFO - Disconnecting from ATT socket
2025-12-07 12:35:14,997 - INFO - Closing socket
2025-12-07 12:35:14,997 - INFO - Stopping notification thread
2025-12-07 12:35:15,067 - INFO - Notification listener thread stopped, trying to reconnect
2025-12-07 12:35:15,068 - INFO - Disconnected from ATT socket

RBastianini avatar Dec 07 '25 11:12 RBastianini

@kavishdevar seems like this is the one thing we discussed with manual packets sending

ressiwage avatar Dec 07 '25 12:12 ressiwage

! it is important to notice that i don't have any idea what does this script do, it was made by kavish devar

first of all, install pybluez from source and try execute this script with your mac address and execute those commands, then send results. if my hypothesis is right after that you'll be able to set frequencies and they'll preserve but you will hear no difference 0a2a00 122a000202640038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f 0a2a00

l2c script ```py import bluetooth import threading from prompt_toolkit import PromptSession from prompt_toolkit.patch_stdout import patch_stdout

sock = bluetooth.BluetoothSocket(bluetooth.L2CAP)

bt_addr = "X:X:X:X:X:X" # sys.argv[1] #psm = 0x1001 # AAP Server psm=31 print(f"Trying to connect to {bt_addr} on PSM 0x{psm:04X}...")

sock.connect((bt_addr, psm))

def listen(): while True: try: res = sock.recv(1024) if not res: break print(f"Response: {res.hex()}") except OSError: break

threading.Thread(target=listen, daemon=True).start()

print("Connected. Type hex bytes (Ctrl-L to clear, 'quit' to exit)...")

session = PromptSession() # handles history + key bindings

with patch_stdout(): while True: try: data = session.prompt("> ").strip() except (EOFError, KeyboardInterrupt): break

    if not data:
        continue

    if data.lower() == "quit":
        break

    try:
        if " " in data:
            # space-separated hex
            byts = bytes(int(b, 16) for b in data.split())
        else:
            # continuous hex string
            if len(data) % 2 != 0:
                data = "0" + data  # pad if odd length
            byts = bytes.fromhex(data)
        sock.send(byts)
    except Exception as e:
        print(f"Invalid input: {e}")

sock.close() print("Connection closed.")

</details> 

ressiwage avatar Dec 07 '25 12:12 ressiwage

after doing the following use AAP = 0x1001 instead of psm=31 and run those commands slowly. it is important to figure out which one of these commands will help you (if it will)

  • 00 00 04 00 01 00 02 00 00 00 00 00 00 00 00 00
  • 04 00 04 00 4d 00 ff 00 00 00 00 00 00 00
  • 04 00 04 00 0F 00 FF FF FF FF

  • 04 00 04 00 09 00 2C 01 01 00 00
  • 04 00 04 00 09 00 33 01 00 00 00
  • 04 00 04 00 09 00 2F 01 00 00 00
  • 04 00 04 00 09 00 0D 03 00 00 00

ressiwage avatar Dec 07 '25 12:12 ressiwage

yup, what @ressiwage said. I'll add all of this to #241 once I have some time.

@RBastianini could you also please share the logs from the windows script? because I do send the required packets in that script.

kavishdevar avatar Dec 07 '25 13:12 kavishdevar

Before I attempt the various steps, I'd like to make sure my understanding is correct, because you both know all the details, but I might miss some obvious step.

This is what I understood: After installing pybluez from source, I should use the script pasted above to send

    00 00 04 00 01 00 02 00 00 00 00 00 00 00 00 00
    04 00 04 00 4d 00 ff 00 00 00 00 00 00 00
    04 00 04 00 0F 00 FF FF FF FF

then close the script, change psm to 0x1001 and send

    04 00 04 00 09 00 2C 01 01 00 00
    04 00 04 00 09 00 33 01 00 00 00
    04 00 04 00 09 00 2F 01 00 00 00
    04 00 04 00 09 00 0D 03 00 00 00

slowly one row at a time. Should I listen for some changes in the airpods after sending each string or should I expect some specific output on the terminal to understand that it worked / which one worked?

I'll add the windows/hearing-aid.py windows logs in a moment. I didn't do it initially, because they didn't contain the raw output and I assumed they'd be less useful.

RBastianini avatar Dec 07 '25 15:12 RBastianini

no, first you should execute with psm=31

  • 0a2a00
  • 122a000202640038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
  • 0a2a00

and check if frequencies are preserving. after that you should set psm to 0x1001 and execute 7 instructions

  • 00 00 04 00 01 00 02 00 00 00 00 00 00 00 00 00
  • 04 00 04 00 4d 00 ff 00 00 00 00 00 00 00
  • 04 00 04 00 0F 00 FF FF FF FF
  • 04 00 04 00 09 00 2C 01 01 00 00
  • 04 00 04 00 09 00 33 01 00 00 00
  • 04 00 04 00 09 00 2F 01 00 00 00
  • 04 00 04 00 09 00 0D 03 00 00 00

terminal ouput won't let you know if it worked, so listen. you will definitely notice difference

ressiwage avatar Dec 07 '25 15:12 ressiwage

Thanks for clarifying the steps.

I tried capturing a log from windows, but despite several attempts, I was not able to connect the earpods to the system after switching the drivers to the WinUSB using Zadig tool. I was able to do it this morning, but for some reason it doesn't work now, and trying to launch the windows/hearing_aid.py script would always fail. I now followed the steps above on linux, so I suppose a windows log would no longer help, but I could try again if you still need it.

I ran the script the first time and input the first set of commands. I couldn't hear differences during this phase.

Connected. Type hex bytes (Ctrl-L to clear, 'quit' to exit)...
> 0a2a00
Response: 0b020060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f
> 122a000202640038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f
02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
Response: 13
> 0a2a00
Response: 0b0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
> quit
Connection closed.

I took a few tries to reconnect the airpods at this point, but when I launched the hearing-aid-adjustments.py script again, I found a bunch of settings already there (not all zeroes like they were before and not the settings I was trying to save before... I don't know where they came from). I was able to make changes and see that they were reflected in the responses from the logs.

2025-12-07 19:26:44,378 - INFO - Starting app
2025-12-07 19:26:44,387 - INFO - ATTManager initialized
2025-12-07 19:26:44,388 - INFO - HearingAidConfig initialized
2025-12-07 19:26:44,388 - DEBUG - Initializing UI
2025-12-07 19:26:44,413 - DEBUG - UI initialized
2025-12-07 19:26:44,413 - INFO - Connecting to ATT in UI
2025-12-07 19:26:44,413 - INFO - Attempting to connect to ATT socket
2025-12-07 19:26:44,447 - INFO - Starting notification listener thread
2025-12-07 19:26:44,447 - INFO - Connected to ATT socket
2025-12-07 19:26:44,447 - DEBUG - Sending CCCD write request for handle HEARING_AID: 122b000100
2025-12-07 19:26:44,448 - DEBUG - Sent PDU: 122b000100
2025-12-07 19:26:44,468 - DEBUG - Received PDU: 13
2025-12-07 19:26:44,469 - DEBUG - Response received: 
2025-12-07 19:26:44,469 - DEBUG - CCCD write response received for handle HEARING_AID
2025-12-07 19:26:44,470 - INFO - Enabled notifications for handle HEARING_AID
2025-12-07 19:26:44,470 - DEBUG - Registered listener for handle 42
2025-12-07 19:26:44,470 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:26:44,470 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:26:44,491 - DEBUG - Received PDU: 0b0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,492 - DEBUG - Response received: 0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,492 - DEBUG - Read response for handle HEARING_AID: 0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,492 - DEBUG - Parsing hearing aid settings from data: 0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,493 - INFO - Parsing hearing aid settings, starting read at offset 4, value: 38
2025-12-07 19:26:44,493 - DEBUG - HearingAidSettings created: amp=0.8500000238418579, balance=0.0, tone=-0.6200000047683716, anr=0.6800000071525574, conv=True
2025-12-07 19:26:44,493 - INFO - Parsed settings: amp=0.8500000238418579, balance=0.0
2025-12-07 19:26:44,494 - DEBUG - Updating UI with settings
2025-12-07 19:26:44,494 - DEBUG - UI value changed, starting debounce
... more debounce logs ...
2025-12-07 19:26:44,518 - DEBUG - UI value changed, starting debounce
2025-12-07 19:26:44,519 - INFO - Initial settings loaded
2025-12-07 19:26:44,642 - INFO - Sending settings from UI
2025-12-07 19:26:44,642 - DEBUG - HearingAidSettings created: amp=0.85, balance=0.0, tone=-0.62, anr=0.68, conv=True
2025-12-07 19:26:44,642 - INFO - Sending hearing aid settings
2025-12-07 19:26:44,643 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:26:44,643 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:26:44,660 - DEBUG - Received PDU: 0b0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,660 - DEBUG - Response received: 0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,660 - DEBUG - Read response for handle HEARING_AID: 0202600038831e41da2591413ddf5541fb54a1418f076c414c85e44036df8440057dda409a99593f52b81ebf0000803f7b142e3ffccb8141a786a141d41f5c41d63f02417497e6403a24c440962a914025b25a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,660 - DEBUG - Sending write request for handle HEARING_AID: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf0000803f7b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,660 - DEBUG - Sent PDU: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf0000803f7b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:44,686 - DEBUG - Received PDU: 13
2025-12-07 19:26:44,686 - DEBUG - Response received: 
2025-12-07 19:26:44,686 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:26:44,686 - INFO - Hearing aid settings sent
2025-12-07 19:26:51,800 - DEBUG - UI value changed, starting debounce
2025-12-07 19:26:51,896 - INFO - Sending settings from UI
2025-12-07 19:26:51,897 - DEBUG - HearingAidSettings created: amp=0.85, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:26:51,897 - INFO - Sending hearing aid settings
2025-12-07 19:26:51,898 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:26:51,898 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:26:51,914 - DEBUG - Received PDU: 0b020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf0000803f7b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:51,914 - DEBUG - Response received: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf0000803f7b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:51,914 - DEBUG - Read response for handle HEARING_AID: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf0000803f7b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf0000803f7b142e3f0000003f
2025-12-07 19:26:51,915 - DEBUG - Sending write request for handle HEARING_AID: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:26:51,915 - DEBUG - Sent PDU: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:26:51,948 - DEBUG - Received PDU: 13
2025-12-07 19:26:51,948 - DEBUG - Response received: 
2025-12-07 19:26:51,948 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:26:51,949 - INFO - Hearing aid settings sent
2025-12-07 19:27:03,038 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:03,134 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:03,230 - INFO - Sending settings from UI
2025-12-07 19:27:03,230 - DEBUG - HearingAidSettings created: amp=0.85, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:03,231 - INFO - Sending hearing aid settings
2025-12-07 19:27:03,231 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:03,232 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:03,265 - DEBUG - Received PDU: 0b020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:03,265 - DEBUG - Response received: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:03,266 - DEBUG - Read response for handle HEARING_AID: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae47914048e15a409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:03,266 - DEBUG - Sending write request for handle HEARING_AID: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:03,266 - DEBUG - Sent PDU: 122a00020264005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:03,315 - DEBUG - Received PDU: 13
2025-12-07 19:27:03,315 - DEBUG - Response received: 
2025-12-07 19:27:03,316 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:03,316 - INFO - Hearing aid settings sent
2025-12-07 19:27:05,512 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:05,584 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:05,689 - INFO - Sending settings from UI
2025-12-07 19:27:05,689 - DEBUG - HearingAidSettings created: amp=0.85, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:05,690 - INFO - Sending hearing aid settings
2025-12-07 19:27:05,690 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:05,691 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:05,699 - DEBUG - Received PDU: 0b020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:05,699 - DEBUG - Response received: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:05,699 - DEBUG - Read response for handle HEARING_AID: 020260005c8f1e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:05,700 - DEBUG - Sending write request for handle HEARING_AID: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:05,700 - DEBUG - Sent PDU: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:05,734 - DEBUG - Received PDU: 13
2025-12-07 19:27:05,734 - DEBUG - Response received: 
2025-12-07 19:27:05,734 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:05,735 - INFO - Hearing aid settings sent
2025-12-07 19:27:08,647 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:08,754 - INFO - Sending settings from UI
2025-12-07 19:27:08,754 - DEBUG - HearingAidSettings created: amp=0.75, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:08,755 - INFO - Sending hearing aid settings
2025-12-07 19:27:08,755 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:08,756 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:08,879 - DEBUG - Received PDU: 0b0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:08,879 - DEBUG - Response received: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:08,879 - DEBUG - Read response for handle HEARING_AID: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda409a99593f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959409a99593f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:08,879 - DEBUG - Sending write request for handle HEARING_AID: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda400000403f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959400000403f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:08,879 - DEBUG - Sent PDU: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda400000403f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959400000403f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:08,905 - DEBUG - Received PDU: 13
2025-12-07 19:27:08,905 - DEBUG - Response received: 
2025-12-07 19:27:08,905 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:08,905 - INFO - Hearing aid settings sent
2025-12-07 19:27:10,025 - DEBUG - UI value changed, starting debounce
... more debounce logs ...
2025-12-07 19:27:10,149 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:10,254 - INFO - Sending settings from UI
2025-12-07 19:27:10,255 - DEBUG - HearingAidSettings created: amp=-1.0, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:10,255 - INFO - Sending hearing aid settings
2025-12-07 19:27:10,256 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:10,256 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:10,296 - DEBUG - Received PDU: 0b0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda400000403f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959400000403f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,297 - DEBUG - Response received: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda400000403f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959400000403f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,297 - DEBUG - Read response for handle HEARING_AID: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda400000403f52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a9959400000403f52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,297 - DEBUG - Sending write request for handle HEARING_AID: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000080bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000080bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,298 - DEBUG - Sent PDU: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000080bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000080bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,319 - DEBUG - Received PDU: 13
2025-12-07 19:27:10,319 - DEBUG - Response received: 
2025-12-07 19:27:10,319 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:10,320 - INFO - Hearing aid settings sent
2025-12-07 19:27:10,464 - DEBUG - UI value changed, starting debounce
... more debounce logs ...
2025-12-07 19:27:10,521 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:10,616 - INFO - Sending settings from UI
2025-12-07 19:27:10,617 - DEBUG - HearingAidSettings created: amp=-0.5, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:10,618 - INFO - Sending hearing aid settings
2025-12-07 19:27:10,618 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:10,618 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:10,656 - DEBUG - Received PDU: 0b0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000080bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000080bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,657 - DEBUG - Response received: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000080bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000080bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,657 - DEBUG - Read response for handle HEARING_AID: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000080bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000080bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,657 - DEBUG - Sending write request for handle HEARING_AID: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,657 - DEBUG - Sent PDU: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:10,675 - DEBUG - Received PDU: 13
2025-12-07 19:27:10,675 - DEBUG - Response received: 
2025-12-07 19:27:10,676 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:10,676 - INFO - Hearing aid settings sent
2025-12-07 19:27:15,618 - INFO - Closing app
2025-12-07 19:27:15,618 - INFO - Disconnecting from ATT socket
2025-12-07 19:27:15,618 - INFO - Closing socket
2025-12-07 19:27:15,619 - INFO - Stopping notification thread
2025-12-07 19:27:15,694 - INFO - Notification listener thread stopped, trying to reconnect
2025-12-07 19:27:15,694 - INFO - Disconnected from ATT socket

After relaunching the script, I could see the values I had set before. As @ressiwage predicted, I could not hear any difference though.

2025-12-07 19:27:18,887 - INFO - Starting app
2025-12-07 19:27:18,896 - INFO - ATTManager initialized
2025-12-07 19:27:18,896 - INFO - HearingAidConfig initialized
2025-12-07 19:27:18,896 - DEBUG - Initializing UI
2025-12-07 19:27:18,920 - DEBUG - UI initialized
2025-12-07 19:27:18,920 - INFO - Connecting to ATT in UI
2025-12-07 19:27:18,920 - INFO - Attempting to connect to ATT socket
2025-12-07 19:27:18,960 - INFO - Starting notification listener thread
2025-12-07 19:27:18,960 - INFO - Connected to ATT socket
2025-12-07 19:27:18,961 - DEBUG - Sending CCCD write request for handle HEARING_AID: 122b000100
2025-12-07 19:27:18,961 - DEBUG - Sent PDU: 122b000100
2025-12-07 19:27:18,989 - DEBUG - Received PDU: 13
2025-12-07 19:27:18,989 - DEBUG - Response received: 
2025-12-07 19:27:18,990 - DEBUG - CCCD write response received for handle HEARING_AID
2025-12-07 19:27:18,990 - INFO - Enabled notifications for handle HEARING_AID
2025-12-07 19:27:18,990 - DEBUG - Registered listener for handle 42
2025-12-07 19:27:18,990 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:18,990 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:18,997 - DEBUG - Received PDU: 0b0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:18,998 - DEBUG - Response received: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:18,998 - DEBUG - Read response for handle HEARING_AID: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:18,998 - DEBUG - Parsing hearing aid settings from data: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:18,999 - INFO - Parsing hearing aid settings, starting read at offset 4, value: 66
2025-12-07 19:27:18,999 - DEBUG - HearingAidSettings created: amp=-0.5, balance=0.0, tone=-0.6200000047683716, anr=0.6800000071525574, conv=False
2025-12-07 19:27:18,999 - INFO - Parsed settings: amp=-0.5, balance=0.0
2025-12-07 19:27:18,999 - DEBUG - Updating UI with settings
2025-12-07 19:27:19,000 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,000 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,000 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,000 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,002 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,002 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,003 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,003 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,004 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,004 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,004 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,005 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,005 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,005 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,006 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,006 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,006 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,006 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,007 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,007 - DEBUG - UI value changed, starting debounce
2025-12-07 19:27:19,007 - INFO - Initial settings loaded
2025-12-07 19:27:19,108 - INFO - Sending settings from UI
2025-12-07 19:27:19,108 - DEBUG - HearingAidSettings created: amp=-0.5, balance=0.0, tone=-0.62, anr=0.68, conv=False
2025-12-07 19:27:19,108 - INFO - Sending hearing aid settings
2025-12-07 19:27:19,108 - DEBUG - Sending read request for handle HEARING_AID: 0a2a00
2025-12-07 19:27:19,108 - DEBUG - Sent PDU: 0a2a00
2025-12-07 19:27:19,116 - DEBUG - Received PDU: 0b0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:19,116 - DEBUG - Response received: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:19,116 - DEBUG - Read response for handle HEARING_AID: 0202600066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:19,116 - DEBUG - Sending write request for handle HEARING_AID: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:19,116 - DEBUG - Sent PDU: 122a000202640066661e41b81e914185eb5541295ca14100006c41e17ae440cdcc84405c8fda40000000bf52b81ebf000000007b142e3f8fc281411f85a141f6285c41713d024152b8e640f628c440ae4791409a995940000000bf52b81ebf000000007b142e3f0000003f
2025-12-07 19:27:19,166 - DEBUG - Received PDU: 13
2025-12-07 19:27:19,166 - DEBUG - Response received: 
2025-12-07 19:27:19,166 - DEBUG - Write response received for handle HEARING_AID
2025-12-07 19:27:19,166 - INFO - Hearing aid settings sent
2025-12-07 19:27:22,559 - INFO - Closing app
2025-12-07 19:27:22,559 - INFO - Disconnecting from ATT socket
2025-12-07 19:27:22,560 - INFO - Closing socket
2025-12-07 19:27:22,560 - INFO - Stopping notification thread
2025-12-07 19:27:22,579 - INFO - Notification listener thread stopped, trying to reconnect
2025-12-07 19:27:22,580 - INFO - Disconnected from ATT socket

Then I switched the other script to psm = 0x1001 and began sending the second set of commands. I captured the logs, but since they are a bit more verbose and I don't understand what data they contain, I don't know if it's safe to publicly share them.

I sent the first three commands one by one

    00 00 04 00 01 00 02 00 00 00 00 00 00 00 00 00
    04 00 04 00 4d 00 ff 00 00 00 00 00 00 00
    04 00 04 00 0F 00 FF FF FF FF

At this point I heard a chime and I think the airpods switched to a different mode (like transparency perhaps?). The remaining commands did not produce any response at all (neither in the terminal nor in the headphones) except the last one.

> 04 00 04 00 09 00 2C 01 01 00 00
> 04 00 04 00 09 00 33 01 00 00 00
> 04 00 04 00 09 00 2F 01 00 00 00
> 04 00 04 00 09 00 0D 03 00 00 00

After the last command, I heard a different chime, and I think hearing aid mode finally turned on, because I could more clearly hear the background noise coming from the headphones. I can control the amount of noise I hear by using the "amplification" slider in the hearing-aid-adjustments.py script.

Do you know if connecting the airpods to an iphone would disable the hearing aid again? Should I try for science? Do you still need the logs for the second execution of the script? Should I share them here or privately? Thanks for the help!

RBastianini avatar Dec 07 '25 19:12 RBastianini

Congrats, glad we could help. @kavishdevar maybe include this instruction in linux readme? Seems like it is universal.

As regards values that appeared in the app, that happened because of the second command, it sets random hearing aid values.

I think that publishing logs here is safe because your airpods can not connect to network and some packets' purpose isnt even discovered yet. That may reveal mac address but actually it is not really sensitive data. Maybe apple can ping you and explode your iphone to revenge but they can do it without logs too

Pairing it to iphone is safe (95% probability), if something goes wrong you can set freqs again, now you are able to do it without tambourine dances, also enabling/disabling HA should work from the librepods linux app.

ressiwage avatar Dec 07 '25 19:12 ressiwage

thank you, @ressiwage! I have reset my AirPods and tried reproducing the same problem, but it seems it works with the windows script running on Linux. I have no idea why the settings don't stick initially, and why they do after sending seemingly unrelated commands.

@RBastianini btw, the Hearing Aid is only active in transparency mode, the last command you sent was to switch to that.

Do you know if connecting the airpods to an iphone would disable the hearing aid again?

Nope it won't be disabled. And, you can control the amplification too.

Also, the script in #333 is supposed to send the exact same data as manually sent. Could someone please test it out on linux? I've modified it to run on Linux too (either via bumble or bluez)

Do you still need the logs for the second execution of the script? Should I share them here or privately?

I don't think need the logs now that it is working. Thanks!

kavishdevar avatar Dec 08 '25 09:12 kavishdevar