2011-09-09

Logitech Harmony Universal Remote Linux Software Support

On a friend’s recommendation, I purchased a Logitech Harmony universal remote. Some quick searching online suggested that the unofficial community Linux support for this device was decent.

It took a bit of extra futzing around to get it working under Linux (Fedora 14 in my case), but I got there in the end. Amazingly it supports all my devices (TV, PVR, DVD, RX) despite some of them being ancient and obscure, for example a cheap and cheerful Telefunken DVD player.

Logitech has a web site for configuring and downloading the settings needed to control up to five of your AV devices with the Harmony remote. Unfortunately, the current configuration site balks with an ‘unsupported operating system’ / missing plugin error when visited from a browser running on Linux. Time to head off the beaten track…

The ‘congruity’ package provides a graphical setup for the Logitech Harmony. The process still involves configuring the device from a Logitech website, but at an alternative URL, and some preparation is required:

  1. Install the ‘congruity’ package. In Fedora: sudo yum install congruity
  2. Configure the web browser to ask what to do with download links. In Firefox: Edit->Preferences->General->Downloads->Always ask me where to save files

Now go through the following process:

  1. Plug in the remote via the provided USB cable.
  2. Visit the URL mentioned above.
  3. Create an account (why do I need to provide my name to program a remote control?)
  4. Skip/ignore the “you need to update your software” steps, and eventually a download prompt appears.
  5. Choosing ‘open’ rather than ‘save’ impressively results in the Congruity graphical setup up launching.
  6. Step through the setup boxes as prompted.

However, in my case the remote control detection phrase failed. This was overcome by updating the concordance package from 0.21 to 0.23 and trying again. See further below for the sordid details.

I was then able to select my four devices and program the Harmony remote control unit.

I encountered some teething issues when attempting some tasks with the remote, e.g. the wrong AV input was selected on the TV or the DVD player wouldn’t switch off, but I pressed the ‘help’ button on the remote and it tried some things and made it work!

The only thing I couldn’t get to work was changing the band (AM/FM) on the radio tuner of the AV receiver (Yamaha RX-V361).

Now, provided the devices are in standby mode, it is a one touch action to have everything setup to watch TV, then another to watch a DVD and so on. This saves a lot of fiddling and lengthy explanations to visitors of how correctly set all the various remotes to watch TV, not to mention removing some clutter.

It’s a shame that the Linux configuration is not smoother. Perhaps it could work better by separating out the concordance device identification data, and provide a mechanism for updating that alone, without having to recompile or rebuild the whole package.

It’s also a bit unsettling that future reprogramming of the remote is dependent on Logitech’s website being operational. It feels all too inevitable that bit-rot will set in once Logitech’s priorities shift onto newer products.

Nevertheless, it’s working just well enough for now.

Sordid details:

In different attempts the following errors occurred during the detection phase within the Congruity graphical app:

LibConcordException: libconcord function 'init_concord' failed with error code 11 ('Error connecting or finding the remote')

…and…

LibConcordException: libconcord function 'get_identity' failed with error code 1 ('Unknown error')

Now for the investigative diagnostics:

Running the ‘concordance’ command line app to display detected info also failed to find the device in my case: sudo concordance -i

Concordance 0.21
Copyright 2007 Kevin Timmerman and Phil Dibowitz
This software is distributed under the GPLv3.

ERROR: failed to requesting identity
Requesting Identity: Failed with error 1

Digging a bit deeper reveals the relevant USB device ID information, and shows that at some level the operating system is aware of the device:

lsusb | grep -i logitech

Bus 005 Device 006: ID 046d:c122 Logitech, Inc. Harmony 700 Remote

dmesg

[ 8041.000104] usb 5-1: new full speed USB device using uhci_hcd and address 6
[ 8042.176170] usb 5-1: New USB device found, idVendor=046d, idProduct=c122
[ 8042.176181] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 8042.176189] usb 5-1: Product: Harmony Remote 0-0.2.0
[ 8042.176195] usb 5-1: Manufacturer: Harmony Remote 0-0.2.0

