Finally I got it working. It seems that the problem is that in my program I didn't set the parity (I thought that the default was even while it is no parity)
This is the circuit I used (though the HU on detection still isn't reliable, when I disconnected it from the HU it still thought it was on, it worked flawlessly while connected). I think that it may work even without the transistors (since my problems were in the program, not in the interface)
EDIT: I tried without the transistors, it doesn't work.

The components are what I had available, so they may be replaced (probably the 2n2222 would work equally well as the bc337).
Attached is the python program, now with all serial parameters explicitly defined 
BEWARE this is not java, so it's just 160 lines of understandable code in a (shock horror) single file 
It needs a python interpreter (obviously) and pyserial. I had to add the txt extension (this forum doesn't accept python files), and you invoke it either passing the number of the serial port, e.g.
or the name of the serial device
Code:
python cdc.py /dev/tty/USB0
If you want verbose output just change the line
to
Now I'll just have to find an usb card with spdif output, the blue connector (I used faston for testing) and I'll probably write a freepascal version of the program (so that'll be native under at least windows and linux, don't know if the serial library I'm using works under mac os X, don't know if pyserial does either).
Bookmarks