Pioneer SR-Link control

I have a decent (but aging) surround receiver connected to my HTPC – a Pioneer VSX-2016av. Because of it’s age it really doesn’t have any good ways to control it from a PC (USB or even serial).

As part of my home automation setup it would be great to be able to control some of the features on the receiver. Volume up, volume down, power off, power on, etc.. Most of the time I use a wireless keyboard as an interface to my HTPC (running XBMC) – and the remote control for the receiver is only really used for volume control. Would love to be able to control these directly from the keyboard.

I’ve tried to control this receiver via IR, and actually set up a microcontroller to record the IR signal from the remote today. After decoding the modulated (38 khz) pulses I was able to play back the same signal and do stuff on the receiver from a microcontroller via IR. This could work.. but you actually have to point the IR diode more or less directly at the front of the receiver – reflections doesn’t work (maybe I could try a more powerful LED?). Was thinking about mounting the LED directly on the receiver, but it looks ugly 😦

Then I noticed the SR-link (in and out) ports on the back of the receiver. It’s a system Pioneer (and some other companies?) use for linking hifi/video equipment. You can use it to relay IR control and even transfer configuration options (in SR+). So I hooked up a microcontroller to the SR input port – you can use a mono 3.5″ jack – signal is on the middle pin. Ground can be taken directly from the chassis (shield on RCA-port for example).

Spent a while experimenting with this, by listening to the SR-output port while using the remote control. The signal is high (5v) as default, and pulled low on every IR pulse. Tried to replicate this using a microcontroller connected to SR Input on the receiver – wasted a lot of time beliving the signal should be 38 khz modulated – just like IR – but alas – no need for modulation – it won’t actually work if you modulate. Finally got it working – awesome! Now i can control my receiver from a microcontroller.

My goal is to get this directly connected to a Raspberry PI (which is going to be the HUB of my home automation system). If I can I really want to skip the microcontroller – and do it directly from the rasp-pi. I ported my microcontroller code to the PI, but it seems that I can’t get the timing accurate enough (running in userland).

Microsecond timing accuracy is a bitch in linux, I guess I could do this in kernel space – but that’s a lot of effort. Guessing I’ll probably have to go the microcontroller route. Also wish I had a decent scope, so that I could see how much jitter I’m dealing with here.

Advertisements

8 thoughts on “Pioneer SR-Link control

  1. This doesn’t help your “not writing kernel drivers” part but it may be possible to get a bit more hardware support for this from the RPi if you are willing to sacrifice your analogue audio output. Each of the two PWM peripherals that normally drive the audio also have a “serialise” mode that will clock out data from a FIFO at the rate of the clock supplied to it (page 140 or so in the datasheet).

    So to get your 1usec pulses you’d also want a 1MHz clock to the PWM rather then the 100MHz (?) used by the audio driver.

    Then you can presumably write 32 bits at once to that register / FIFO (DAT1, DAT2 or FIF1).

    (Chip) Pin 18 in the RPi’s GPIO block can be configured to be PWM0 output so it ought to be possible to get at this signal without any soldering either.

    Probably.

    This might be a good start: https://github.com/richardghirst/PiBits/tree/master/ServoBlaster

    • Thanks Ross, that would be a pretty cool hack – i didn’t know they did audio that way on the PI, great tip!

      (..also the panalyzer project from the same guy as the servoblaster was pretty cool)

    • I got back to this a little sooner than expected and also came across a gpio-based lirc kernel module for the pi (lirc_rpi). It is now included in the official linux sources. Unfortunately the sr protocol is inverted compared to an ir diode. The receiver works out of the box but you need a patch for the transmitter, which is included in my fork:

      https://github.com/pjennings/linux

      • That is awesome!
        It works with any of the gpio pins I assume?

        Do you plan to create a pull request for the invert patch, to get it into the mainstream rpi kernel?

      • I only tested it on one pin, but it was not the default pin so I assume it would work on any of them. I just submitted a pull request.

  2. Hi guys,

    This is really huge. I was exactly going to do the same with an IR Led Transmitter when I saw the IR IN/OUT at the back of my home surround receiver.

    I’ve checked on the Pi Kernel and it seems that’s Paul’s pull request has been accepted : https://github.com/raspberrypi/linux/blob/7025426bda35ae7ce7e7261462cc02b1e39bf74b/drivers/staging/media/lirc/lirc_rpi.c

    Now, I do have some questions which might look for you as newbie question but :
    * How do I set to the lirc_rpi module to go in the inverted mode in ordrer do work ? Do we have to do “modprobe lirc_rpi invert=1″ ?
    * Regarding the hardware do you just have to put a jack connector between GPIO17 and the ground ? Or do we have to deal with this kind of hardware (http://1.bp.blogspot.com/-DuyRAT_xH5Y/UQrkCocR6bI/AAAAAAAAA7A/Nqgq_O1N4Ys/s1600/IRtransmit.png) after replacing the LED by the jack

    Thanks for your help !

    Arnaud

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s