Giter Site home page Giter Site logo

plutoberth / sonyheadphonesclient Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 81.0 2.81 MB

A {Windows, macOS, Linux} client recreating the functionality of the Sony Headphones app

License: MIT License

C++ 98.02% C 0.02% Python 0.06% Objective-C 0.13% Objective-C++ 1.35% CMake 0.42%
bluetooth cpp dear-imgui gui imgui linux macos reverse-engineering windows

sonyheadphonesclient's People

Contributors

andro2157 avatar guilhermealbm avatar jimzrt avatar mr-m33533k5 avatar plutoberth avatar professionalmoment avatar semvis123 avatar stunkymonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonyheadphonesclient's Issues

Proper icons for the macOS version

Currently the macOS version uses 'placeholder' icons for the statusbar button. It would be great if there were proper icons (that work on macOS 10.10 and higher) for the statusbar button/toggle.

Adding EQ Functionality

The only thing I've used the Sony Connect app on my phone was for the EQ. I have multiple sets of headphones because I use to do music production, so sound is quite important to me. I've set the EQ on my app, but the settings don't propagate on my laptop and PC. So....will EQ support be added? It would be greatly appreciated

WH-1000XM2 support

Not sure how similar the protocol will be compare to M3 but I guess they will be similar.

Hide macOS dock icon

Hi!
I've managed to hide the dock icon, while keeping the menu bar. For me, the dock icon doesn't make much sense, cause the best thing about the macOS app is the quick toggle between noise cancelling and ambient mode.
I have little experience with native Objective-C, but managed to hide the dock icon using following modifications:

  • in info.plist added LSUIElement String 1
  • in AppDelegate.mm added
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
    //new
    [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
    [NSApp setPresentationOptions:NSApplicationPresentationDefault];
    [NSMenu setMenuBarVisible:NO];
    [NSMenu setMenuBarVisible:YES];
    // end
    if (flag) {
        return NO;
    }
    else {
        [_window makeKeyAndOrderFront:self];
        return YES;
    }
}

Maybe we can manage the settings via menu bar?

File not executable on Linux by default

Documentation on running on Linux

Great work! But, for some people on Linux, documentation for running the script could be better because file is not allowed to be executable by default. Pls add (chmod -x [build-file] to README).

Headset Reports

Please post your experiences with the software here.

Headset:
Client version:
OS:
Description:

WH-1000-XM5 Support

Would it be possible to add support for the XM5, at the moment it's unable to connect and this tool is literally the lifeline for using Sony headphones on a PC.

Minimized 100% CPU

What happens?
When the app is minimized, it consumes entire CPU core. Looks like some UI check without a timer - when in foreground or overlayed by another window, everything is fine

How to reproduce

  1. Start app
  2. Minimize it
  3. Observe one core fully occupied in Task Manager

What should happen
Minimizing shouldn't affect CPU usage

Version
Headphones Client: v.1.0.2, Aug 20 Release
OS: Windows 10 20H2, latest stable

Add CascadiaCode font

Figure out how to include the font correctly so that it'd work regardless of the current working dir when opening the program. See CrossPlatformGUI::CrossPlatformGUI.

WF-1000XM4 - Couldn't connect (10049)

Headset: WF-1000XM4
Client version: v1.2
OS: Windows 11
Description: Can't connect
Errors: Couldn't connect: 10049

Any chance TWS earbuds like the WF-1000XM4 can be supported?

WH-1000XM4 support

Opening this issue to gauge interest for WH-1000XM4 support. I own this model and would love to be able to use this client with it. I have zero experience in C++, but I'm happy to test and provide logs for anyone who might choose to tackle this. I should be able to run either the Mac or Windows version (via Bootcamp).

FWIW it seems the app in its current state is close to being able to support the XM4s. Here are my results when attempting to use it with my pair:
Note: tested using the macOS build from @semvis123 on Mojave

1. Start app
success

2. Select 'Connect to Bluetooth Device' and choose WH-1000XM4
connection success

3. Use the slider to change Ambient Sound Level
ambient sound successfully changed

