Auto-connecting Bluetooth via PulseAudio

NOTE: I think I’ve found a way to make sure this blog has regular postings; to document solutions I’ve discovered, so as not to forget it next time around.

Without further ado, here goes nothing:

I recently bought a Bluetooth stereo receiver, a Denon AVR-S510BT. As it’s intended to be an entry-level receiver, there’s not much in the way of included feature(s), like support for popular streaming services such as Pandora or Spotify, or even hardware connections like Ethernet; it only has Bluetooth connectivity, which for my purposes is perfect. I spend most of my time in my apartment, using a part of it for my home office. The distances involved are well within Bluetooth range (~30 ft). Testing has borne this out; connections are strong, with nary a dropout. For someone who really enjoys his music, once I get into a song, there’s nothing more frustrating than a dropout, or worse, a series of them.

My receiver is programmed to auto-connect to a bluetooth device upon startup, as the mode specified is Bluetooth. I have it automatically paired (trusted & authorized) to my Slackware computer. For playing my music, I use VLC, a handy, versatile player that has never failed me yet.

The problem was that for my receiver to successfully connect, I had to manually right-click the bluetooth icon in the system tray to pull up the app, then I would hit the ‘Connect’ button, then the receiver would proceed to connect. Which is all well and good, but this is something I would much rather see the computer automatically accomplish instead of myself. There’s a good reason that there’s a saying that goes, ‘Google is your best friend’.

Because it is.

One search, and I was able to connect to a forum site which gave me the solution. One that was rather simple; add a single line to a file.

I added the line:

load-module module-switch-on-connect

to the file /etc/pulse/

Now for the acid test.

I saved the changes to the file, and shut off my receiver. Next, I rebooted my computer. Once my computer came back up, I turned my receiver back on. Like clockwork, it automatically connected without the slightest intervention from yours truly.

Sometimes, it pays to be persistent; one never knows what solutions lurk out there in the dark byways of the Information Superhighway unless one looks and doesn’t give up easily.