Git Product home page Git Product logo

soundcoremanager's Introduction

Tauri

A desktop companion app for your Soundcore devices


Github Actions Donate

Features

  • See charging status and battery level
  • Set ANC Modes
  • Adjust EQ

Installing

Supported Devices - Mostly Tested

Model ID Name
A3951 Liberty Air 2 Pro
A3027 Life Q35
A3028 Life Q30
A3029 Life Tune
A3935 Life A2 NC

Planned Support - Need testers

Model ID Name
A3040 Space Q45
A3025 Life Q20
A3033 Live 2 Neo
A3931 Life Dot 2
A3992 Soundcore A3i
A3993 Soundcore P3i

Build Instructions

Requirements

  • Rust
  • Yarn/Node

Install deps

yarn

To run in debug mode

yarn tauri dev

To build and create an installer

yarn tauri build

soundcoremanager's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar gmallios 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

soundcoremanager's Issues

Use iterators for parsing responses

The current way of parsing can cause panics since it is able to index out of bounds and is not idiomatic. A small refactor should be done to use iterators

Device Simulator

Using pybluez we can write a rfcomm server to emulate a device and interact with it using the official app, thus allowing us to see what gets sent to the device and what responses map to.

A small test as a PoC was done using ubuntu and pybluez's rfcomm-server example and changing the broadcast name to Soundcore Space Q45. On Windows that didn't work because the device wouldn't connect (maybe a usb dongle problem).

Life Q30(A3028)/Life Tune (A3029) Support

Current status of Life Q30(A3028)/Life Tune (A3029) support

  • Connection
  • Fetch device status
  • ANC
    • Remove/Don't use non-supported profiles
    • Check if the commands are the same as A3951 (Should be)
  • EQ
  • UI
    • OverviewCard
    • ANCModeCard - Remove Custom option and Transparent sub-options
  • Response Checksum Validation - Need to figure out propper response length
    • DeviceStatus Reponse Length
    • DeviceInfo Response Length

Life Q35 Support

Current status of Life Q35/A3027 support

  • Connection
  • Fetch device status
  • ANC
    • Remove/Don't use non-supported profiles
    • Check if the Transparency Option uses the same command as A3951
  • EQ
  • UI
    • OverviewCard
    • ANCModeCard - Remove Custom option and Transparent sub-options
  • Response Checksum Validation - Need to figure out propper response length
    • DeviceStatus Reponse Length
    • DeviceInfo Response Length

Cannot move EQ Sliders. Windows 10

Cannot move EQ sliders at all in Windows 10. Tested using Liberty Air 2 Pro's and Souncore Life Q30. EQ had different appearance with each device. This is my first report on Github so forgive me if I am doing this wrong.

souncore1
souncore2

Soundcore Space Q45/A3040 Support

Current status of Soundcore Space Q45 (A3040) support:

  • Connection
  • Fetch device status
  • ANC
  • EQ
  • UI - No custom UI atm / icons are added to current components
  • Response Checksum Validation

Wireshark logs along with a description are much needed!

Life A2 NC (A3935) Support

Current status of Life A2 NC (A3935) support

  • Connection
  • Fetch device status
  • ANC
    • Check if the commands are the same as A3951 (Should be)
  • EQ
  • UI
    • OverviewCard
  • Response Checksum Validation - Need to figure out propper response length
    • DeviceStatus Reponse Length
    • DeviceInfo Response Length

Soundcore A3i (A3992) Support

Current status of Soundcore A3i (A3992) support

  • Connection
  • Fetch device status
  • ANC
    • Remove/Don't use non-supported profiles
    • Check if the commands are the same as A3951 (Should be)
  • EQ
  • UI
    • OverviewCard
    • ANCModeCard - Remove Custom option and Transparent sub-options
  • Response Checksum Validation - Need to figure out propper response length
    • DeviceStatus Reponse Length
    • DeviceInfo Response Length

Auto-Update

Implement auto updates using Tauri and Github Actions.

Filter Soundcore Devices

