Ubuntu – Video not playing in web browser with Bluetooth headphones connected. How to fix this

bluetoothheadphonesvideo

I have an Emby media server running on Ubuntu 16.04 on a home server.
I like to watch video on my laptop, running Ubuntu 16.10. Playback works as expected but when I try to watch with my Bluetooth headphones connected videos will not play.

If I run top on my server I can see that ffmpeg is maxing out the CPU:

6626 emby      20   0 1094264 348240  27820 R 181.2  4.3  10:46.21 ffmpeg

As soon as I quit trying to playback the video CPU usage drops back to an expected normal level.

If I disconnect the Bluetooth headphones, video playback immediately works OK and audio comes through the laptop built in speakers OK.

I usually use Firefox but I've tried Chrome, Chromium and Opera but they all exhibit the same behaviour when trying to play video with the headphones connected.

It appears the behaviour is not limited to my Emby media server, I've tried to play YouTube videos and they will not play either with the Bluetooth headphones connected.

The headphones and Emby video playback both work OK with my Android phone.

If I play the same video file from my server through VLC on my laptop, the video and audio work fine. This is a workaround but not my preference.

The problem seems to be related to playing video in a web browser with Bluetooth headphones connected. Can anyone help me get this working?

Best Answer

Sounds like the headset is in the wrong mode, pylovers a2dp.py script should get it working

wget https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae/archive/d698974910bbb7d016ec0ad08c1bf41b4b524364.zip
unzip d698974910bbb7d016ec0ad08c1bf41b4b524364.zip
mv ~/d68be364adac5f946887b85e6ed6e7ae-d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py .a2dp.py
chmod +x a2dp.py

Then just run ./a2dp.py If you have paired with more than one bluetooth device you will need to enter the number that corresponds with the headset in a list it will display.

You will likely have to run ./a2dp.py after reconnecting the device

Related Question