Hi everyone!
A month ago, or so, I got the idea to do something about the annoying separation between my Beosystem 7000 and my Mac. The BS is of course nicely controlled with the remote, but the Mac is not. I do listen to both my iTunes library and Spotify a lot, so the nuisance was kind of there all the time. I figured that it must be possible to use the data signals sent from the beomaster to the other units and have the computer act accordingly.
I started searching the forum, thinking that others had done this before, but to my surprise I found almost nothing (and that's why I figured I'd write this post.) I then googled for microcontrollers, and the choice fell on the Aurdino Uno Rev 3. In part because an electronics retailer not 10 minutes walk from my home has them, but mainly because it's dead cheap, about the equivalent of $30. I went and got one the same day.
My next problem was that I don't have an oscilloscope, and even if I had one, I'm not sure I know how to use one, and even if I did it wouldn't be one of those expensive ones that can record signals for off-line inspection. I found the MCL2 technical description on the site which describes the MCL2 format, and I thought that it'd be worth a shot. I connected the board to the TAPE 2 socket on the back of the BM and wrote a program to record whatever the BM was sending. It made no sense at all. The MCL2 standard uses PWM coding, and interpreting datalink signals as PWM gives you jibberish, I assure you. :-) I then figured it might be standard serial communication, so I tried that. Success! It worked. It turned out that the datalink format uses the same bit-times as the MCL2 format (3,125 millis), and that was just a lucky guess.
The datalink format, as far as I can tell, works thus: it is serial communication with 8 bit bytes sent MSB first. The first bit is always a 1, to allow synchronization, then 7 information carrying bits. It is active low (so low means 1), and each bit is 3125 us long (the MCL2 standard allows a maximum error of 312 us, and possibly there is something similar for datalink, but since you can resynch every 8 bits, it shouldn't be anything to worry about.)
Some commands are:
Play: 0xAB
Stop: 0xB5
>>: 0xB1
<<: 0xAF
Up: 0x99
Down: 0xB3
Number: 0xBC
Stby: 0xCB
Numers are sent in decimal form and one digit at a time. So 12 would be sent as first the 1 and then the 2. Also, before the numbers 0xBC is sent to start the sequence. The sequence of numbers is terminated by 0xAB (Play). Now for some reason the numbers are shifted one bit to the left, eg 1 is 10000011. So you need to right-shift them to get the right number (and also unset the MSB of course).
There are lots of other things sent as well, in particular when you swith to CD, and I haven't figured out what half of those things are, and since I don't need them I probably wont bother.
Anyway, I wrote some code to receive these commands and relay to the computer via USB. The Arduino board has a simple and easy-to-use library to for serial communication over USB. All I had to do was to write a program on the Mac that detects when the board is connected (and disconnected) and opens a serial port to talk to the board. Then it waits for commands and acts appropriately, by sending AppleScript events to either iTunes or Spotify, whichever is playing at the moment.
I realize now that this post didn't get as technical as I'd hoped. Apparently it's easier to write prose and be vague than to write down hard-core details in a note like this. Even so, I'll be happy to answer any questions you might have!
What turned out to be trickiest with this project was to build a suitable box for the thing. It's kind of prototypical, because I used stuff I had home or stuff I could get quickly and easily to build it. I might build a prettier one some day, now that I've learnd a thing or two (especially how to make holes that are not round).
Here is is:
One end has USB and two phono connecttions. This is the "computer end".
The other end has a 7-pin din socket to connect to the BM:
The inside looks like this:
So what was the end result? I'm a much happier man, having done this project. My (old spare) Mac sits connected to the beomaster all the time and is happily responding to my commands on the remote.
As I said, I'll be happy to answer any questions, should you like to proceed on a similar project!
/ Johan
Edit: I decided to put in a little extra circuit, and the reason is twofold: first, I wanted to limit the current flowing between the two uCs. Second, I realized that when the board is connected to the BM but the USB is disconnected the board shorts and hogs the uC in the BM, which doesn't work properly. So, I put in a transistor and a couple of resistors (very similar to the relevant part in the BG CD5500 service manual). I would also like to acknowledge and thank Mika (tournedos) who helped me with this. / Johan