4. Make another change to either Ambient Sound or the Focus on Voice option
app crashes

The app doesn't crash for me when the only action is connecting/disconnecting the bluetooth device.

Arch - could not connect to bluetooth socket

Running Arch here, got past the glew 2.1 errors originally and now the application runs fine as expected but when I select WF-1000XM4 I receive "Could not connect to bluetooth socket"

Bluez-git 5.60
bluetooth-support 1-3
bluez-qt 5.84

image

Tried a few things but can't seem to get past this point but no luck, suggestions?

[macOS] Catch exceptions that happen in the bluetooth thread, for example when rfcomm channel can't be opened

Currently it fails to catch the error that happen when it connects for example.
This is because the connection happens in a different thread, when the recoverableException is thrown from that thread, it doesn't get catched and thus crashes the client.

This could be solved by passing an error handler to the bluetoothConnector, but I can't get that to work.
My approach was to have a void that gets defined in MacOSBluetoothConnector::MacOSBluetoothConnector, but that gives an error at compilation: Reference to non-static member function must be called .

Used code:

// macosbluetoothconnector.mm
MacOSBluetoothConnector::MacOSBluetoothConnector(void (&errorCallback)(RecoverableException))
{
    this->errorHandler = errorCallback;
}
// macosbluetoothconnector.h
private:
    void *rfcommDevice;
    void *rfcommchannel;
    std::thread* uthread = NULL;
    void errorHandler(RecoverableException);

Manjaro Support

Hi, while trying to run the tool I get the error
./SonyHeadphonesClient: error while loading shared libraries: libGLEW.so.2.1: cannot open shared object file: No such file or directory
even though I have the shared library installed.
I am running on Manjaro Linux.

How can I get it to work?

Qt Deployment

We need to figure out a way to deploy the Qt version (in branch qt-staging) properly, allowing users to download and run the app out of the box. Might need a deb or a Windows installer.

Add Mic Mute

I don't now if this is possible, but it would be nice if we can mute the mic!

Very nice work, thanks for this component.

Wind Noise Control applies incorrectly on WF-1000XM3

Headset: WF-1000XM3
Client version: 1.2
OS: Ubuntu 21.04
Description:

Headset was recognized. Ambient sound control switch works, but takes about ~ 2 seconds to come into effect. Switching from 0 (ANC) to 1 (wind noise control) doesn't apply the change, but switching from 0 to another value above 1 and back to 1 applies (wind noise control).

Linux support

Please react to this issue if you want Linux support

CMake Error at CMakeLists.txt:8

Hi guys, I try to install your project, but I have this error:

09:06 ➜ cmake ..
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (DBUS) does
not match the name of the calling package (DBus). This can lead to
linux/FindDBus.cmake:59 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:60 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found DBUS: /usr/include/dbus-1.0;/usr/lib/x86_64-linux-gnu/dbus-1.0/include
-- Found GLEW: /usr/include (found version "2.2.0")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Configuring done
CMake Error at CMakeLists.txt:8 (add_executable):
Cannot find source file:

imgui/imgui.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

I am using Ubuntu 22.04.1 LTS

No luck on WH-XB900N, macOS

Headset: WH-XB900N
Client version: v1.3
OS: macOS Monterey v12.3.1
Description: App doesn't work.