The official Soundcore app uses the Bluetooth name to determine the model id of the device.
These names are prefixed with label_(modelid) in the strings.xml

Tray menu - UI ANC mode sync

Currently, when a user changes an ANC mode through the tray menu the UI doesn't reflect this change. This is not the intended behaviour.

[macOS] Build fails at iobluetooth

Trying to build this on my mac and Im getting this error.
marcinbauer@marcinbauercodiblycom SoundcoreManager-macos-fixes % yarn tauri build yarn run v1.22.19 $ tauri build Running beforeBuildCommand yarn build`
$ tsc && vite build
vite v4.3.1 building for production...
✓ 1107 modules transformed.
dist/index.html 0.40 kB │ gzip: 0.28 kB
dist/assets/a3951_img_device_left-4d0d7088.webp 8.56 kB
dist/assets/a3951_img_device_right_edited-0c3d60b2.webp 8.71 kB
dist/assets/a3040_img_device-877189fe.webp 15.24 kB
dist/assets/a3935_img_device-a77ed0ac.webp 19.28 kB
dist/assets/a3027_img_device-e0d85385.webp 33.85 kB
dist/assets/a3029_img_device-56d22a6c.webp 38.49 kB
dist/assets/a3028_img_device-cdafd53d.webp 46.67 kB
dist/assets/index-c4dd7fee.js 737.05 kB │ gzip: 242.93 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:

  • Using dynamic import() to code-split the application
  • Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    ✓ built in 2.38s
    Compiling iobluetooth v0.1.0 (/Users/marcinbauer/Downloads/SoundcoreManager-macos-fixes/bluetooth-lib/iobluetooth)
    Compiling console v0.15.5
    Compiling tauri-runtime-wry v0.12.3
    Compiling chrono v0.4.23
    Compiling notify-rust v4.5.10
    Compiling encoding_rs v0.8.31
    Compiling tauri-macros v1.2.1
    Compiling rfd v0.10.0
    error: failed to run custom build command for iobluetooth v0.1.0 (/Users/marcinbauer/Downloads/SoundcoreManager-macos-fixes/bluetooth-lib/iobluetooth)

Caused by:
process didn't exit successfully: /Users/marcinbauer/Downloads/SoundcoreManager-macos-fixes/src-tauri/target/release/build/iobluetooth-4556dd54046b94a3/build-script-build (exit status: 101)
--- stdout
cargo:rerun-if-changed=protos/search.proto
cargo:rerun-if-changed=protos

--- stderr
thread 'main' panicked at 'Could not find protoc installation and this build crate cannot proceed without
this knowledge. If protoc is installed and this crate had trouble finding
it, you can set the PROTOC environment variable with the specific path to your
installed protoc binary.You could try running brew install protobuf or downloading it from https://github.com/protocolbuffers/protobuf/releases

For more information: https://docs.rs/prost-build/#sourcing-protoc
', /Users/marcinbauer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-build-0.11.4/src/lib.rs:1296:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Error failed to build app: failed to build app
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Any ideas what can be wrong?

What operating systems does the Windows app support?

Discussed in #140

Originally posted by vernonet August 22, 2023
What operating systems does the Windows app support? Doesn't work for me on win 7 x64. I tried it on two PCs with Windows 7 x64 - the application does not find various libraries (for example, bluetoothapis.dll, etc.). Works fine on win 10.

Soundcore vr p10 support

Current status of Soundcore vr p10 (A3850) support:

  • Connection
  • Fetch device status
  • ANC
  • EQ
  • UI
  • Response Checksum Validation

Soundcore Space A40/A3936 Support

Current status of Soundcore Space A40 (A3936) support:

  • Connection
  • Fetch device status
  • ANC
  • EQ
  • UI
  • Response Checksum Validation

Wireshark logs along with a description are much needed!

It didn't build on mac os

Here is the log

yarn run v1.22.19
$ tauri build
Running beforeBuildCommand yarn build
$ tsc && vite build
vite v3.2.5 building for production...
✓ 1105 modules transformed.
dist/assets/a3027_img_device.e0d85385.webp 33.06 KiB
dist/assets/a3028_img_device.cdafd53d.webp 45.58 KiB
dist/assets/a3029_img_device.56d22a6c.webp 37.58 KiB
dist/assets/a3951_img_device_left.4d0d7088.webp 8.36 KiB
dist/assets/a3951_img_device_right_edited.0c3d60b2.webp 8.51 KiB
dist/assets/a3040_img_device.877189fe.webp 14.88 KiB
dist/assets/a3935_img_device.a77ed0ac.webp 18.83 KiB
dist/index.html 0.39 KiB
dist/assets/index.95be6cc2.js 570.16 KiB / gzip: 185.16 KiB

(!) Some chunks are larger than 500 KiB after minification. Consider:

  • Using dynamic import() to code-split the application

  • Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks

  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    warning: unused import: PathBuf
    --> build.rs:3:18
    |
    3 | path::{Path, PathBuf},
    | ^^^^^^^
    |
    = note: #[warn(unused_imports)] on by default

    Compiling bluetooth-lib v0.1.0 (/Users/amr/tools/SoundcoreManager/bluetooth-lib)
    warning: soundcoremanager (build script) generated 1 warning
    Compiling soundcoremanager v0.1.1 (/Users/amr/tools/SoundcoreManager/src-tauri)
    error[E0433]: failed to resolve: use of undeclared crate or module windows
    --> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/error.rs:27:17
    |
    27 | source: windows::core::Error,
    | ^^^^^^^ use of undeclared crate or module windows

warning: unused imports: RefCell, Ref, sync::Arc
--> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/macos/rfcomm.rs:3:12
|
3 | cell::{Ref, RefCell},
| ^^^ ^^^^^^^
4 | sync::Arc,
| ^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: unused imports: Handle, Runtime
--> /Users/amr/tools/SoundcoreManager/bluetooth-lib/src/macos/rfcomm.rs:6:22
|
6 | use tokio::runtime::{Handle, Runtime};
| ^^^^^^ ^^^^^^^

For more information about this error, try rustc --explain E0433.
warning: bluetooth-lib (lib) generated 2 warnings
error: could not compile bluetooth-lib due to previous error; 2 warnings emitted
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for soundcoremanager v0.1.1 (/Users/amr/tools/SoundcoreManager/src-tauri)

Caused by:
process didn't exit successfully: /Users/amr/tools/SoundcoreManager/src-tauri/target/release/build/soundcoremanager-7d8a811d0b5bc1b5/build-script-build (exit status: 101)
--- stderr
Compiling iobluetooth v0.1.0 (/Users/amr/tools/SoundcoreManager/bluetooth-lib/iobluetooth)
warning: unused import: objc::runtime::Object
--> src/server.rs:3:5
|
3 | use objc::runtime::Object;
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: unused import: Instant
--> src/inquiry_adapter.rs:3:22
|
3 | time::{Duration, Instant},
| ^^^^^^^

warning: unused imports: NSDate, NSRunLoop
--> src/inquiry_adapter.rs:10:18
|
10 | foundation::{NSDate, NSRunLoop},
| ^^^^^^ ^^^^^^^^^

warning: unused imports: Boolean, CFRunLoopGetCurrent, CFRunLoopRunInMode, CFRunLoopRun, CFRunLoopStop, CFStringCreateWithBytesNoCopy, CFStringRef, CFString, kCFAllocatorDefault, kCFAllocatorNull, kCFStringEncodingUTF8
--> src/inquiry_adapter.rs:13:12
|
13 | base::{kCFAllocatorDefault, kCFAllocatorNull, Boolean},
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^
14 | mach_port::CFIndex,
15 | runloop::{CFRunLoopGetCurrent, CFRunLoopRun, CFRunLoopRunInMode, CFRunLoopStop},
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
16 | string::{kCFStringEncodingUTF8, CFString, CFStringCreateWithBytesNoCopy, CFStringRef},
| ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^

warning: unused imports: Class, Object
--> src/inquiry_adapter.rs:22:15
|
22 | runtime::{Class, Object},
| ^^^^^ ^^^^^^

warning: unused imports: Receiver, Sender, self
--> src/inquiry_delegate.rs:2:30
|
2 | use futures::channel::mpsc::{self, Receiver, Sender};
| ^^^^ ^^^^^^^^ ^^^^^^

warning: unused import: futures::sink::SinkExt
--> src/inquiry_delegate.rs:3:5
|
3 | use futures::sink::SinkExt;
| ^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: uint32_t, uint8_t
--> src/iobluetoothdevice.rs:4:12
|
4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS};
| ^^^^^^^^ ^^^^^^^

warning: unused import: rc::StrongPtr
--> src/iobluetoothdevice.rs:7:5
|
7 | rc::StrongPtr,
| ^^^^^^^^^^^^^

warning: unused import: IOBluetoothRFCOMMChannel
--> src/iobluetoothdevice.rs:12:37
|
12 | use crate::util::{string_to_string, IOBluetoothRFCOMMChannel, IOReturn};
| ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: BufRead, BufReader, Read, TcpListener, TcpStream, Write
--> src/rfcomm_delegate.rs:2:10
|
2 | io::{BufRead, BufReader, Read, Write},
| ^^^^^^^ ^^^^^^^^^ ^^^^ ^^^^^
3 | net::{TcpListener, TcpStream},
| ^^^^^^^^^^^ ^^^^^^^^^

warning: unused import: Protocol
--> src/rfcomm_delegate.rs:13:30
|
13 | runtime::{Class, Object, Protocol, Sel},
| ^^^^^^^^

warning: unused import: crate::util::IOBluetoothRFCOMMChannel
--> src/rfcomm_delegate.rs:17:5
|
17 | use crate::util::IOBluetoothRFCOMMChannel;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: NSData
--> src/util.rs:5:18
|
5 | foundation::{NSData, NSString},
| ^^^^^^

warning: use of deprecated type alias libc::uint32_t: Use u32 instead.
--> src/iobluetoothdevice.rs:4:12
|
4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS};
| ^^^^^^^^
|
= note: #[warn(deprecated)] on by default

warning: use of deprecated type alias libc::uint8_t: Use u8 instead.
--> src/iobluetoothdevice.rs:4:22
|
4 | use libc::{uint32_t, uint8_t, KERN_SUCCESS};
| ^^^^^^^

error[E0308]: mismatched types
--> src/iobluetoothdevice.rs:84:13
|
81 | pub fn is_paired(&self) -> bool {
| ---- expected bool because of return type
...
84 | is_paired
| ^^^^^^^^^ expected bool, found i8

Expected type did not match the received type.

Erroneous code examples:

fn plus_one(x: i32) -> i32 {
    x + 1
}

plus_one("Not a number");
//       ^^^^^^^^^^^^^^ expected `i32`, found `&str`

if "Not a bool" {
// ^^^^^^^^^^^^ expected `bool`, found `&str`
}

let x: f32 = "Not a float";
//     ---   ^^^^^^^^^^^^^ expected `f32`, found `&str`
//     |
//     expected due to this

This error occurs when an expression was used in a place where the compiler
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
...skipping...
error[E0308]: mismatched types
--> src/iobluetoothdevice.rs:91:13
|
88 | pub fn is_connected(&self) -> bool {
| ---- expected bool because of return type
...
91 | is_connected
| ^^^^^^^^^^^^ expected bool, found i8

error[E0308]: mismatched types
--> src/util.rs:146:13
|
143 | pub fn is_open(&self) -> bool {
| ---- expected bool because of return type
...
146 | is_open
| ^^^^^^^ expected bool, found i8

For more information about this error, try rustc --explain E0308.
warning: iobluetooth (bin "soundcoremanager-iobtserver") generated 16 warnings
error: could not compile iobluetooth due to 3 previous errors; 16 warnings emitted
thread 'main' panicked at 'Failed to build iobluetooth server!', build.rs:49:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Error failed to build app: failed to build app
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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.