Interestingly, while my particular unit was marketed as a “Logitech Harmony 600 Five-In-One Universal Remote”, lsusb reports it as a Logitech Harmony 700 Remote.

Some web searching turned up a useful thread on troubleshooting Harmony software setup with Congruity and Concordance:

i had the same problem.
I bought a Harmony 650, and concordance (0.21) doesnt detect it.
Easy solution: install concordance 0.23″

Now, I tend to prefer the clean solution to the easy one. In Fedora that involves building and upgrading relevant RPM packages (as opposed to downloading the tarball and doing a make install as root, which doesn’t have the traceability that RPM packaging gives).

Here is an outline of the steps:

  1. Remove the existing packages to avoid conflicts later on: sudo yum remove congruity
  2. Install build dependencies: sudo yum install libusb-devel python-devel
  3. Download standard Fedora source packages for libconcord and concordance in order to get the .spec files: yumdownloader --source --disablerepo=ifedora --enablerepo=fedora libconcord concordance
  4. Download the concordance-0.23.tar.bz source tarball in a web browser.
  5. Edit libconcord.spec and comment out the patch lines, and replace references to version 0.21 with 0.23:
    #Patch0: libconcord-0.21-mime-type-def.patch
    #%patch0 -p1
    # Comment out mime file
    #%{_datadir}/mime/packages/%{name}.xml
    

    The patch lines need to be removed to avoid errors during the rpmbuild phase like the following:

    Reversed (or previously applied) patch detected!  Assume -R? [n] n
    
    RPM build errors:
        File not found: /home/makerpm/rpmbuild/BUILDROOT/libconcord-0.23-1.fc14.x86_64/usr/share/mime/packages/libconcord.xml
    
  6. Change to “makerpm” user su - makerpm and copy the spec files in the SPECS directory and the tarball into the SOURCES directory.
  7. Build the libconcord rpm package: rpmbuild -ba libconcord.spec
  8. Install the generated rpm: sudo yum localinstall --nogpgcheck /home/makerpm/rpmbuild/RPMS/x86_64/libconcord-python-0.23-1.fc14.x86_64.rpm
    If this is not done at this point then the latter rpm building will fail with something like:

    error: Failed build dependencies:
    	libconcord-devel >= 0.23 is needed by concordance-0.23-1.fc14.x86_64
    
  9. Edit concordance.spec and change all occurrences of the version 0.21 to 0.23
  10. Build the concordance rpm package: rpmbuild -ba SPECS/concordance.spec
  11. Install the resultant packages: yum localinstall --nogpgcheck /home/makerpm/rpmbuild/RPMS/x86_64/libconcord-python-0.23-1.fc14.x86_64.rpm
    yum localinstall --nogpgcheck /home/makerpm/rpmbuild/RPMS/x86_64/concordance-0.23-1.fc14.x86_64.rpm
  12. Install congruity again, now that the backend has been upgraded: sudo yum install congruity

Note that I’ve missed some steps above, e.g. some variant of rpmbuild --rebuild xyz.srpm which is left as an exercise for the reader.

Now the concordance tool will be cleanly installed and should show up the device:

[root@orange etc]# concordance -i
Concordance 0.23
Copyright 2007 Kevin Timmerman and Phil Dibowitz
This software is distributed under the GPLv3.

Requesting Identity: 100%                 done
  Model: Logitech Harmony 700 (Molson)
  Firmware Version: 0.2
  Hardware Version: 1.1
  Config Flash Used: 12% (473 of 3904 KiB)

The Ubuntu forum thread also mentioned the following which may be required in some cases:
echo 'SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c122", MODE="666"' |tee /etc/udev/rules.d/custom-concordance.rules
Also tried changing SYSFS to ATTR, based on warnings in /var/log/messages

At this point, the web configuration steps outlined earlier in the post should work, with congruity successfully detecting the Harmony remote, allowing subsequent software setup.

Filed under: AV,fedora,linux,remote controls — admin @ 23:16

2009-04-05

NTSC to PAL DVD conversion in Linux

I needed to convert a home-made video (well slide-show with soundtrack really) that was sent over from the USA. Attempting to play this on a PAL-only TV results in unwatchable flickering monochrome output. Based on some instructions for DVD format conversion I was able to convert the NTSC disc to PAL using the steps listed below. This was on a Fedora 10 system with the rpmfusion repos installed.

# Note: about 1.3GB of workspace was required to generate 170MB output, in this case a short slide show with sound track.
# 

yum install vobcopy mjpegtools dvdauthor
mkdir video_work
cd video_work
vobcopy -l
mkfifo stream.yuv
mplayer -ao null -noframedrop -vo yuv4mpeg VIDEONAME.vob &
cat stream.yuv|yuvfps -r25:1|yuvscaler -n p -O DVD |mpeg2enc -n p -f 8 -F 3 -o out.m2v
mplayer -ao pcm -vo null -vc dummy VIDEONAME.vob
# Note: 224000 bits per second (224kbits/sec)
ffmpeg -ab 224000 -ac 2 -ar 48000 -i audiodump.wav audiodump.ac3
mplex -f 8 -o ready-to-master.mpg out.m2v audiodump.ac3
mkdir dvdauthor_out
cat << EOF > dvdauthor.xml
<dvdauthor dest="/data_dir/video_work/dvdauthor_out">
<vmgm>
</vmgm>
<titleset>
<titles>
<video />
<pgc>
<vob file="ready-to-master.mpg" />
</pgc>
</titles>
</titleset>
</dvdauthor>
EOF
dvdauthor -x dvdauthor.xml
growisofs -Z /dev/dvd -dvd-video dvdauthor_out
Filed under: AV,fedora,linux — twegener @ 16:23

2009-02-20

How to program remote control codes for Yamaha AV Receivers

These instructions are for programming a Yamaha RX-V361 AV receiver remote control so it can control a Panasonic TV:

  1. Press and hold the DTV/CBL input button on the remote
  2. While still holding that button press and hold the AV POWER button for about 3 seconds – long enough for the DTV/CBL message to go away and the sound setting to be displayed (e.g. Music Enh. 2ch). If you don’t hold it down long enough it will say “RemoteSetup NG”. In that case, try again. If you are successful it will just display the sound setting.
  3. Enter the four-digit code using the green numeric buttons at the bottom of the remote. The code for the TV is found in the back of the AV receiver manual, which can be found online. After the fourth button is pressed the display should say “RemoteSetup OK”. The first number listed for Panasonic worked for me for an old CRT TV.
  4. The TV POWER button on the Yamaha remote should now turn on/off the TV (provided the standby button on the TV is already depressed). Other buttons should also work, e.g. TV INPUT, TV MUTE, TV CH, TV VOL, etc.

Key points that are not made clear in the manual: you must use the DTV/CBL input when programming the remote to control a TV (you don’t need to have this input selected to control the TV once it is programmed though); the RemoteSetup NG/OK/display stuff as outlined above.

This took me a while to get right the first time, and I neglected to write it down. Hopefully this will help someone out.

Filed under: AV,remote controls — twegener @ 21:22

2009-02-05

When maemoscrobbler seems to be stuck…

My N800 was running off-line for quite a while. During this time I’d listened to a bunch of songs with Kagu and was hoping that it would immediately scrobble them to last.fm as soon as I went online. After much fiddling around, I discovered that you must play another song in Kagu while online, in order to launch scrobblerd (via dbus). This, in turn, submits all the tracks queued for scrobbling while offline via maemoscrobbler.

I found some helpful maemoscrobbler tips in this #maemo IRC log.

Filed under: maemo,N800 — twegener @ 0:06

2008-11-27

LightScribe – meh

One of tonight’s tasks was to burn a freshly downloaded Fedora 10 DVD ISO image. My dad gave me some blank LightScribe DVDs a while back, so I thought I’d give them a try, not having done so before.

After a quick look around it appears the only LightScribe labelling software available for Linux is proprietary. LaCie provide the software in RPM packages which is nice if you are a Fedora user like me. (Apparently they have tested it with the other major distros, which is nice to see.) It installed fine under Fedora 10 beta, which was a nice surprise given that it was apparently written for Fedora 5. It didn’t install a menu entry, but firing up the “LaCie Lightscribe Labeller”, ’4L-gui’, provided a reasonably nice experience.

I grabbed some DVD media artwork from the Fedora art team. There were two labels in each image file, so I had to pick one and chop it in half with the GIMP. I then cropped it to remove the alignment patterns, and then did an autocrop to crop to the edge of the DVD label. Then it was a simple matter of importing it in the 4L-gui and selecting ‘fit image height to disc’.

Writing the disc label took a bewilderingly long 15 minutes. I suppose it is effectively doing the same thing as burning a CD, but it’s a big wait for little reward. The inscribed label is a hazy monochrome image that is below the surface of the disc.

In future I think I’ll just use a pen. Nevertheless, it’s interesting to the see the improvement in the quality of Linux software provided by a hardware vendor. It would be even better if they would free the code. This would enable distros to incorporate the software into the main repos, making the experience a bit more streamlined and integrated.

Filed under: fedora,linux — twegener @ 20:28

2008-03-06

Sorting package version strings

Interesting less trivial than expected problem (solved): sorting package version numbers:

import re
import rpm

def get_package_version(name):
    """Return version string of installed package."""

    # note: ts can take an argument that is the root of the installation
    #       typically with a var/lib/rpm directory underneath it.
    transaction_set = rpm.ts()

    versions = [header['provideversion'][0]
                for header in transaction_set.dbMatch('name', name)]
    versions.sort(cmp_versions)
    return versions

def version2sortable(version):

    parts = re.split(r'(\d+)', version)
    fields = []
    for part in parts:
        try:
            part = int(part)
        except ValueError:
            pass
        fields.append(part)
    return tuple(fields)

def cmp_versions(a, b):

    return cmp(version2sortable(a), version2sortable(b))

if __name__ == '__main__':
    print get_package_version('kernel')

Output:

['2.6.23.8-63.fc8', '2.6.23.9-85.fc8', '2.6.23.14-107.fc8', '2.6.23.14-115.fc8', '2.6.23.15-137.fc8']

Note: WordPress is screwing up the markup on the code blocks above. If you have any tips on how to fix this please drop me a line.
Update: Using pre/blockquote hack for now and will try out a code highlighter plug-in when I get the chance. Thanks Tim and Lindsay! :-)

Filed under: fedora,Python — twegener @ 22:04

2008-02-09

Exaile volume problem in OS2008 fixed

I finally got around to looking at the problem tonight. The fix was very simple. My apologies for not addressing this sooner!

Get the updated .deb.

The problem was due to the volume range on the original Exaile going from 0-1. For some reason on maemo (OS2008) the volume range is 0-10. According to the gstreamer volume control docs the range should be 0-10, so I’m not sure why the original Exaile works properly on my desktop machine.

Anyway, I mainly use Kagu and Vagalume for music on my N800 these days. As a result I haven’t done anything on maemo Exaile for ages. I hope to one of these days, though.

Filed under: exaile,maemo,N800 — twegener @ 23:34

2007-12-11

Nokia vs Ogg

It’s lovely to see Nokia embracing “Web 2.0″…

You can participate too, with a related issue. Help convince Nokia to provide out-of-the-box support for Ogg Vorbis:

  • Vote for bug 176
  • PledgeBank (* I haven’t pledged – sticking with my N800)
  • The organization responsible for the Ogg formats have provided a template for writing a letter to Nokia

According to Nokia’s Ari Jaaksi, some time ago, “There’s nothing technical that prevents it. However, the 770 is a consumer device. The challenge is that there is not much [Ogg Vorbis and Ogg Theora] content right now.“.
I hope Wikipedia qualifies as “content”, not to mention personal music collections.

Meanwhile, the intrepid Tuomas Kulve has released a new version of ogg-support for maemo that enables the built-in media player to play Ogg Vorbis files. He notes, “It’s untrivial to get everything working properly as the FileManager, the Metalayer Crawler, and the Media Player are all close source applications and their behaviour is not really documented anywhere.” Hopefully this situation will change.

