If it ain’t broke…

What happened to me today as I was messing around on my system is a perfect example of the wisdom of the old saying. For example…

I had a nostalgic feel for my Unicomp Model M keyboard, so I thought I’d re-purpose my Corsair Vengeance K65 Gaming Keyboard to my laptop. Keep in mind, however, that I had a perfectly working bluetooth setup, and that, along with my keyboard and mouse, worked through USB. My Unicomp, however, has a legacy PS/2 connector. Which, in theory, shouldn’t have been a problem. Just substitute the Unicomp for the Corsair. Right? WRONG!! Using a legacy connector turned out to introduce all sorts of lag to my system, which has communication layers like this: Audio–>PulseAudio–>Bluetooth.

In order for this system to work flawlessly, the same bus (USB) has to be used; legacy connections are a NO-NO. This has to do with the way Linux routes communications from the system peripherals. From what I’ve been able to gather, the PS/2 connector introduces major amounts of lag; I’ve not measured, but if I start a song via VLC, and then press stop, it will take 1-3 seconds for the sound to actually stop. Not an acceptable solution.

I only discovered this by logical reasoning, after messing around with certain system files, files which previously had worked without issue. When I met with failure time and time again, I sat back and thought about it. Then it made perfect sense.

Only after re-swapping the Corsair for the Unicomp, did my system return to its previously perfect working order. This was a humiliating lesson for me, one which I, in retrospect, should have known was going to happen, but frequently as happens with us humans, doesn’t become painfully clear until after the lesson has been taught.

Moral of the story: Don’t mess with your system, even if you think you have good reason to do so, unless first you assess why your system works the way it does, and then make the adjustment only if you’re sure the adjustment will not bork your system’s performance.


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/default.pa.

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.