-
Notifications
You must be signed in to change notification settings - Fork 87
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 MacOS native gui version #19
Conversation
Gui is working and semi disabled because the bleutooth connector isn't working.
this is used because it won't open the channel if the channel is opened before on the same connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm aware that you're not done with this yet, but I just thought to provide some comments. Thanks for working on this PR!
Setup of window happens in the main.mm file.
I'm having some trouble writing the recv function, I thought something like this should work:
But it doesn't, when I print the receivedlength variable it gives 6, although the expected byte length is 2048 (right?). *edit readability |
I changed the receive function once again, this time I am receiving correct data, at least I was - now I am getting negative numbers, for example: But I got another problem, when I block the receive function ( |
For me it looks like a lot of those problems are caused by the async stuff adding complications. The sync APIs are always simpler, and I think that they will solve a lot of our problems (especially things like unneeded blocking). The response that you got (with the 62) looks OK, but you didn't catch the end (indicated by the end marker, 62). I don't like the threaded logic, like in recv with the promises and receivedBytes. It isn't clean and it might've caused the previous issues. It's kinda difficult for me to test this myself, since I don't have a Mac, but I can try to dive into the docs for P.S. In general, if you need to add something like
in multi-threaded code, there's always a better way to do it. |
Just want to say I compiled this macOS client and gave it a try. I know this is a WIP and while couldn't actually get it to work, it's very promising! Thanks for making this @semvis123. After connecting my headphones over bluetooth they would then showed up in the app instantly. I'd connect, but then the app hangs when I tried to change ambient sound settings. Also when the headphones were connected to my mac and my phone at the same time, with the phone as secondary, I could see that the phone's connection would instantly disappear when I pressed the connect button in this app. So it definitely was succeeding at connecting at some level. But now weirdly after doing this a few times I've somehow gotten into a state that whenever I press the connect button I get a crash. Unclear what changed. Here's an abbreviated crash report if that's helpful. Looks like something GUI related? 🤷♂️
No idea if this is helpful at this stage or not. If it's just noise, feel free to ignore. Cheers! |
I have been busy lately so haven't made much progress. About the state in which the app will crash immediately after connect button is pressed. I don't know if I had any issues like that but what I do know is that if stuff acts weirdly, powering off and on your headphones can help. Btw you might have noticed that the app can take quite some resources on macOS, this is likely because it uses imgui, I will try to make a native ui version as well. |
Native non functional ui, the connect button could use the native bluetooth device selector.
|
The photo looks awesome, but is this implemented not using Dear Imgui? Additionally, it's never recommended to post code in a zip file. Just push the changes to your branch so everyone could see them here - much easier to collaborate this way. |
@Plutoberth This is indeed without dear imgui, instead I use a storyboard using Xcode, because I don't think that it's possible to create a native feeling/looking ui using dear imgui. Also I posted a zip file because those changes are a draft version specifically for Bluetooth, but I could maybe create a second branch, thanks for your advice. |
@semvis123 okay. Ideally I prefer to use as little platform specific code as possible, but since this is a toy project whatever works for you is good. Putting it in a second branch and even a draft PR is okay for even very WIP versions :) |
Got the receive function partly working now, it only crashes after a few times🤔 |
What's the cause of the crash? |
@Plutoberth EXC_BAD_ACCESS / segmentation fault. (Currently line 145 of MacOSBluetoothConnector.mm) Could be that I understand the purpose of the function incorrectly, the function currently is supposed to wait until there is enough new data received based on length, is this correct or should it return as soon as it receives new data?(2048 bytes of data seems much to me, especially because it only seems to receive 32 bytes at a time right?) It currently receives ±4 times and after that forth time it fails to check if it needs more data. |
Great🎉 |
Originally I created some application icon (basically a hand-drawn version of the Sony Headphones app), but decided not to use it because I didn't want to get a C&D from Sony (because it seems like the kind of company that would do that). If you want to create something yourself - go ahead. About the donations - seeing as I reversed the app, created the original version, review PRs, etc, I think that it's fair that all donations go to me. I'm not expecting to get a significant sum from this, if anything; If I get over $100 over the lifetime of the project, which is exceedingly unlikely IMO, I'll work something out so that contributors get their fair share. Otherwise it's just not worth the time. |
Hmm I'm not very great at creating icons, and without icon would also be fine. We can just skip the icon.
Yeah that's totally fair in my opinion, I was just joking :) *edit oops wrong button 🤣 |
OK. So I'll wait until varenc confirms that it works and then I'll merge it and create a new release. |
😄Just tested the macOS version. Native GUI version:
<key>NSPrincipalClass</key>
<string>NSApplication</string> Otherwise this error occurs when trying to run it:
imGui version:Make these changes to
After these changes, both version compiles and functions correctly. 🎉Everything, including Focus on Voice, works. (ps. My bluetooth keyboard also showed up in the device list of the imGui version, I'm not sure if it's supposed to happen or not.) |
Thanks for testing👍
Didn't came across this one, but should be fixed now.
This project still uses an older version of imgui where there is no
This is expected behavior, but I could change it to filter on |
Thanks for all the work, the mac client looks promising! I tried to increasing ambient sound level and focus on voice but could not get it to work. The following messages might be relevant for debugging:
|
@whazor interesting, have you tried leaving the device selector menu open for ~30 seconds, you will find a pop-up asking for Bluetooth permission. Please take a look at this link: The problem doesn't seem to be caused by the client itself, but it looks like a general problem. |
Resetting the Bluetooth indeed worked. Thanks! |
Looks like I forgot to upload the newest compiled version (the one that is also compatible with older macOS versions). |
* improved isconnected function, it now also checks if the channel is open * fixed the timeout in the connect - statusbar button added - when pressed it changes between ambient sound and noise cancelling - still uses placeholder images (couldn't find great ones that are available on older macos versions)
Hmm that's weird, I don't have a wh-1000-xm4 to test it, but could you send the logs by opening the executable within the terminal. |
Here you go: SonyHeadphonesClient\ 2.app/Contents/MacOS/SonyHeadphonesClient ; exit; [Process completed] |
Hi again, I'm going to make some changes to the master branch today (probably), including merging the Linux version. I'll notify you when that happens, and then could you re-test everything works and recompile? After that I'll (finally haha) merge and create a new release. It's just very problematic for me to make changes on the macOS version, so I wanna get a few out of the way right now. P.S. The statusbar feature is very cool! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up only making changes to the windows specific parts, so I think that we can go ahead and merge this now. LMK if it's OK by you.
Also, you can open an issue to create proper icons for the statusbar - someone might step up. |
Did some little improvements and cleanup, merging should be okay now👍 |
Merging. Closes #6. Thanks for your help!! |
Gui is working and semi disabled because the bluetooth connector isn't working.