[MAGISK] [MODULE] SBC XQ Bluetooth Audio Codec and DRC Deactivator (Android 10)

Search This thread

Christos_A

Senior Member
Oct 18, 2017
61
18
Sony Xperia XA
OnePlus 5T
Hi, does SBC XQ only work in dual channel mode? My headphones only support stereo is that why I'm not hearing any difference?
Unfortunately yes, the module only supports sbc DualChannel connections. Lineage forces DualChannel on all bt audio devices so the module definitely works there, but i haven't found any way to force this in other roms. So for now im stuck with 328kbps audio at 44.1khz on my WF100XM3 as my rom defaults to JointStereo instead.
 
Unfortunately yes, the module only supports sbc DualChannel connections. Lineage forces DualChannel on all bt audio devices so the module definitely works there, but i haven't found any way to force this in other roms. So for now im stuck with 328kbps audio at 44.1khz on my WF100XM3 as my rom defaults to JointStereo instead.
Is there any way to force dual-channel on my ROM, or does that have to be done by the developer?
 
From what I've seen no, either the rom or the bluetooth stacks have to be modified. Try asking the rom devs to implement this though, lots of users use Bluetooth audio devices
I tried, to no avail :(
Thing is Dual Channel is available as an option in dev settings but it's permanently greyed out. From the BTsnoop log, my headphones definitely do support dual channel sbc but there just seems to be no way to enable it from my end. I tried it on PC too but same story.
 

Christos_A

Senior Member
Oct 18, 2017
61
18
Sony Xperia XA
OnePlus 5T
I tried, to no avail :(
Thing is Dual Channel is available as an option in dev settings but it's permanently greyed out. From the BTsnoop log, my headphones definitely do support dual channel sbc but there just seems to be no way to enable it from my end. I tried it on PC too but same story.
Yeah DualChannel needs a rom patch to work unfortunately. I asked my rom devs (Nameless for OP8 series) to implement this tho and they are looking into it

Edit: here's the link https://t.me/nameless_ophub/183916
 
Last edited:
Well the devs have acknowledged it as a bug now. Turns out this change was already implemented into the rom, but it broken in a way (Bluetooth devices still used JointStereo by default). Think we can expect a fix in upcoming builds.
oh yay I hope so. Also, what exactly is the DRC deactivator module used for? What does deactivating the DRC do exactly? Do you know?
 

Christos_A

Senior Member
Oct 18, 2017
61
18
Sony Xperia XA
OnePlus 5T
oh yay I hope so. Also, what exactly is the DRC deactivator module used for? What does deactivating the DRC do exactly? Do you know?
From my understanding, t's some kind of audio dynamic range compression, eg it tries to maintain a consistent volume level for audio played on the device. People say this greatly reduces audio quality but i doubt we can notice a difference on Bluetooth buds. That said, i do have the disabler module installed on my device
 
  • Like
Reactions: pixel_peeper
From my understanding, t's some kind of audio dynamic range compression, eg it tries to maintain a consistent volume level for audio played on the device. People say this greatly reduces audio quality but i doubt we can notice a difference on Bluetooth buds. That said, i do have the disabler module installed on my device
I see. Thank you.
 
  • Like
Reactions: Christos_A

seffparker

Senior Member
Jul 23, 2012
60
28
I have continued to verify if it's actually changes the bitrate. The logcat shows no change in SBC bitrate:

Code:
# logcat | grep BTAudioProviderSession
02-03 08:37:08.484  1662  1727 I BTAudioProviderSession: OnSessionStarted - SessionType=A2DP_HARDWARE_OFFLOAD_DATAPATH, AudioConfiguration={.pcmConfig = {.sampleRate = RATE_44100, .channelMode = 0x10, .bitsPerSample = 0x9}, .codecConfig = {.codecType = SBC, .encodedAudioBitrate = 330000, .peerMtu = 659, .isScmstEnabled = 0, .isScramblingEnabled = 1, .config = {.sbcConfig = {.sampleRate = RATE_44100, .channelMode = JOINT_STEREO, .blockLength = BLOCKS_16, .numSubbands = SUBBAND_8, .allocMethod = ALLOC_MD_L, .bitsPerSample = BITS_16, .minBitpool = 2, .maxBitpool = 53}, .aacConfig = {.objectType = 0x1, .sampleRate = 0x1041001, .channelMode = MONO, .variableBitRateEnabled = 0x2, .bitsPerSample = 0x35, .frameControlEnabled = 0}, .ldacConfig = {.sampleRate = RATE_44100, .channelMode = STEREO, .qualityIndex = 0x10, .bitsPerSample = BITS_32}, .aptxConfig = {.sampleRate = RATE_44100, .channelMode = MONO, .bitsPerSample = 0x10}, .aptxAdaptiveConfig = {.sampleRate = RATE_44100, .channelMode = 0x1041001, .bitsPerSample = BITS_16, .aptxMode = UNKNOWN, .sinkBuffering = {.minSink
02-03 08:37:08.484  1662  1727 I BTAudioProviderSession: ReportSessionStatus - SessionType=A2DP_HARDWARE_OFFLOAD_DATAPATH has NO port state observer
02-03 08:37:08.485  1662  1727 I BTAudioProviderSession: OnSessionParamUpdate Update Sink Latency: 0

It shows the bitrate is still 330kbps either while enabled or disabled the module.
 
Last edited:

ArmanHayots

New member
Mar 11, 2023
2
0
The main point of trouble as I think is an existence of two concurrent bluetooth stacks — Gabeldorshe and classic. Gabeldorshe introduced in Android 11 but that's not meaning that any device with A11 and newer use it — as example on my Blackview BV9200 with Android 12 Gabeldorshe disabled by default (and looks like in current firmware it's resetting back to classic at reboot) so maybe this module can be used (I have no root so can't test).
Just some thoughts.
 
Last edited:

borisSweden

Senior Member
May 10, 2021
266
23
OnePlus 7T
The main point of trouble as I think is an existence of two concurrent bluetooth stacks — Gabeldorshe and classic. Gabeldorshe introduced in Android 11 but that's not meaning that any device with A11 and newer use it — as example on my Blackview BV9200 with Android 12 Gabeldorshe disabled by default (and looks like in current firmware it's resetting back to classic at reboot) so maybe this module can be used (I have no root so can't test).
Just some thoughts.
How do you check is Gabledorche is active? Im on LineageOS 20 for Oneplus 7T. We did lose Adaptive because of BBK but I can see Opus and LC3 as a classic codec option.
 

ArmanHayots

New member
Mar 11, 2023
2
0
You have no switch in the developer options?
In my DokeOS I have this(excuse for non-English):

Screenshot_20230323-054751.png
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    PREMISE
    Standard Bluetooth (BT) audio codec SBC is incorporated into all BT stereo audio devices as mandatory. It can work at arbitrary high bitrates but BT documents, however, recommend 328 kbit/s (44.1kHz/16bit) for high quality mode. This mode provides just acceptable audio quality.
    Meanwhile a guy under the nick ValdikSS wrote the patch for Android and another guy, Pali Rohár for Linux; these patches unlock higher bitrates of SBC encoder. That patches then called as "SBC XQ".
    It turned out that almost all modern BT headphones, speakers, receivers; support SBC bitrates up to 730 kbit/s just out of the box. And SBC XQ helps to encode BT audio on Android smartphones at the following bitrates:

    (1) 452.0 kbit/s for 44.1kHz/16bit (BT EDR 2) Magisk_SBCXQ_452_A10.zip
    (2) 551.2 kbit/s for 44.1kHz/16bit (BT EDR 3) Magisk_SBCXQ_551_A10.zip

    Audio quality of SBC XQ BT EDR2 is comparable to aptX HD. And for BT EDR3 devices SBC XQ slightly surpasses aptX HD. It will be impossible to tell them apart in a blind listening test.

    SBC XQ MODULES
    SBC XQ has very simple concept. Higher bitrate, better quality. These modules will increase your SBC bitrate from 364kbit/s to 452kbit/s or 551kbit/s and perform high quality audio for traditional (budget) SBC BT audio receivers. These modules will replace your BT stack (libbluetooth.so arm and arm64). So, if it is not work, your BT will completely go off. In other word, your default SBC bitrate has been updated successfully, if your BT audio receiver function normally.
    Obviously, you can only enable 1 Module at a time 452kbit/s or 551kbit/s.

    Complete source of SBC XQ

    Modification Sources

    OPTIONAL MODULE
    Dynamic Range Control (DRC) Deactivator Magisk_DRC_Deactivator_v1.00.zip
    I found this Module from XDA, made by @zyhk
    Basically it will set "drc_enabled = true" to "drc_enabled = false".
    The original one, patch audio_policy_configuration.xml in vendor/etc folder.
    My mod version will patch in vendor/etc/audio folder also.

    ALL MODULES HAS BEEN TESTED
    Source:
    Xiaomi Redmi Note 8, MIUI v12.0.6 Global, Android 10
    Receiver:
    MPow X4.0 ANC (Bluetooth Headphone)
    Clarion PE-4217N-A (Car HeadUnit)


    JUST FEEL THE DIFFERENCE

    DONATE

    a cup of coffee will be nice :)
    3
    Sounds great what about Android 11 and 12?
    Anyway a good work.Cheers!!!
    waiting for my crappy phone got A11 update 😁
    1
    Sounds great what about Android 11 and 12?
    Anyway a good work.Cheers!!!
    1
    waiting for my crappy phone got A11 update 😁
    It doesnt matter for me i test it on my Android 11 Redmi 9 and gibe feedback soon.Cheers!!!
    1
    This breaks Bluetooth for me, pixel 5 running protonAOSP and protonkernel.

    After rebooting Bluetooth won't turn on, tries for about 10 seconds and then turns back off
    I'm sorry it doesn't work for you.. I never test it, on custom ROM