All Projects → EHfive → Pulseaudio Modules Bt

EHfive / Pulseaudio Modules Bt

Licence: gpl-3.0
[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

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to Pulseaudio Modules Bt

Ble examples
Additional examples to compliment TI's Bluetooth Low Energy Stack offerings.
Stars: ✭ 289 (-82.63%)
Mutual labels:  audio, bluetooth
Bluez Alsa
Bluetooth Audio ALSA Backend
Stars: ✭ 568 (-65.87%)
Mutual labels:  audio, bluetooth
Androidffmpeg
android 读取摄像头和麦克风,使用rtmp推流
Stars: ✭ 298 (-82.09%)
Mutual labels:  audio, aac
Symphonia
Pure Rust multimedia format demuxing, tag reading, and audio decoding library
Stars: ✭ 191 (-88.52%)
Mutual labels:  audio, aac
Faad2
Freeware Advanced Audio (AAC) Decoder faad2 mirror
Stars: ✭ 82 (-95.07%)
Mutual labels:  audio, aac
Flacon
Audio File Encoder. Extracts audio tracks from an audio CD image to separate tracks.
Stars: ✭ 252 (-84.86%)
Mutual labels:  audio, aac
Freac
The fre:ac audio converter project
Stars: ✭ 518 (-68.87%)
Mutual labels:  audio, aac
Mediafile
A unified reader of metadata from audio & video files.
Stars: ✭ 138 (-91.71%)
Mutual labels:  audio, aac
Rtsp Simple Server
ready-to-use RTSP / RTMP server and proxy that allows to read, publish and proxy video and audio streams
Stars: ✭ 882 (-47%)
Mutual labels:  audio, aac
Rpi Audio Receiver
Raspberry Pi Audio Receiver with Bluetooth A2DP, AirPlay, UPnP and Spotify Connect
Stars: ✭ 650 (-60.94%)
Mutual labels:  audio, bluetooth
Multi Room Audio Centralized Audio For Home
🎵 This Github Repository provides details on setting up a centralized audio system for your home using nothing but Raspberry Pi's and Old Speakers.
Stars: ✭ 189 (-88.64%)
Mutual labels:  audio, bluetooth
Av Converter
[av-converter.com] Audio and Video Converter, and YouTube downloader. Convert to MP3, MP4, AAC, FLAC, AC3, WAV, etc.
Stars: ✭ 97 (-94.17%)
Mutual labels:  audio, aac
Atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
Stars: ✭ 180 (-89.18%)
Mutual labels:  audio, aac
libopenaptx
Open Source implementation of Audio Processing Technology codec (aptX)
Stars: ✭ 106 (-93.63%)
Mutual labels:  bluetooth, aptx
Audio Steganography Algorithms
A Library of Audio Steganography & Watermarking Algorithms
Stars: ✭ 146 (-91.23%)
Mutual labels:  audio, aac
Hifiberry Os
Linux distribution optimized for audio playback
Stars: ✭ 487 (-70.73%)
Mutual labels:  audio, bluetooth
Trinity
android video record editor muxer sdk
Stars: ✭ 609 (-63.4%)
Mutual labels:  audio, aac
Balena Sound
Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
Stars: ✭ 1,306 (-21.51%)
Mutual labels:  audio, bluetooth
Faac
Freeware Advanced Audio Coder faac mirror
Stars: ✭ 102 (-93.87%)
Mutual labels:  audio, aac
Invisible Highway
Invisible Highway is an experiment in controlling physical things in the real world by drawing in AR. Simply make a pathway along the floor on your phone and the robot car will follow that path on the actual floor in your room. A custom highway with scenery is generated along the path to make the robots a little more scenic on your phone screen.
Stars: ✭ 118 (-92.91%)
Mutual labels:  bluetooth

pulseaudio-modules-bt

this repo is a fork of pulseaudio bluetooth modules

and adds LDAC, APTX, APTX-HD, AAC support, extended configuration for SBC

Added Codecs

Codec Encoding(source role) Decoding(sink role) Sample format(s) Sample frequencies
AAC s16 8, 11.025, 12,16, 22.05, 24, 32, 44.1, 48, 64, 88.2, 96 khz
APTX s16 16, 32, 44.1, 48 khz
APTX HD s24
LDAC s16,s24,s32,f32 44.1, 48, 88.2, 96 khz

APTX/APTX_HD sample format fixed to s32 in PA. (ffmpeg do the sample format transformation)

Extended SBC configuration

Added support for manual (expert) configuration for SBC codec parameters:

  • Min and Max bitpool limits (2-250)
  • Sampling frequency
  • Audio channel mode
  • Quantization bit allocation mode
  • Frequency bands number
  • Audio blocks number

You 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. More info about SBC configuration options can be found at LineageOS documentation. Also there is interactive calculator and unofficial device compatibility list that may help you to select proper values.

Parameter-names for module-bluez5-discover and valid values provided at the table below.

NOTE: 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.

Usage

Pre-built binary packages

See the wiki/Packages to find pre-build binary packages for you distribution.

Please also check issue#3.

After installing your pre-built binary packages, see below to configure the module.

Build from source

Make Dependencies

  • pulseaudio>=11.59.1
  • bluez~=5.0
  • dbus
  • sbc
  • [Optional] ffmpeg(libavcodec>=58, libavutil>=56) >= 4.0
  • [Optional] fdk-aac(-free)>=0.1.5: pulseaudio-modules-bt use LC-AAC only
  • [Optional] ldacBT/libldac
  • cmake
  • pkg-config, libtool, ...

On Debian based distributions (like Ubuntu), you can install the make dependencies with:

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

Runtime Dependencies

  • pulseaudio ( force preopen disabled / built with --disable-force-preopen)
  • bluez
  • dbus
  • sbc
  • [ fdk-aac(-free) ]
  • [ libavcodec.so ]: APTX, APTX-HD support [Optional]
  • [ libldac ]: LDAC encoding support, LDAC ABR support [Optional]

Build

backup original pulseaudio bt modules

MODDIR=`pkg-config --variable=modlibexecdir libpulse`

sudo find $MODDIR -regex ".*\(bluez5\|bluetooth\).*\.so" -exec cp {} {}.bak \;

pull sources

Make sure to pull into a filesystem that supports colons (:) as valid characters in filename (see #144). Ext4 does, while NTFS does not.

git clone https://github.com/EHfive/pulseaudio-modules-bt.git
cd pulseaudio-modules-bt
git submodule update --init

install

A. build for PulseAudio releases (e.g., v12.0, v12.2, etc.)

git -C pa/ checkout v`pkg-config libpulse --modversion|sed 's/[^0-9.]*\([0-9.]*\).*/\1/'`

mkdir build && cd build
cmake ..
make
sudo make install

B. or build for PulseAudio git master

git -C pa/ checkout master
mkdir build && cd build
cmake -DFORCE_LARGEST_PA_VERSION=ON ..
make
sudo make install

Cmake A2DP codecs options: CODEC_APTX_FF, CODEC_APTX_HD_FF, CODEC_AAC_FDK, CODEC_LDAC

Load Modules

pulseaudio -k

# if pulseaudio not restart automatically, run
pulseaudio --start

if you got a warning like below, you need to rebuild pulseaudio with --disable-force-preopen flag

pulseaudio: symbol lookup error: pulseaudio: undefined symbol: pa_a2dp_codec_sbc

Connect device

Connect your bluetooth device and switch audio profile to 'A2DP Sink';

If there is only profile 'HSP/HFP' and 'off', disconnect and reconnect your device.

The issue has been fixed in bluez 5.51.

Module Arguments

module-bluez5-discover arg:a2dp_config

Encoders configurations

Key Value Desc Default
sbc_min_bp 2-250 minimum allowed bitpool auto
sbc_max_bp 2-250 maximum allowed bitpool, may not be < sbc_min_bp auto
sbc_freq 16k, 32k, 44k, 48k 16000/32000/44100/48000 Hz sample frequency auto
auto do not enforce sample frequency (default)
sbc_cmode mono mono channel-mode auto
dual dual channel-mode
stereo stereo channel-mode
joint_stereo joint stereo channel-mode
auto do not enforce channel-mode (default)
sbc_alloc snr use SNR bit-allocation algorithm auto
loudness use loudness bit-allocation algorithm
auto do not enforce bit-allocation algorithm (default)
sbc_sbands 4, 8 4 or 8 subbands auto
auto do not enforce subbands count (default)
sbc_blen 4, 8, 12, 16 4/8/12/16 audio blocks in one audio frame auto
auto do not enforce audio blocks count (default)
ldac_eqmid hq LDAC High Quality auto
sq LDAC Standard Quality
mq LDAC Mobile use Quality
auto /abr LDAC Adaptive Bit Rate
ldac_fmt s16 16-bit signed (little endian) auto
s24 24-bit signed
s32 32-bit signed
f32 32-bit float
auto Ref default-sample-format
ldac_abr_t1 <uint> safety threshold for LDACBT_EQMID_HQ and LDACBT_EQMID_SQ 2
ldac_abr_t2 <uint> threshold for dangerous trend of TxQueueDepth 4
ldac_abr_t3 <uint> threshold for critical TxQueueDepth status 6
aac_bitrate_mode [1, 5] Variable Bitrate (VBR) 0
0 Constant Bitrate (CBR)
aac_afterburner <on/off> Enable/Disable AAC encoder afterburner feature off
aac_fmt s16 16-bit signed (little endian) auto
s32 32-bit signed
auto Ref default-sample-format

Configure

edit /etc/pulse/default.pa

append arguments to 'load-module module-bluetooth-discover'

(module-bluetooth-discover pass all arguments to module-bluez5-discover)

# LDAC Standard Quality
load-module module-bluetooth-discover a2dp_config="ldac_eqmid=sq"

# LDAC High Quality; Force LDAC/PA PCM sample format as Float32LE
#load-module module-bluetooth-discover a2dp_config="ldac_eqmid=hq ldac_fmt=f32"

equivalent to commands below if you do not use 'module-bluetooth-discover'

load-module module-bluez5-discover a2dp_config="ldac_eqmid=sq"

#load-module module-bluez5-discover a2dp_config="ldac_eqmid=hq ldac_fmt=f32"

Others

see Wiki

TODO

add ldac abr (Adaptive Bit Rate) supprot

add APTX , APTX HD Codec support using ffmpeg

add AAC support using Fraunhofer FDK AAC codec library

add codec switching support using latest blueZ's experimental feature

Copyright

  pulseaudio-modules-bt

  Copyright (C) 2018-2019  Huang-Huang Bao

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].