A2DP agent for promiscuous/permissive audio sinc.

Overview

Promiscuous Bluetooth audio sinc

A2DP agent for promiscuous/permissive audio sinc for Linux. Once installed, a Bluetooth client, such as a smart phone, should be able to discover, pair, and subsequently play audio without any manual interaction. This is perfect for those with headless media boxes wanting to expand their connective options and saves explaining things to the kids 8)

This project assumes the use of PulseAudio and should be tested with PortAudio if required.

This project is heavily based on the Gist and comments at https://gist.github.com/mill1000/74c7473ee3b4a5b13f6325e9994ff84c#gistcomment-4032842

Caveats and roadmap

At this stage the Bluetooth device is hard coded, so please check that it matches your device. In the future such options should be set by a configuration file...

Installation

NOTE: This is very much a WIP, please comment on any additional steps required in your distro/version.

This documentation is based on my experience using Ubuntu 21.04.

Install required packages

Ensure that the required Bluetooth, Bluetooth audio, and Python 3 dependencies are installed.

sudo apt install pulseaudio-module-bluetooth bluez

Ensure Bluetooth is always discoverable

If you are using a desktop version of your OS, ensure that Bluetooth is set to visible.

Alternatively you can set the DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf to 0

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

NOTE: The above steps were not required for me.

Install the A2DP Bluetooth agent

A Bluetooth agent is a piece of software that handles pairing and authorization of Bluetooth devices. The following agent allows a client to automatically pair and accept A2DP connections from Bluetooth devices. All other Bluetooth services are rejected.

Copy the included file a2dp-agent to /usr/local/bin and make the file executable with

sudo cp -a a2dp-agent /usr/local/bin/
sudo chmod +x /usr/local/bin/a2dp-agent

Testing the agent

Before continuing, verify that the agent is functional. Bluetooth audio should be discoverable, pairable and recognised as an audio device.

  1. Manually run the agent by executing
sudo /usr/local/bin/a2dp-agent
  1. Attempt to pair and connect with using your phone or computer. You will be asked to verify a pairing key, just accept it and move on.
  2. Check on the client which profiles are available. SBC is likely your best choice quality wise. If you do not see any services then something has gone wrong 8(
  3. The agent should output the accepted and rejected Bluetooth UUIDs
Setting device to 'discoverable' and 'pairable'...
Agent registered
RequestConfirmation (/org/bluez/hci0/dev_04_B1_67_56_62_C3, 263837)
Auto confirming...
AuthorizeService (/org/bluez/hci0/dev_04_B1_67_56_62_C3, 0000110d-0000-1000-8000-00805f9b34fb)
Authorized A2DP Service

Play some audio on the client device, you should hear or see something happening on the server side 8)

Install the A2DP Bluetooth Agent as a service

To make the A2DP Bluetooth Agent run on boot copy the included file bt-agent-a2dp.service to /etc/systemd/system. Now run the following command to enable the A2DP Agent service

sudo cp -a bt-agent-a2dp.service /etc/systemd/system/
sudo systemctl enable bt-agent-a2dp.service
sudo systemctl start bt-agent-a2dp.service
systemctl status bt-agent-a2dp.service

The status should show green:

● bt-agent-a2dp.service - A2DP Bluetooth Agent
     Loaded: loaded (/etc/systemd/system/bt-agent-a2dp.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-01-19 10:26:30 NZDT; 1s ago
   Main PID: 17527 (python3)
      Tasks: 2 (limit: 18760)
     Memory: 8.9M
        CPU: 55ms
     CGroup: /system.slice/bt-agent-a2dp.service
             └─17527 /usr/bin/python3 -u /usr/local/bin/a2dp-agent

You can follow the logs of the agent with:

journalctl -fu bt-agent-a2dp.service

Higher quality audio

SBC has a bad reputation compared with other codes, but it turns out that good old SBC has a dual channel mode which can be enabled in the Developer options in recent LineageOS based Android phones. See Bluetooth SBC Dual Channel HD audio mode – LineageOS – LineageOS Android Distribution for a breakdown.

Owner
Jasper Aorangi
Jasper Aorangi
MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling

MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling Demos | Blog Post | Colab Notebook | Paper | MIDI-DDSP is a hierarchical

Magenta 239 Jan 03, 2023
MelGAN test on audio decoding

Official repository for the paper MelGAN: Generative Adversarial Networks for Conditional Waveform Synthesis The original work URL: https://github.com

Jurio 1 Apr 29, 2022
Simple discord bot by @merive 🤖

Parzibot Powerful and Useful Discord Bot on Python. The source code of the bot is available to everyone. Parzibot uses English language. This is free

merive_ 3 Dec 28, 2022
Delta TTA(Text To Audio) SoftWare

Text-To-Audio-Windows Delta TTA(Text To Audio) SoftWare Info You Can Use It For Convert Your Text To Audio File You Just Write Your Text And Your End

Delta Inc. 2 Dec 14, 2021
Speech Algorithms Collections

Speech Algorithms Collections

Ryuk 498 Jan 06, 2023
Cobra is a highly-accurate and lightweight voice activity detection (VAD) engine.

On-device voice activity detection (VAD) powered by deep learning.

Picovoice 88 Dec 16, 2022
Anki vector Music ❤ is the best and only Telegram VC player with playlists, Multi Playback, Channel play and more

Anki Vector Music 🎵 A bot that can play music on Telegram Group and Channel Voice Chats Available on telegram as @Anki Vector Music Features 🔥 Thumb

Damantha Jasinghe 12 Nov 12, 2022
A2DP agent for promiscuous/permissive audio sinc.

Promiscuous Bluetooth audio sinc A2DP agent for promiscuous/permissive audio sinc for Linux. Once installed, a Bluetooth client, such as a smart phone

Jasper Aorangi 4 May 27, 2022
pedalboard is a Python library for adding effects to audio.

pedalboard is a Python library for adding effects to audio. It supports a number of common audio effects out of the box, and also allows the use of VST3® and Audio Unit plugin formats for third-party

Spotify 3.9k Jan 02, 2023
Mopidy is an extensible music server written in Python

Mopidy Mopidy is an extensible music server written in Python. Mopidy plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. Y

Mopidy 7.6k Jan 05, 2023
Algorithmic Multi-Instrumental MIDI Continuation Implementation

Matchmaker Algorithmic Multi-Instrumental MIDI Continuation Implementation Taming large-scale MIDI datasets with algorithms This is a WIP so please ch

Alex 2 Mar 11, 2022
a library for audio and music analysis

aubio aubio is a library to label music and sounds. It listens to audio signals and attempts to detect events. For instance, when a drum is hit, at wh

aubio 2.9k Dec 30, 2022
Carnatic Notes Predictor for audio files

Carnatic Notes Predictor for audio files Link for live application: https://share.streamlit.io/pradeepak1/carnatic-notes-predictor-for-audio-files/mai

1 Nov 06, 2021
Spotifyd - An open source Spotify client running as a UNIX daemon.

Spotifyd An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and sup

8.5k Jan 09, 2023
In this project we can see how we can generate automatic music using character RNN.

Automatic Music Genaration Table of Contents Project Description Approach towards the problem Limitations Libraries Used Summary Applications Referenc

Pronay Ghosh 2 May 27, 2022
Music player - endlessly plays your music

Music player First, if you wonder about what is supposed to be a music player or what makes a music player different from a simple media player, read

Albert Zeyer 482 Dec 19, 2022
Learn chords with your MIDI keyboard !

miditeach miditeach is a music learning tool that can be used to practice your chords skills with a midi keyboard 🎹 ! Features Midi keyboard input se

Alexis LOUIS 3 Oct 20, 2021
Speech recognition module for Python, supporting several engines and APIs, online and offline.

SpeechRecognition Library for performing speech recognition, with support for several engines and APIs, online and offline. Speech recognition engine/

Anthony Zhang 6.7k Jan 08, 2023
Mousai is a simple application that can identify song like Shazam

Mousai is a simple application that can identify song like Shazam. It saves the artist, album, and title of the identified song in a JSON file.

Dave Patrick 662 Jan 07, 2023
𝙰 𝙼𝚞𝚜𝚒𝚌 𝙱𝚘𝚝 𝙲𝚛𝚎𝚊𝚝𝚎𝚍 𝙱𝚢 𝚃𝚎𝚊𝚖𝙳𝚕𝚝 💖

TeamDltmusic 𝙰 𝙼𝚞𝚜𝚒𝚌 𝙱𝚘𝚝 𝙲𝚛𝚎𝚊𝚝𝚎𝚍 𝙱𝚢 𝚃𝚎𝚊𝚖𝙳𝚕𝚝 💖 Deploy String Session String Click hear you can find string session OR join He

TeamDlt 5 Jan 18, 2022