Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added various features for WH-1000XM4 #103

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

aybruh00
Copy link

@aybruh00 aybruh00 commented Sep 8, 2023

Added

  • Speak To Chat
  • ANC Optimizer
  • Multi point connection
  • framework to read and parse messages

@aybruh00 aybruh00 marked this pull request as draft September 9, 2023 07:09
@aybruh00
Copy link
Author

aybruh00 commented Sep 9, 2023

Sometimes the headphones do not send ACK packet for a sent command. I am not sure why this is happening. Can someone else try some tests and change things?

@aybruh00 aybruh00 marked this pull request as ready for review September 14, 2023 08:05
@aybruh00
Copy link
Author

Works flawlessly for me now

@dogtopus
Copy link

It's almost impossible for me to connect to the headphone with this patch. The program will just stuck at "sending command" most of the time. Though on the rare occasion where it did connect it seems to work completely fine.

@SerialVelocity
Copy link

Hey @aybruh00, unrelated to this PR but I'm hoping you know from working on this, do you know if it is possible to extract the serial number of the device using code similar to this? Unfortunately, the serial number on the bottom of the charging case has been scratched so it is no longer readable and I need it for a repair.

@aybruh00
Copy link
Author

@dogtopus Can you connect using the main published branch? What about when you send a command, does it fulfill or get stuck?

@dogtopus
Copy link

master branch connects but doesn't work (all buttons do nothing and there's also the "sending command" indicator under the app).

When it connects, everything works just fine and nothing got stuck. But when it doesn't connect, the "sending command" is spinning forever and the UI won't load except the optimize button (which also does nothing in this state).

@aybruh00
Copy link
Author

@dogtopus I meant using the code not of this PR. Can you connect and control anything using the released version? If so, would it be possible for you to send me bluetooth packet logs using wireshark of both cases (using this PR and not using this PR)? I tested the app on another system and saw some weird results. On my main system the app works perfect. But on the second system it gets stuck on “sending command”. But in my case it happens very infrequently and when I am not using wireshark sniffing, so I haven’t been able to capture and understand the issues.

@aybruh00 aybruh00 marked this pull request as draft November 18, 2023 03:53
@dogtopus
Copy link

I'm not sure what you meant by released version. If you mean the latest stable release, I already tested master which is just slightly newer than latest release and I don't think anything related to WH-1000XM4 was changed in those commits after the release.

I think I did a capture at some point but it was lost. I can find some time to redo it.

@aybruh00
Copy link
Author

Yes, I meant the stable release. I wanted you to check if you can send commands consistently. You could try the ASM/NC commands as I just want to understand what makes the 1000XM4 sometimes not respond.

When I tried it, I could send commands but they would have no effect (around 12 to 15 seconds between two consecutive successful commands, otherwise it would the headset just doesn't get affected by the commands). This happens because in the release version the application just sends the command and does not check if the command was successful. The code I have written waits for a response and checks for success.

What is noticed is sometimes the headset just ignores the command, but I could not find a pattern to it. I also recently found out from SerialVelocity above that his headset does not have the UUID that we use in this application. Although he was sending his for repairs so it might be due to some issue, I believe that some headsets use a different UUID than what is hard-coded in the application. If you could, I would like you to also test the app with each UUID available with your headset and see if some works. (I also think this could be the reason because some other earphones use different UUIDs in the official app as well, so this could very well be the case).
The most likely UUID would be 956c7b26-d49a-4ba8-b03f-b17d393cb6e2.

@progandy
Copy link

progandy commented Dec 9, 2023

@aybruh00 SerialVelocity might have had the in-ear WF-1000XM4 which use another version of the protocol, gadgetbridge has some code for it already: https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/2925

I guess you should at least be able to use it to create a protocol description, even if gadgetbridge is agpl and this client is MIT.

@aybruh00
Copy link
Author

aybruh00 commented Dec 9, 2023

@progandy I don't really understand licenses, but I also own WF-C500 (in-ear), which also uses the alternate protocol version and was able to solve it. But yeah, it hadn't hit me that that might be the case.

@Plutoberth
Copy link
Owner

Is this ready for review?

@aybruh00 aybruh00 marked this pull request as ready for review April 26, 2024 13:45
@NicoWeio
Copy link

NicoWeio commented Jun 9, 2024

I'm not sure if an e-mail is generated in this case, so:

@Plutoberth, it's (apparently) ready for review now. :)

@Plutoberth
Copy link
Owner

Will take a look tomorrow

@stadeleon
Copy link

stadeleon commented Aug 1, 2024

Hello Guys!
Thanks a lot for you doing the job of such a big company that don't respect their users.

And my question is: does your update will allow this application to work with WH-1000XM5 on MacOs?
if no - what can i provide you to help with developing update for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants