Rhythmbox
Griffin PowerMate and Rhythmbox
Submitted by ckdake on Tue, 2008-06-03 17:25I was going through some drawers and stumbled across my good old Griffin PowerMate that I got back before I started using Linux. It controlled iTunes in Mac OS 10.1 and was great because I could change volume and pause music without having to change programs or anything. These days I use Rhythmbox in Linux to listen to music and theres not a plugin for it. Yet!
Rhythmbox supports plugins written in python, a guy has some skeleton python code for talking to the powermate, and that means something could work out!
I got the powermate working by compiling and loading the powermate module for 2.6 linux kernels (In 2.6.23 it's in Device Drivers -> Input device support -> Miscellaneous devices -> Griffin PowerMate and Contour Jog support), adding a udev.d entry:
# /etc/udev/rules.d/45-powermate.rules
KERNEL=="event*", SYSFS{product}=="Griffin PowerMate", NAME="powermate", GROUP="users", MODE="0660"
I plugged it in, catted /dev/powermate, and with each twist or push it spit out garbage to the screen. Success!
A quick glance through everything shows that Rhythmbox doesn't support threads and the python code here uses polling so I'd need to delve into the Rhythmbox docs to figure out the best way to do that, but Rhythmbox also exposes itself through DBus and there are some examples of using this around the internet. In a few minutes, I hacked together something dirty to cover the basics and perhaps later on I'll make something that works as a Rhythmbox module. Right now pushing the button is play/pause, turning it adjusts the volume, and the LED shows volume when playing and pulses slowly when paused. Here ya go:
#!/usr/bin/python
import powermate
import dbus
EVENT_BUTTON_PRESS = 1
EVENT_RELATIVE_MOTION = 2
DBUS_START_REPLY_SUCCESS = 1
DBUS_START_REPLY_ALREADY_RUNNING = 2
bus = dbus.SessionBus()
(success, status) = bus.start_service_by_name('org.gnome.Rhythmbox')
proxy_obj = bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')
player = dbus.Interface(proxy_obj, 'org.gnome.Rhythmbox.Player')
pm = powermate.PowerMate("/dev/powermate")
while 1:
event = pm.WaitForEvent(-1)
if (event[2] == EVENT_BUTTON_PRESS and event[4] == 0):
player.playPause(1)
if player.getPlaying():
pm.SetLEDState((int)(player.getVolume() * 255), 0, 0, 0, 0)
else:
pm.SetLEDState(255, 252, 1, 1, 1);
elif (event[2] == EVENT_RELATIVE_MOTION and player.getPlaying()):
player.setVolumeRelative(event[4] * 0.02)
pm.SetLEDState((int)(player.getVolume() * 255), 0, 0, 0, 0)
Download powermate.py and the code above, save the code above as whatever.py, run it, and you'll be able to control rhythmbox with your PowerMate in Linux!
Speakers, Music, and Music playing software
Submitted by ckdake on Sun, 2006-03-26 15:17Something very weird happened this morning. I was checking email and all that sort of thing and turned on some music but there was no sound coming out of the sub. It was working fine yesterday and its a pretty nice setup so that was just odd. The sub has two cones in it and neither one was moving at all. I moved around some wires on my computer yesterday and plugged a paper shredder into the same outlet so i thought that might be related somehow so I plugged the line in into my ipod and put it on a different circut. Still no bass. Next step was opening the thing up and checking resistance across the speakers and driver circuits on the amp for it. (It's a BASH amp and it's pretty neat looking compared to a lot of other amps I've taken apart) Everything looked fine, but I notice that one of the wires to one of the cones was actually unplugged! I plugged it back in, plugged the power back in and it worked. How on earth did that one wire behind 9 screws unplug itself sometime when I was asleep? Crazy.Back to listening to the new Thrice CD: Vheissu. It's amazing and "Atlantic" on it may now be in the top 25 songs for me.Additionally I am no longer using Rhythmbox to play music. There's apparently a bug that causes gamin (A tool that informs userspace applications when a file on the filesystem changes using the inotify support in the kernel instead of constantly polling the directory for changes like the old "famd" did) to use up lots of cpu when Rhythmbox is running. The possible bugfix to completely disable music library monitoring is in CVS for them but hasn't made it into a release yet apparently, so hopefully 0.9.4 or 1.0 will fix it. We'll see. I'd like to keep using it as it has pretty good integration with Gnome and will mesh with my iPod nicely when support for that makes it into a release. Also, Songbird isn't out yet but if they get Linux support before Rhythmbox puts out another update, it may be time for a switch.
Bike wrecks and Fish among other things
Submitted by ckdake on Fri, 2006-03-10 09:31So basically, a SUV pulled out in front of me forcing me to turn sharply on the bike and end result is everything is fine by my laptop which isn't really fine. With laptop and Mac OS X gone, I'm now using Linux on the desktop for eveything. I got an awesome deal on a new dell 24" widescreen monitor and have been finding software replacements. F-Spot is a fan-friggin-tastic photo management app for Linux. It handles my 11k+ pictures with no problem and playce niceley with Canon RAW images. It also has inspired me to tag the people in all of my pictures and I've slowly put a big dent in that. F-Spot even exports directly to Gallery. Cool. To replace iTunes, I'm using Rhythmbox. It's not quiiite nice enough yet, but it'll do. It has built in support for Last.fm so my profile there is back to updating again, and iPod support in in CVS so I hear. iCal has been replaced by the calendar component of Evolution and I've switched from using Thunderbird for e-mail to the Mail component of Evolution. This has been a bit of a rocky road, but it's getting there. Spam filtering in Evolution doesn't seem as powerful and the calendar has some quirks, but all and all it's better than the disjoined thing I had going on with email in Thunderbird on Linux and events in iCal on the Mac. Bluetooth is working in Linux and I just need to get my phone synching with Evolution, and next time a video project rolls around I'll need to see how Kino works.In other news I now have a fish (Thanks Laura!). He's a Beta and his name is Stinky. One of my server's had now been turned on for close to 250 days with no problems. (see it's phpsysinfo page) Gallery 2.1 is about to be out. I'm working on the backend of a super cool website that will go live on April 1st: CollegeMedium.com. I got a bunch of free prints at Shutterfly from codes I found on SlickDeals. Pictures from the 10D at 8x10 look fantastic and now I just have to figure out where to hang them up. And, partialy thanks to the ever growing popularity of Faster Mustache (now up to over 1000 topic and 11000 comments), Critical Mass Atlanta is continuing to grow and take over downtown the last friday of every month.Lastly, I head back yesterday that Georgia Tech has accepted me into their Graduate program for a Masters in Computer Science. I still have an interview at Emory for their program, but it's looking like I get to delay the inevitable atleast another two years and classes will start this Fall.

