Giter Site home page Giter Site logo

ololx / sbc-bitpool-expander Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 3.0 8.06 MB

This is a simple tool for the sound quality improving of wireless headphones with the sbc codec on a mac.

License: MIT License

Swift 90.66% Shell 9.34%
macos bluetooth-audio sbc bitrate bit-pool sbc-codec sbc-audio maximum-bitpool wireless-headphones bluetooth-headphones

sbc-bitpool-expander's Introduction

sbc-bitpool-expander

This is a simple tool for the sound quality improving of wireless headphones with the sbc codec on a mac.

tag release

osslifecycle last_commit release_date

licence Contributor Covenant FOSSA Status

repo_size languages_code_size languages_count languages_top

platform

๐Ÿ“‡ Table of Contents

๐Ÿ“– About

The sbc-bitpool-expander is a mac automator program, which executes a shell command to change the SBC encoding bitpool values. This changes could up the bitrate value till 357 kbit/s for SBC audio.

Motivation

The SBC codec has many different parameters:

  • Channels count and type: Joint Stereo, Stereo, Dual Channel, Mono;
  • Frequency bands count: 4 or 8;
  • Package blocks count: 4, 8, 12, 16;
  • Quantization bit allocation algorithm: volume, SNR;
  • bit pools max-min value: in usually it's from 2 to 53.

These parametters uses the bitpool value and affects the final audio quality.

For instance, Dual Channel mode encodes channels separately, using the entire bitpool for each channel. The forcing device to use Dual Channel instead of Joint Stereo, allos get an almost double bitrate with the same maximum bitpool value: 617 kbps.

These fixed values, Bitpool and Bitrate, originate from a table with high-quality audio recommended values. But it's just a recommendations. The high-quality audio recommended values

The Bluetooth stack of macOS have artificial limitations on the maximum value of the bitpool parameter:

  • Min A2DP bit pool value is among 2;
  • Max A2DP bit pool value is among 40;
  • Fact A2DP bit pool value is dinamicaly and changes from max to min values. This limitations directly affects the maximum bitrate.

Almost all headphones also limit the maximum bitpool value to 53. But such a bitrate will never be negotiated under normal conditions, on ordinary Bluetooth stacks on macOS.

How does it work?

The sbc-bitpool-expander is a mac automator program, which executes a shell command to change the SBC encoding bitpool values. This changes could up the bitrate value till 357 kbit/s for SBC audio. At launch, this tool setups the bit pool min value to 53. This setupping prevents the bit pool from being changing to the standard minimum values โ€‹of 2 and affects the final bitrate and sound quality.

๐Ÿ“ธ Demo

Usage

This animation demonstrates how is the simple to use this tool.

Effect

This pictures demonstrates how the increasing bit rate from 261 kb/s (BEFORE) to 357 kb/s (AFTER) by the bitpool increases after launching this tool.

The audio graph before usage The audio graph after usage

After launching this tool, the following lines will appear in the bluetoothaudiod macOS settings:

{
    ...
    "Apple Bitpool Max" = 64;
    "Apple Bitpool Min" = 53;
    "Apple Initial Bitpool" = 53;
    "Apple Initial Bitpool Min" = 53;
    "Negotiated Bitpool" = 53;
    "Negotiated Bitpool Max" = 64;
    "Negotiated Bitpool Min" = 53;
    ...
}

๐ŸŽš Features

  • Increase the sbc bluetooth audio bit rate with in several click.

To Do

  • For more information on an upcoming development, please read the todo list.

Changelog

  • For more information on a releases, a features and a changes, please read the changelog notes.

๐Ÿšฆ Getting Started

These instructions allow to get a copy of this project and run it on a local machine.

Prerequisites

Before using it, make sure that follows software are installed on the local machine:

  • macOS - the operating system under which the process is executing;

If any of the listed programs is not installed, then it can be installed by instruction as described below.

  1. macOS

    • Install macOS by this instruction.

Installing

In order to install it is enough to download executable file sbc bitpool expander.app for the required release from this page:

https://github.com/ololx/sbc-bitpool-expander/releases/

If you want to install the source files it is quite simple to clone or donload this repository.

Cloning

For the cloning this repository to a local machine, just use the follows link:

https://github.com/ololx/sbc-bitpool-expander

Using

For use it is required to:

  1. Go to the directory where you download this tool (optionally):

    • via Finder;
    • via Terminal prompt;
    cd /{path to parent dir with this repository}/
  2. Launch the tool in macOS (optionally):

    • via double-click on sbc bitpool expander.app;
    • via Terminal prompt;
    open sbc\ bitpool\ expander.app
  3. Set the required bitpool size values. In general, these will be the following settings:

- Current/Initial bitpool value is 53;
- Min bitpool value is 53;
- Max bitpool value is 64;
  1. Enter the administrator credentials if necessary

  2. Reconnect a headphones to a local machine via Bluetooth

If you want a better result for your device

NOTE: It's universal settings and it works for the most devices. Below you can find settings for better sound quality on your device. If you want to watch your current settings:

sudo defaults read bluetoothaudiod 

or if you want reset it to default:

sudo defaults delete bluetoothaudiod

You may experement with "Apple Bitpool Min" setting. For example, the best sound on my device "Harman Kardon Go + Play" is on value 111:

sudo defaults write bluetoothaudiod "Apple Bitpool Min" -int 111
sudo defaults write bluetoothaudiod "Apple Bitpool Max" -int 111

And I got stable bit rate at 705 kb/s.

๐Ÿ›  Built With

  • Xcode - the IDE for the AppleScriptObjC automatisation development.

๐ŸŽ‰ Contributing

If you want to contribute this project - you are welcome and have fun. Please visit the contributing section for details on this code of conduct, and the process for submitting pull requests.

๐Ÿ“ Code of Conduct

In order to ensure that all is welcoming, please review and abide by the code of conduct.

๐Ÿ—’ Versioning

For the versioning is used Semantic Versioning. For the versions available, see the changelog or the tags on this repository.

ยฉ๏ธ Authors

  • Alexander A. Kropotin - initial work - ololx.

Contributors โœจ

Thanks goes to these wonderful people:

  • Roman - contributing - dE1l.

๐Ÿ” Licensing

This project is licensed under the MIT license - see the lisence document for details.

sbc-bitpool-expander's People

Contributors

fossabot avatar ololx avatar

Stargazers

 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

sbc-bitpool-expander's Issues

macOS Monterey - Does this work or is there an alternative for this macOS release?

Looks like Monterey really changes the way Bluetooth works in macOS. I can't figure it out. I presume you may need to explicitly state that this doesn't work with Monterey???

I fear that Apple may have done this on purpose for commercial reasons. Apple knows they need to offer something to improve Bluetooth access to their lossless and Hi-Res offerings in Apple Music. Perhaps higher bit rate SBC has the chance of making any new efforts look bad??? Perhaps they are intending on delivering adjustments to the SBC encoding that achieves the same thing and don't want the party spoiled. I'm hoping for a surprise this coming year where they will deliver a method to transmit ALAC losslessly. It may take abandoning Bluetooth for audio though. Maybe AirPods Pro 2 will feature "Wi-Fi Audio".

I'd like to see SBC XQ on Mac. The settings you access here are on the same route as SBC XQ.

Thanks.

Dual channel mode

Hi,
Thank you for this very valuable tool. It seems that bit rate doesn't change if I set (or not) dual channel. With bitpool set at 53, this gives me 357kb/s in both cases if I refer to Bluetooth Explorer app in xcode tools. Or maybe the Bluetooth Explorer shows only the value per channel?

Thanks in advance for your feedback

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.