Bluetooth headphones headache in Linux: a trick with

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 from github and execute it using command line like so:


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 ./ until it resolves the problem:


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

while :
  result=$(./ | grep "$keyword")
  if [ "$keyword" == "$result" ]
    echo "correct - $result"
  echo "wrong - $result"

Update: I’ve created a small project on github to host this script:



  1. Hello Abhilash Gupta,

    1. Go to

    2. Click on the green button “Clone or download”

    3. Download zip

    4. Unzip the file

    5. Go to

    6. Click “Download ZIP”

    7. Save and unzip

    8. Now you have downloaded two zip files. Make sure that files and are in the same folder

    9. Connect your bluetooth headphones

    10. Once headphones connected, open terminal and navigate to the place where you stored the files

    11. Execute like so:


Leave a Reply

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