Specifically: Successfully connect headphones to laptop via bluetooth. Launch SonyHeadphonesClient. Click "Connect to Bluetooth Device" (had to grant permission the first time -- did so). Select headphones from list. "Enable Ambient Sound Control" is already ticked, try to move the slider and the app beachballs and does not recover :(

This is on a Macbook Air early 2015.

Better error reporting

In many cases, the application will output an uninformative error and crash. In some cases, such as a device disconnection, it's possible to handle it gracefully and just disconnect the headphones from the UI.

Windows 11 (win64.exe)

Hi,

I have WH1000XM5 headphones, i tried to connect but i always get the same WSA error.

Here is the screen with the issue.
image

Is something block to connect to headphones or it is just the problem that this soft doesn't work with WH1000XM5?

Headset Report

Headset: WH1000XM5
Client Version: v1.3.1
OS: Windows 11
Description: Couldn't connect, error 10049 even after restart.

[Feature Request] Volume Control

The Sony Wf-1000xm3 do not support volume control on Linux. It would be great if the Bluetooth commands for it could be reverse engineered.

Add required pacakges

Many users in #29 had to install additional packages to run the app. Figure out the required packages for more popular distros and add that to the README.

Not working on macOS Monterey

It freezes on macOS Monterey when it waits for the response data, it never receives anything.
The receive data method in the IOBluetoothRFCOMMChannelDelegate doesn't seem to get called.
It's probably caused by a bug in Monterey.

WF-1000XM4 support (Mac)

Hi, tried connecting to my WF-1000XM4's from the Mac app. App crashes. I also have an android phone with Sony's headphone app.
Please let me know if there is some logs / script I can provide / run to help reverse engineer the device communication protocol.
Kind regards

Compiling issues with GCC 11.1.0 on Arch Linux (GLEW 2.2, Gnome, Wayland)

Hi, I'm having trouble compiling this package.

I cannot use the precompiled release, as Arch is on GLEW 2.2, and I'm using Wayland (which requires GLEW to be compiled with some options), so simply downloading an old version is not that straight forward.

So I'm trying now to compile from source and I'm getting the following log.

[dries@DriesPC build]$ cmake  ..
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3") 
CMake Warning (dev) at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (DBUS) does
  not match the name of the calling package (DBus).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  linux/FindDBus.cmake:59 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:58 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found DBUS: /usr/include/dbus-1.0;/usr/lib/dbus-1.0/include  
-- Found GLEW: /usr/include (found version "2.2.0") 
-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dries/Projects/SonyHeadphonesClient/Client/build
[dries@DriesPC build]$ cmake --build .
[  5%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/BluetoothWrapper.cpp.o
[ 11%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/ByteMagic.cpp.o
[ 17%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/CommandSerializer.cpp.o
[ 23%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/TimedMessageQueue.cpp.o
[ 29%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/CrossPlatformGUI.cpp.o
In file included from /home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.h:10,
                 from /home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:1:
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:15:33: error: expected unqualified-id before ‘)’ token
   15 |         SingleInstanceFuture<T>() = default;
      |                                 ^
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:48: error: invalid declarator before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                                ^~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:47: error: expected ‘)’ before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                ~              ^~~~~~
      |                                               )
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: error: no declaration matches ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
   48 | inline SingleInstanceFuture<T>::SingleInstanceFuture(std::future<T> other) : std::future<T>(std::move(other)) {}
      |        ^~~~~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: note: no functions named ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:12:7: note: ‘class SingleInstanceFuture<T>’ defined here
   12 | class SingleInstanceFuture : public std::future<T>
      |       ^~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = void]’:
/home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:112:40:   required from here
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<void>&’ to an rvalue of type ‘std::future<void>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = void]’
   51 | inline SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                                   ~~~~~~~~~~~~~~~~^~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:146:48:   required from here
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | inline SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                                   ~~~~~~~~~~~~~~~~^~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawASMControls()::<lambda()>; Args = {}; T = int]’:
/home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:223:41:   required from here
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<int>&’ to an rvalue of type ‘std::future<int>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = int]’
   51 | inline SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                                   ~~~~~~~~~~~~~~~~^~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::CrossPlatformGUI(BluetoothWrapper)::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/home/dries/Projects/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:245:44:   required from here
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dries/Projects/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | inline SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                                   ~~~~~~~~~~~~~~~~^~~~~
make[2]: *** [CMakeFiles/SonyHeadphonesClient.dir/build.make:132: CMakeFiles/SonyHeadphonesClient.dir/CrossPlatformGUI.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/SonyHeadphonesClient.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
[dries@DriesPC build]$ 

WF-XB700 - Couldn't connect (10049)

Hi,

Im trying to conect my sony wf-xb700, because they are cutting the sound in windows.
i tried you app but gives me this error

image
"Couldn´t connect : 10049"

Can you help me understand if this app doent work for my earbuds

macOS Support

Please react to this issue if you want macOS support

Custom Voicepacks

Hi,

first of all: great work, I love this project.

Secondly: Would it be possible to support custom voice packs?
You can change the language in the app and the new sound files are then uploaded to the headphones.
Could we mimic this process and provide our own files?

The primary reason for me would be a shorter startup time (Why bother me with a "power - on", I would just use a very short empty file here cause I'm always late and every second counts ;) ) and shorter breaks in a meeting (I know I can completely turn off the output, but for know I don't know the battery state then).

Did you record the data from the bluetooth connection to reverse engineer this protocol?
Can you give hints on how to start?
Do you think there is the risk of bricking the device?

building on aarch64 does not work

I am the package-maintainer of the nix-package. But currently it does not build on aarch64 out of the box.
I am currently getting this issue:

building
build flags: -j2 SHELL=/nix/store/99bgmihz5ybclg11h00nm9lgqmsfhp4p-bash-5.1-p16/bin/bash
[ 11%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/ByteMagic.cpp.o
[ 11%] Building CXX object CMakeFiles/SonyHeadphonesClient.dir/BluetoothWrapper.cpp.o
In file included from /build/source/Client/CommandSerializer.h:2,
                 from /build/source/Client/BluetoothWrapper.h:4,
                 from /build/source/Client/BluetoothWrapper.cpp:1:
/build/source/Client/Constants.h:110:18: error: enumerator value '-1' is outside the range of underlying type 'char'
  110 |  OUT_OF_RANGE = -1
      |                  ^
/build/source/Client/Constants.h:129:18: error: enumerator value '-1' is outside the range of underlying type 'char'
  129 |  OUT_OF_RANGE = -1
      |                  ^
In file included from /build/source/Client/ByteMagic.h:9,
                 from /build/source/Client/ByteMagic.cpp:1:
/build/source/Client/Constants.h:110:18: error: enumerator value '-1' is outside the range of underlying type 'char'
  110 |  OUT_OF_RANGE = -1
      |                  ^
/build/source/Client/Constants.h:129:18: error: enumerator value '-1' is outside the range of underlying type 'char'
  129 |  OUT_OF_RANGE = -1
      |                  ^
make[2]: *** [CMakeFiles/SonyHeadphonesClient.dir/build.make:90: CMakeFiles/SonyHeadphonesClient.dir/ByteMagic.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/SonyHeadphonesClient.dir/build.make:76: CMakeFiles/SonyHeadphonesClient.dir/BluetoothWrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/SonyHeadphonesClient.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

for version 1.2 I did remove the line containing UNKNOWN = -1. For the newer version OUT_OF_RANGE appeard as well. So I am suggesting in fixing this bug upstream, then patching it all the times.

I would be happy to have a proper fix. Maybe setting it to the maximum would result in the same behavior?

Add keyboard shortcuts

The program works very well, it would be nice if you add a shortcut with the new update

Switch between Stereo / Hands-Free mode

Sony 1000WH4 can work in 2 modes:

  • hands-free - poor sound quality, mic works
  • stereo - good sound quality, mic doesn't work

I would like to be able to easily switch between these, as I both listen to music and sometimes use HF for online meetings.

Is there a switch implemented in this client?

If no, I would like to contribute and implement it.

Remap the NC/AMBIENT button

Hello - thank you for the great project.

I came looking for an app like this because my WH-1000XM3 seemingly randomly changed the function of the NC/AMBIENT button from the very useful "switch between noise canceling-levels" to the useless recording that says "the google assistant is not connected". According to this article: https://helpguide.sony.net/mdr/wh1000xm3/v1/en/contents/TP0001703075.html I can change that back with the Sony App, but because of Sonys history of installing rootkits on their customers' computers and/or forcefully taking away features and making products worse with forced firmware upgrades installing the official app is not an option for me.

The adjustment of noise-cancelling works well on my WH-1000XM3 with this app, but if you could add the ability to remap the NC/AMBIENT button from the "Google Assistant is not connected"-recording back to adjusting the noise-cancelling levels that would be AMAZING!

Thank you very much in advance

Qt - macOS

The Qt version (branch qt) currently doesn't compile on macOS. Technically this isn't Qt's fault, it's just that previously CMake wasn't used so it doesn't link IOBluetooth (and maybe other things 🤡) properly

github action for macOS

I set up Actions for Linux and Windows so that we have automatic builds on all platforms :)

Sadly, I'm not sure how to do it for mac and I don't have a local env to test stuff anyway. Any chance you could help on this, @semvis123 ?

Enable/Disable Quality Mode?

As the title says, any way for to switch quality/stable mode?

WH-1000XM2/XM3 does not support equalizer with LDAC, which is quite sad since you lose Clear Bass at phone.

When you connect it back to PC, you likely don't want to use SBC or similar.

Sony design for this is quite ****** since they enable/disable Bluetooth codecs from headphones to ensure devices won't use high quality ones in case you require simpler codecs.

compilation errors on Ubuntu 22.04

I am getting a couple of compiler (GNU 11.2.0) errors:

In file included from /tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.h:10,
                 from /tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:1:
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:15:33: error: expected unqualified-id before ‘)’ token
   15 |         SingleInstanceFuture<T>() = default;
      |                                 ^
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:48: error: invalid declarator before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                                ^~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:21:47: error: expected ‘)’ before ‘other’
   21 |         SingleInstanceFuture<T>(std::future<T> other);
      |                                ~              ^~~~~~
      |                                               )
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: error: no declaration matches ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
   48 | inline SingleInstanceFuture<T>::SingleInstanceFuture(std::future<T> other) : std::future<T>(std::move(other)) {}
      |        ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:48:8: note: no functions named ‘SingleInstanceFuture<T>::SingleInstanceFuture(std::future<_Res>)’
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:12:7: note: ‘class SingleInstanceFuture<T>’ defined here
   12 | class SingleInstanceFuture : public std::future<T>
      |       ^~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = void]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:112:40:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<void>&’ to an rvalue of type ‘std::future<void>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = void]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawDeviceDiscovery()::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:146:48:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::_drawASMControls()::<lambda()>; Args = {}; T = int]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:223:41:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<int>&’ to an rvalue of type ‘std::future<int>’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = int]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h: In instantiation of ‘void SingleInstanceFuture<T>::setFromAsync(Func, Args&& ...) [with Func = CrossPlatformGUI::CrossPlatformGUI(BluetoothWrapper)::<lambda()>; Args = {}; T = std::vector<BluetoothDevice>]’:
/tmp/SonyHeadphonesClient/Client/CrossPlatformGUI.cpp:245:44:   required from here
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:33:15: error: cannot bind non-const lvalue reference of type ‘std::future<std::vector<BluetoothDevice> >&’ to an rvalue of type ‘std::future<std::vector<BluetoothDevice> >’
   33 |         *this = std::async(std::launch::async, func, std::forward<Args>(args)...);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SonyHeadphonesClient/Client/SingleInstanceFuture.h:51:83: note:   initializing argument 1 of ‘SingleInstanceFuture<T> SingleInstanceFuture<T>::operator=(std::future<_Res>&) [with T = std::vector<BluetoothDevice>]’
   51 | anceFuture<T> SingleInstanceFuture<T>::operator=(std::future<T>& other)
      |                                                  ~~~~~~~~~~~~~~~~^~~~~

Option to turn off NC and ambient sound

Really like the program, but I don't see any option to turn off both NC and ambient sound. It's useful if you want to save battery on the headphones. In the Android app, you can do this by turning off the "Ambient Sound Control" toggle.

nc_asm_off

WH-1000XM2 works

Just tested, WH-1000XM2 works, no issues.

Thank you!

Edit for clarity:
Tested on Linux.
Ambient sound control, voice focus works well, just like in the gif.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.