From: Matthias R. <mri...@in...> - 2002-12-05 10:43:08
|
Hi I'm trying to get Lirc running on mac os x. On my machine there are no legacy ports like rs232 or parallel that I could use. USB-2-Serial or USB-2-Parallel adapters wouldn't work as the home brew receiver only use interrupts on those ports. I followed the idea that one could sample the IR signal with the sound card as Pavel Machek in hw_dsp.c but used the normal TSOP 1738 instead of a simple diode and get the normal (long) range as any other receiver. For the electronic stuff, I used 5V from a hard drive. To be able to connect the 5V TTL logic level to the sound card I used first 2 resistors (4,7 K and 1 K ) to reduce the voltage to less than 1 volt and then a small capacitor ( I guess it was 100 pF) to remove DC from it. I recorded the sound input using a sony remote and it clearly shows the bursts as rects. The level during one burst is decreasing as one would expect as we try reading a constant voltage after one or more capacitors. The start pulse from the sony remote, 2400 uS, can clearly distiguished from the next pause. I wrote an test app using the port audio library (available at least for linux, mac os 9, mac os x, several windows versions, ... ) to get the live data and detect pulse and pause values. this part works great. I used the heuristic that a difference of half the maximum level must be within 3 samples (44100 kHz). Integration into LIRC is the stuff I'm not finished with. After changing some header files (there are no <linux/...> headers on my system.. :) and adding the gengetop package to get options parsing working, I was able to compile without drivers. I used hw_dsp as a starting point and added hw_audio to the makefile.am. The problematic part are the /dev/.. interface mechanism as mac os x doesn't allow user-land devfs and I didn't want to write a kernel extension. I decided to use a pseudo tty for the communication between the hw driver and lircd / irrecord. I disabled the /dev/lircd sockets, as this gives an error at run time and connect to the lircd by the tcp/ip interface. I got lircd running with a hand edited lirc conf file for my sony remote rmt-812. this one if for a sony dv camcorder and uses 12, 15 and 20 bit codes... so I used the raw mode. with irrecord I get only the first pass working. This means the hw driver interface is not correct. I guess I will be able to get it working. I just had a look into the lirc cvs and found the hw_udp driver. This would be another (easy debuggable) option for the soundcard driver. resume: lirc compiles on mac os x, the sound card approach works fine here, the /dev/lircd is not working (without more effort), the hw driver needs a bit more work and the applications that uses lirc are missing. (I'm hardly using X11...) Anybody interested in using/testing ? Matthias Ringwald |