2013. február 14., csütörtök

A possible fix for choppy Bluetooth headset connection under KUbuntu

I tried some different Bluetooth headsets and transmitters with my laptops these weeks to have a low-cost, but satisfactory wireless audio experience. The initial trials were disappointing.

I use Koss Porta Pro for listening music and other contents, so it was a starting point to compare the quality. I bought a Sony DR-BT22A headset which was praised by several reviews and customers on Amazon, but it is quite bad quality compared to the Koss. I also bought a Rapoo H3010 wireless headset, which has almost the same quality like the Sony, but the headset+the transmitter are rechargable via USB, it lasts for several hours. The Rapoo's transmitter is connected to a sound source via a standard audio jack, so it is very handy to my home theater system where I don't expect high sound quality for movies; without losing a USB port.

What was a surprise that I tested a Nokia BH-214 transmitter and it is amazing. It is a Bluetooth headset/transmitter with some buttons and you can connect your favorite headphones to the transmitter. At this point, I did not have to deal with any compromise: I get exactly the same sound quality from this transmitter with the Koss Porta Pro instead of directly connecting the headphones to my laptops.

Ok, sound quality is fine, but my Ubuntu Oneiric did not work quite well with the Nokia transmitter. I could pair and connect the transmitter to my machine, but the connection becomes choppy/dropping audio packets after getting disconnected/reconnected because of distance or if I don't listen to something on the connection for a while. After disconnecting/reconnecting the transmitter manually, the connection is good again (except the volume is always dropped to maximum level :( ). The quick fix was to sketch a script to disconnect/reconnect the transmitter, fix the volume level and specify a shortcut in KDE to execute the script.

Note1: First time when you pair/connect your Nokia BH-214, you should change the Master channel in the KMix settings to the headset to control the transmitters sound level (later on KMix switches automatically on reconnection).
Note2: Something was wrong with the KMix by default and it tend to crash when the Bluetooth was used and the Amarok changed tracks. The fix was for me to install a newer version of KMix from a later Ubuntu version.

The script:

# Mute the master volume with KMix
qdbus org.kde.kmix /kmix/KMixWindow/actions/mute com.trolltech.Qt.QAction.trigger
# Disconnect the headset
sudo hcitool dc xx:xx:xx:xx:xx:xx
# Reconnect the headset with kdebluetooth
bluedevil-audio bluetooth://xx-xx-xx-xx-xx-xx
# Wait for a while to get the connection again
sleep 2
# Decrease the volume to reset the master volume from muted to the last level
qdbus org.kde.kmix /kmix/KMixWindow/actions/decrease_volume com.trolltech.Qt.QAction.trigger
# Increase back to the original level
qdbus org.kde.kmix /kmix/KMixWindow/actions/increase_volume com.trolltech.Qt.QAction.trigger



Nincsenek megjegyzések: