Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Chinese CSR / Barrot Clone Bluetooth Dongle Fix & Audio Quality Optimization Guide

License: MIT Platform: Linux & Windows Kernel: 5.4 to 6.14+

A complete, battle-tested guide and toolkit to get generic Chinese USB Bluetooth adapters (0a12:0001 CSR / Barrot clones) working flawlessly on Linux, eliminate the dreaded connect/disconnect loop, and unlock studio-grade audiophile sound quality (SBC-XQ, LDAC, AptX HD) on both Linux and Windows.


Table of Contents


The Problem & Hardware Identification

Millions of low-cost USB Bluetooth 5.0 / 5.1 / 5.3 / 5.4 dongles sold on AliExpress, Amazon, and eBay identify as:

Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Why it works in Windows but fails in Linux

Internally, these adapters are not real Cambridge Silicon Radio (CSR8510) chips. They are clones—typically based on the Barrot 8041a02 or similar chipsets—running counterfeit firmware that reports vendor ID 0a12:0001.

  • In Windows: The proprietary Windows driver ignores unsupported commands and masks hardware flaws.
  • In Linux: The stock Linux btusb driver identifies the CSR ID and tries to apply standard CSR suspend and reset commands that the clone hardware cannot process.

Symptoms in Linux Kernel Logs (dmesg)

Bluetooth: hci0: CSR: Setting up dongle with HCI ver=9 rev=3120
Bluetooth: hci0: LMP ver=9 subver=22bb; manufacturer=10
Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds and force-suspending once...
Bluetooth: hci0: CSR: Couldn't suspend the device for our Barrot 8041a02 receive-issue workaround
Bluetooth: hci0: HCI Delete Stored Link Key command is advertised, but not supported.
Bluetooth: hci0: Opcode 0x0c03 failed: -110

The adapter fails initialization with error code -110 (ETIMEDOUT), stays in the DOWN state, and never powers on.


Part 1: Making the Dongle Work on Linux (Driver Fix)

The fix uses the community-maintained csr8510-fix driver, which patches btusb to mask broken commands and fix the initialization sequence. Installing it via DKMS ensures it automatically rebuilds every time your Linux kernel updates.

Prerequisites

Ubuntu / Debian / Linux Mint / Pop!_OS

sudo apt update
sudo apt install -y git dkms build-essential linux-headers-$(uname -r)

Fedora / RHEL

sudo dnf install -y git dkms gcc make kernel-devel-$(uname -r)

Arch Linux / Manjaro / EndeavourOS

sudo pacman -S --needed git dkms base-devel linux-headers bluez bluez-utils

Installing the Patched DKMS Module

Clone the patched driver repository and run the installer:

git clone https://github.com/hhsnake/csr8510-fix.git
cd csr8510-fix
sudo ./install.sh

Unblock Bluetooth in rfkill:

sudo rfkill unblock bluetooth

Verifying Adapter Status

Check if the controller is now UP RUNNING:

hciconfig -a

You should see:

hci0:   Type: Primary  Bus: USB
        BD Address: 00:1A:7D:...  ACL MTU: 310:4  SCO MTU: 64:0
        UP RUNNING
        HCI Version: 5.0 (0x9)  Revision: 0x3120

Check bluetoothctl:

bluetoothctl show

You should see Powered: yes and Pairable: yes.


Part 2: Fixing the "Connect / Disconnect in a Loop" Bug

Once the adapter is running, you may notice that phones, headphones, or other devices repeatedly connect and disconnect every 20–30 seconds. This is caused by three separate issues:

1. Disable USB Autosuspend

By default, the Linux kernel puts USB devices into low-power suspend after 2 seconds of inactivity (power/control = auto). These clone chips have broken power-management firmware: when suspended, incoming packets cause an HCI command timeout (0x0c1a tx timeout), triggering the kernel to execute a full USB reset, disconnecting your device.

Fix: Disable autosuspend for the btusb module:

echo "options btusb enable_autosuspend=n" | sudo tee /etc/modprobe.d/btusb.conf

Apply immediately to the active device (replace 1-2 with your USB bus port if different):

