Bluetooth headphones headache in Linux: a trick with a2dp.py

If you ever used your bluetooth headphones in Linux you most likely noticed an annoying issue that the headphones are detected successfully, but the sound still not working correctly.

This problem has been discussed numerous times and I found recently a very useful post that helps to address the problem.

It seems like the solution is pretty easy – simply download the script a2dp.py from github and execute it using command line like so:

./a2dp.py

I noticed, however, that this does not always help and a2dp needs to be executed one more time for the headphones to work. In order to address the problem one may simply create a tiny script that will execute ./a2dp.py until it resolves the problem:

#!/bin/bash

keyword='"Enjoy" the HiFi stereo music :)'

while :
do
  result=$(./a2dp.py | grep "$keyword")
  if [ "$keyword" == "$result" ]
  then
    echo "correct - $result"
    break 
  fi
  echo "wrong - $result"
done

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Identify yourself * Time limit is exhausted. Please reload CAPTCHA.