{"id":13560629,"url":"https://github.com/EHfive/pulseaudio-modules-bt","last_synced_at":"2025-04-03T16:30:53.841Z","repository":{"id":52957646,"uuid":"135812271","full_name":"EHfive/pulseaudio-modules-bt","owner":"EHfive","description":"[Deprecated, see https://github.com/EHfive/pulseaudio-modules-bt/issues/154] Adds Sony LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support to PulseAudio on Linux","archived":true,"fork":false,"pushed_at":"2020-12-15T16:56:38.000Z","size":385,"stargazers_count":1752,"open_issues_count":11,"forks_count":86,"subscribers_count":61,"default_branch":"master","last_synced_at":"2024-11-04T12:39:53.999Z","etag":null,"topics":["a2dp","aac","aptx","audio","bluetooth","linux"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EHfive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-02T11:31:13.000Z","updated_at":"2024-11-04T06:22:22.000Z","dependencies_parsed_at":"2022-09-11T12:42:59.985Z","dependency_job_id":null,"html_url":"https://github.com/EHfive/pulseaudio-modules-bt","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EHfive%2Fpulseaudio-modules-bt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EHfive%2Fpulseaudio-modules-bt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EHfive%2Fpulseaudio-modules-bt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EHfive%2Fpulseaudio-modules-bt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EHfive","download_url":"https://codeload.github.com/EHfive/pulseaudio-modules-bt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247036908,"owners_count":20873045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2dp","aac","aptx","audio","bluetooth","linux"],"created_at":"2024-08-01T13:00:48.051Z","updated_at":"2025-04-03T16:30:53.560Z","avatar_url":"https://github.com/EHfive.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# pulseaudio-modules-bt\n\nthis repo is a fork of pulseaudio bluetooth modules\n\nand adds LDAC, APTX, APTX-HD, AAC support, extended configuration for SBC\n\n#### Added Codecs\n|Codec|Encoding(source role)|Decoding(sink role)|Sample format(s)|Sample frequencies|\n|:---:|:---:|:---:|:---:|:---:|\n|AAC |✔ |✔ |s16|8, 11.025, 12,16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96 khz|\n|APTX | ✔| ✔ |s16|16, 32, 44.1, 48 khz|\n|APTX HD| ✔| ✔ |s24||\n|LDAC |✔ |✘|s16,s24,s32,f32|44.1, 48, 88.2, 96 khz|\n\nAPTX/APTX_HD sample format fixed to s32 in PA.\n(ffmpeg do the sample format transformation)\n\n#### Extended SBC configuration\n\nAdded support for manual (expert) configuration for SBC codec parameters:\n\n* Min and Max bitpool limits (2-250)\n* Sampling frequency\n* Audio channel mode\n* Quantization bit allocation mode\n* Frequency bands number\n* Audio blocks number\n\nYou can use this parameters to override and fine-tune default SBC codec config and manually setup configurations like SBC XQ, or Dual Channel HD mode.\nMore info about SBC configuration options can be found at [LineageOS documentation](https://lineageos.org/engineering/Bluetooth-SBC-XQ).\nAlso there is [interactive calculator](https://btcodecs.valdikss.org.ru/sbc-bitrate-calculator) and unofficial [device compatibility list](https://btcodecs.valdikss.org.ru/codec-compatibility) that may help you to select proper values.\n\nParameter-names for module-bluez5-discover and valid values provided at the table below.\n\nNOTE: Use these parameters with caution at your own risk! Invalid or extreme \"out-of-spec\" configurations may sometimes even cause malfunction for some cheap BT-audio devices. Usually these malfunctions can be fixed by resetting audio-device or sometimes simply by reconnecting with valid configuration.\n\n## Usage\n\n### Pre-built binary packages\n\nSee the [wiki/Packages](https://github.com/EHfive/pulseaudio-modules-bt/wiki/Packages) to find pre-build binary packages for you distribution.\n\nPlease also check [issue#3](https://github.com/EHfive/pulseaudio-modules-bt/issues/3).\n\nAfter installing your pre-built binary packages, see [below](#configure) to configure the module.\n\n### Build from source\n\n#### Make Dependencies\n\n* pulseaudio\u003e=11.59.1\n* bluez~=5.0\n* dbus\n* sbc\n* \\[Optional] ffmpeg(libavcodec\u003e=58, libavutil\u003e=56) \u003e= 4.0\n* \\[Optional] fdk-aac(-free)\u003e=0.1.5: pulseaudio-modules-bt use LC-AAC only\n* \\[Optional] [ldacBT](https://github.com/EHfive/ldacBT)/libldac\n* cmake\n* pkg-config, libtool, ...\n\nOn Debian based distributions (like Ubuntu), you can install the make dependencies with:\n\n`sudo apt-get install -y libfdk-aac-dev libavcodec-dev libpulse-dev libdbus-1-dev libsbc-dev libldacbt-abr-dev libldacbt-enc-dev libltdl-dev libbluetooth-dev`\n\n#### Runtime Dependencies\n\n* pulseaudio ( force preopen disabled / built with `--disable-force-preopen`)\n* bluez\n* dbus\n* sbc\n* \\[ fdk-aac(-free) ]\n* \\[  libavcodec.so ]: APTX, APTX-HD support \\[Optional]\n* \\[ libldac ]: LDAC encoding support, LDAC ABR support \\[Optional]\n\n#### Build\n\n**backup original pulseaudio bt modules**\n\n```bash\nMODDIR=`pkg-config --variable=modlibexecdir libpulse`\n\nsudo find $MODDIR -regex \".*\\(bluez5\\|bluetooth\\).*\\.so\" -exec cp {} {}.bak \\;\n```\n\n**pull sources**\n\nMake sure to pull into a filesystem that supports colons (`:`) as valid characters in filename (see [#144](https://github.com/EHfive/pulseaudio-modules-bt/issues/144)). Ext4 does, while NTFS does not.\n\n```bash\ngit clone https://github.com/EHfive/pulseaudio-modules-bt.git\ncd pulseaudio-modules-bt\ngit submodule update --init\n```\n\n**install**\n\nA. build for PulseAudio releases (e.g., v12.0, v12.2, etc.)\n```bash\ngit -C pa/ checkout v`pkg-config libpulse --modversion|sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/'`\n\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\nsudo make install\n```\n\nB. or build for PulseAudio git master\n```bash\ngit -C pa/ checkout master\nmkdir build \u0026\u0026 cd build\ncmake -DFORCE_LARGEST_PA_VERSION=ON ..\nmake\nsudo make install\n```\n\n*Cmake A2DP codecs options*: `CODEC_APTX_FF`, `CODEC_APTX_HD_FF`, `CODEC_AAC_FDK`, `CODEC_LDAC`\n\n#### Load Modules\n\n```bash\npulseaudio -k\n\n# if pulseaudio not restart automatically, run\npulseaudio --start\n```\n\nif you got a warning like below, you need to rebuild `pulseaudio` with `--disable-force-preopen` flag\n```\npulseaudio: symbol lookup error: pulseaudio: undefined symbol: pa_a2dp_codec_sbc\n```\n\n### Connect device\n\nConnect your bluetooth device and switch audio profile to 'A2DP Sink';\n\nIf there is only profile 'HSP/HFP' and 'off', disconnect and reconnect your device.\n\nThe issue has been fixed in bluez 5.51.\n\n#### Module Arguments\n\n**module-bluez5-discover arg:a2dp_config**\n\nEncoders configurations\n\n|Key| Value|Desc |Default|\n|---|---|---|---|\n|sbc_min_bp|2-250|minimum allowed bitpool|auto|\n|sbc_max_bp|2-250|maximum allowed bitpool, may not be \u003c sbc_min_bp|auto|\n|sbc_freq|16k, 32k, 44k, 48k|16000/32000/44100/48000 Hz sample frequency|auto|\n||auto|do not enforce sample frequency (default)|\n|sbc_cmode|mono|mono channel-mode|auto|\n||dual|dual channel-mode|\n||stereo|stereo channel-mode|\n||joint_stereo|joint stereo channel-mode|\n||auto|do not enforce channel-mode (default)|\n|sbc_alloc|snr|use SNR bit-allocation algorithm|auto|\n||loudness|use loudness bit-allocation algorithm|\n||auto|do not enforce bit-allocation algorithm (default)|\n|sbc_sbands|4, 8|4 or 8 subbands|auto|\n||auto|do not enforce subbands count (default)|\n|sbc_blen|4, 8, 12, 16|4/8/12/16 audio blocks in one audio frame|auto|\n||auto|do not enforce audio blocks count (default)|\n|ldac_eqmid|hq|LDAC High Quality|auto|\n||sq|LDAC Standard Quality|\n||mq|LDAC Mobile use Quality|\n||auto /abr|LDAC Adaptive Bit Rate|\n|ldac_fmt|s16|16-bit signed (little endian)|auto|\n||s24|24-bit signed|\n||s32|32-bit signed|\n||f32|32-bit float|\n||auto|Ref default-sample-format|\n|ldac_abr_t1|\\\u003cuint\u003e|safety threshold for LDACBT_EQMID_HQ and LDACBT_EQMID_SQ|2|\n|ldac_abr_t2|\\\u003cuint\u003e|threshold for dangerous trend of TxQueueDepth|4|\n|ldac_abr_t3|\\\u003cuint\u003e|threshold for critical TxQueueDepth status|6|\n|aac_bitrate_mode|\\[1, 5\\]|Variable Bitrate (VBR)|0|\n||0|Constant Bitrate (CBR)|\n|aac_afterburner|\u003con/off\u003e|Enable/Disable AAC encoder afterburner feature|off|\n|aac_fmt|s16|16-bit signed (little endian)|auto|\n||s32|32-bit signed|\n||auto|Ref default-sample-format|\n\n#### Configure\n\nedit `/etc/pulse/default.pa`\n\nappend arguments to 'load-module module-bluetooth-discover'\n\n(module-bluetooth-discover pass all arguments to module-bluez5-discover)\n\n    # LDAC Standard Quality\n    load-module module-bluetooth-discover a2dp_config=\"ldac_eqmid=sq\"\n\n    # LDAC High Quality; Force LDAC/PA PCM sample format as Float32LE\n    #load-module module-bluetooth-discover a2dp_config=\"ldac_eqmid=hq ldac_fmt=f32\"\n\n\nequivalent to commands below if you do not use 'module-bluetooth-discover'\n\n    load-module module-bluez5-discover a2dp_config=\"ldac_eqmid=sq\"\n\n    #load-module module-bluez5-discover a2dp_config=\"ldac_eqmid=hq ldac_fmt=f32\"\n\n#### Others\n\nsee [Wiki](https://github.com/EHfive/pulseaudio-modules-bt/wiki)\n\n## TODO\n\n~~add ldac abr (Adaptive Bit Rate) supprot~~\n\n~~add APTX , APTX HD Codec support using ffmpeg~~\n\n~~add AAC support using Fraunhofer FDK AAC codec library~~\n\n~~add codec switching support using latest blueZ's experimental feature~~\n\n## Copyright\n```\n  pulseaudio-modules-bt\n\n  Copyright (C) 2018-2019  Huang-Huang Bao\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEHfive%2Fpulseaudio-modules-bt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEHfive%2Fpulseaudio-modules-bt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEHfive%2Fpulseaudio-modules-bt/lists"}