See also:

Filed under: Freedom,maemo — twegener @ 23:26

2007-12-08

Updating the N800 to OS2008

Here are my notes from updating to OS2008 for getting root access via ssh and taking an early snapshot of the image filesystem with rsync:

  1. Download the OS2008 firmware image.
  2. Follow the instructions for flashing with new firmware image
  3. Go to Settings->Application Manager and go to Tools->Application Catalog and enable the Maemo Extras repo
  4. Click ‘Browse installable applications’ and inst the OpenSSH package
  5. Repeat the flasher steps but replace the flash command line with flasher/flasher-3.0 --enable-rd-mode to enable R&D mode
  6. Go to Utilities->X terminal and do sshroot@localhost
  7. Change the default password: passwd
  8. Repeat the flasher steps but replace the flash command line with flasher/flasher-3.0 --disable-rd-mode to put the tablet back into production mode
  9. Install rsync from the .deb package
  10. Take a snapshot of the root file system by using rsync to copy from the device to another machine: rsync -avzx root@:/ snapshot_dir
  11. Follow the instructions for entering Red Pill Mode
  12. Install apps such as less, screen, wget
  13. Return to Blue Pill Mode

The tips needed to get ssh root access working again mainly came from here.

Most of my previously installed packages in OS2007 are already available for OS2008. The main ones that I am still missing are gtick (metronome) and a UPnP client. IIRC, I grabbed everything form the official maemo downloads page and this list of Working 2008 OS Software.

Impressions:

  • This update increases the maximum CPU clock speed from 330MHz to 400MHz. The graphical interface feels snappier.
  • The browser is now the mozilla-based microb browser which seems to use more memory and slightly slower than the previous Opera browser. However, it’s free software and supports newer web standards, so I’m happy with the change.
  • The graphical interface is nicer. The designers appear to have responded to user feedback well in this area.
  • There are more codecs , but still no Ogg Vorbis support, which is very disappointing. The third-party package works fine with third-party media players, but doesn’t work with the default media player.
  • Media streaming on the ABC now works. Among other things, this means I can listen to the local radio station from anywhere, and not have to suffer crappy AM quality. Annoyingly, when playing Internet radio from the widget it keeps a message box open (“buffering”) for as long as I have it playing.
  • I haven’t done any careful measurements of the battery life, but it seems to be about the same. This is a bonus given the increase in CPU speed.
  • Newer kernel (2.6.21), Gtk (2.10) and DBUS (1.0) and gstreamer now supports the generic playbin,
  • The built-in media player has been substantially improved, but without Vorbis support it’s of limited use to me. I prefer to use Kagu or Exaile.
  • Why is there still no support for recording videos in the camera app?
  • The problem where, if Bluetooth is disabled from the system tray, the Bluetooth icon disappears, so must be re-enabled from Control Panel, still persists. Annoying.
  • Text prediction and automatic capitalization are off by default.
  • The on-screen keyboard seems to be a bit over-sensitive and often registers a key twice when it was only tapped once.

With this update, it feels like the Internet tablet OS platform is maturing nicely.

Filed under: maemo,N800 — twegener @ 23:35

2007-12-05

Exaile for maemo 4.0 (OS2008)

I’ve made a new release of Exaile for maemo 4.0 (i.e. OS2008, chinook). This drops a bunch of backward compatibility patches needed for OS2007, and takes advantage of some gtk 2.10 features. Also, there was a bug in the gtk shipped with OS2007 that prevented activating items in the sidebar. This has gone away, so now there are more playlist actions available.

Exaile on N800 (OS2008) screenshot

Note that the previous release won’t work on OS2008 because the id3lib gstreamer element is called id3demux in OS2008.

If you are in need of a player that handles Ogg Vorbis, m4a and mp3 (among others) on OS2008 and has decent playlist management features and you are willing to put up with a slightly slow and fat app then Exaile for maemo may be for you. :-)

Filed under: exaile,maemo,N800 — twegener @ 22:38
Next Page »
Powered by WordPress

-->