echo "on" | sudo tee /sys/bus/usb/devices/*/power/control 2>/dev/null || true

2. Disable BlueZ's Aggressive Reconnect Policy

Smartphones (Android / iOS) are designed to drop Bluetooth connections to computers when idle to save battery. When BlueZ's default policy (ReconnectAttempts=7) is enabled, Linux immediately attempts to force the device to reconnect. The phone reconnects, finds no active stream, disconnects again, and enters an infinite loop.

Fix: Edit /etc/bluetooth/main.conf:

sudo nano /etc/bluetooth/main.conf

Find the [Policy] section and configure:

[Policy]
ReconnectAttempts=0
ReconnectUUIDs=
AutoEnable=true

3. Fix Input & Device Trust

When devices connect, make sure they are marked as trusted so BlueZ does not reject incoming service profiles:

# In terminal:
bluetoothctl trust <DEVICE_MAC_ADDRESS>

Also, enable userspace HID in /etc/bluetooth/input.conf:

sudo sed -i 's/#UserspaceHID=true/UserspaceHID=true/' /etc/bluetooth/input.conf

Restart the Bluetooth daemon to apply all changes:

sudo systemctl restart bluetooth

Part 3: Maximizing Audio Quality on Linux (PipeWire / WirePlumber)

Modern Linux distributions use PipeWire and WirePlumber, which feature native support for high-resolution Bluetooth codecs. By tuning their configuration, you can achieve audiophile-grade wireless sound.

1. Enable SBC-XQ (551 kbps) & Codec Priorities

Standard SBC is capped at ~328 kbps. SBC-XQ (eXtra Quality) raises the bitpool to deliver 452 to 551 kbps dual-channel audio—comparable to AptX HD, and supported by 99% of Bluetooth headphones on the market!

Create the custom WirePlumber configuration:

mkdir -p ~/.config/wireplumber/bluetooth.lua.d
cat << 'EOF' > ~/.config/wireplumber/bluetooth.lua.d/51-bluez-quality.lua
-- Audiophile Bluetooth quality optimizations for WirePlumber
bluez_monitor.properties["bluez5.codecs"] = "[ ldac aptx_hd aptx sbc_xq sbc ]"
bluez_monitor.properties["bluez5.enable-sbc-xq"] = true
bluez_monitor.properties["bluez5.default.rate"] = 48000
bluez_monitor.properties["bluez5.default.channels"] = 2

table.insert(bluez_monitor.rules, {
  matches = {
    {
      { "device.name", "matches", "bluez_card.*" },
    },
  },
  apply_properties = {
    ["bluez5.a2dp.ldac.quality"] = "auto", -- Dynamic high bitrate up to 990 kbps
    ["device.profile"] = "a2dp-sink",
  },
})

table.insert(bluez_monitor.rules, {
  matches = {
    {
      { "node.name", "matches", "bluez_output.*" },
    },
  },
  apply_properties = {
    ["resample.quality"] = 10,
    ["session.suspend-timeout-seconds"] = 0, -- Prevents popping/sleep on silence
  },
})
EOF

2. Bit-Perfect Native Sample Rates & Quality Resampling

Avoid lossy sample-rate conversion (e.g. 44.1 kHz Spotify/CD audio being clumsily resampled to 48 kHz). Allow PipeWire to dynamically switch rates:

mkdir -p ~/.config/pipewire/pipewire.conf.d ~/.config/pipewire/client.conf.d

cat << 'EOF' > ~/.config/pipewire/pipewire.conf.d/10-rates.conf
context.properties = {
    default.clock.rate = 48000
    default.clock.allowed-rates = [ 44100 48000 88200 96000 ]
}
EOF

cat << 'EOF' > ~/.config/pipewire/client.conf.d/20-quality.conf
stream.properties = {
    resample.quality = 10
}
EOF

Restart PipeWire and WirePlumber:

systemctl --user restart pipewire pipewire-pulse wireplumber

3. Eliminate Idle Audio Popping & Latency

PipeWire puts Bluetooth sinks to sleep after 5 seconds of silence by default. This causes an audible "click/pop" or a 1-second delay when starting video/audio playback. The setting session.suspend-timeout-seconds = 0 (included above) completely eliminates this problem.


4. The #1 Trap: Hands-Free (HFP) vs A2DP

Bluetooth headphones support two profiles:

  1. A2DP (Advanced Audio Distribution Profile): High-definition stereo playback (SBC-XQ, LDAC, AptX).
  2. HFP / HSP (Hands-Free Profile): Low-bandwidth mono audio (8 kHz / 16 kHz) intended only for two-way phone calls.

Important

If your headphones ever sound muffled, tinny, or like an old telephone, your system switched to HFP/HSP!

How to check: Open your system Sound Settings $\rightarrow$ Output $\rightarrow$ Click your headphones $\rightarrow$ Make sure the Profile / Configuration is set to High Fidelity Playback (A2DP) (or SBC-XQ / LDAC), not "Handsfree Head Unit".


5. System-Wide Equalizer & AutoEQ (EasyEffects)

To achieve the best possible sound from your specific headphones, install EasyEffects:

sudo apt install easyeffects   # Debian / Ubuntu / Mint
sudo dnf install easyeffects   # Fedora
sudo pacman -S easyeffects     # Arch

Why EasyEffects is a game changer:

  • AutoEQ Integration: Under Effects $\rightarrow$ Equalizer $\rightarrow$ Presets, you can import calibrated parametric EQ profiles created by audio researchers for over 4,000 headphone models (Bose, Sony, Sennheiser, JBL, Apple, etc.), correcting frequency imbalances according to the Harman target curve.
  • Bass Enhancer & Convolver: Add punchy, clean low-end and crossfeed for natural speaker-like sound staging.

Part 4: Maximizing Bluetooth Audio Quality on Windows

While generic CSR dongles work out of the box on Windows, Windows 10 and 11 suffer from severe Bluetooth audio limitations by default.

1. Disable "Handsfree Telephony" (Essential)

Windows aggressively downgrades Bluetooth headphones to terrible 8 kHz mono whenever any app queries the microphone (Discord, Zoom, games, or web browsers).

How to disable Handsfree Telephony and lock high-quality stereo:

  1. Press Win + R, type control printers, and press Enter.
  2. Under Devices, right-click your Bluetooth headphones and select Properties.
  3. Go to the Services tab.
  4. Uncheck "Handsfree Telephony".
  5. Click Apply and OK.
  6. Result: Windows will permanently treat your headphones as high-fidelity stereo headphones and will never drop into low-quality telephone mode. (Use a dedicated USB microphone or laptop built-in mic for voice chat).

2. Unlock LDAC (990 kbps) & AptX HD on Windows

By default, Windows 10/11 only supports SBC and standard AAC. Windows has no native support for Sony LDAC or AptX HD, even if your headphones support them!

Solution: Use the Alternative A2DP Driver (by Bluetooth Goodies):

  • Adds full support for LDAC (990 kbps, 24-bit/96kHz) and AptX HD / AptX Adaptive to Windows 10 & 11.
  • Works with any Bluetooth adapter (including generic CSR dongles).
  • Includes real-time bitrate monitoring, latency adjustment, and automatic codec switching.

3. System-Wide Equalizer on Windows (Equalizer APO)

Windows does not provide a system-wide parametric equalizer. Install:

  1. Equalizer APO (open-source audio DSP engine).
  2. Peace GUI (clean graphical front-end).
  3. Search for your headphone model on AutoEQ and import the parametric EQ text file into Peace to instantly optimize your sound profile.

Part 5: Automated Setup Scripts

Included in this repository are automated scripts to apply these fixes and optimizations on Linux with one command:

1. Fix Dongle & Connect/Disconnect Loop

chmod +x scripts/fix-dongle.sh
sudo ./scripts/fix-dongle.sh

2. Configure High-Resolution Audio

chmod +x scripts/optimize-audio.sh
./scripts/optimize-audio.sh

Troubleshooting & FAQ

Q: Opcode 0x0c03 failed: -110 still appears after restart?

Make sure the DKMS driver is actively loaded:

modinfo -F filename btusb

It should point to /lib/modules/.../updates/dkms/btusb.ko.zst. If it points to the stock kernel path, run:

cd csr8510-fix && sudo ./install.sh

Q: How do I know which audio codec is currently active?

Run:

pactl list cards

Look for your device under Active Profile:. It will show a2dp-sink-sbc_xq, a2dp-sink-ldac, a2dp-sink-aptx_hd, etc.

Q: Can I connect both a phone and Bluetooth headphones at the same time?

Yes! Bluetooth controllers support multiple simultaneous connections across different device classes (e.g., Audio Sink + Phonebook/OBEX).


Credits & References


License

This guide and accompanying helper scripts are licensed under the MIT License.

About

Fix generic Chinese CSR 4.0/5.0/5.3 Bluetooth dongles (0a12:0001 / Barrot 8041a02) on Linux. Fixes timeout -110, connect/disconnect loops, and unlocks SBC-XQ & LDAC audio quality.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages