1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5
<TITLE>LIRC - Linux Infrared Remote Control</TITLE>
6
<LINK REL=stylesheet TYPE="text/css" HREF="../lirc.css">
7
<LINK REL="shortcut icon" HREF="../favicon.ico">
8
<META NAME="description" CONTENT="LIRC - Linux Infra-red Remote Control">
9
<META NAME="keywords" CONTENT="linux, kernel module, remote control, animax, multimedia">
12
<BODY BACKGROUND="../images/marb18.jpg"
13
BGCOLOR="#FFFFFF" TEXT="#000000" ALINK="#8080FF">
14
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
16
<TD CLASS="menu" WIDTH="100%" HEIGHT="150">
17
<IMG SRC="../images/diode.gif" ALT=""
18
WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
19
VSPACE="0" ALIGN="LEFT">
20
<IMG SRC="../images/lirc.gif" ALT=""
21
WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
22
VSPACE="0" ALIGN="RIGHT">
26
<TD WIDTH="100%"> <BR>
27
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
29
<TD WIDTH="15%"> <BR></TD>
30
<TD WIDTH="70%" ALIGN="LEFT" VALIGN="TOP"> <BR>
32
<!-- Text ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
35
The receiver part for this driver is described <A HREF="http://people.inf.ethz.ch/mringwal/lirc/">here</A>.
37
<A NAME="audio_transmitter"></A><HR>
38
<H1 ALIGN=CENTER>Using the audio driver for transmitting.</H1>
43
<LI>Very simple circuit.</LI>
44
<LI>No need for a kernel module.</LI>
50
<LI>Doesn't transmit very far without an amplifier (about 3 meters
51
when directly aiming).</LI>
53
<LI>A reasonably good sound-card is required (cheap cards might not
54
provide enough voltage, or might not be able to output a correct 19
57
<LI>It takes some time to set up (50 ms or so) so when no clients are
58
connected to lircd the first transmission will have some higher
61
A workaround for this is to keep irw running with a bash
66
while [ true ]; do<br>
75
<H2 ALIGN=CENTER>How it works:</H2>
78
The audio driver can send IR signals using a (reasonably good)
79
sound-card and a very simple circuit. It does this by modulating
80
the data onto a sine which is half the carrier frequency (38 kHz is
81
the default if the remote doesn't have a frequency specified).
82
After rectification the sine becomes a full frequency carrier.
83
The wave is inverted on the right channel, so the left and right
84
channels can be used to double the voltage.
87
<CENTER><img src="../images/audio_wave.png"></CENTER>
90
The top wave is how the wave looks when it comes out the sound-card,
91
the bottom wave is how it looks after rectification, as you can see
92
the frequency is doubled.
95
The rectification is done using the following circuit:
98
<CENTER><img src="../images/audio_transmitter.png"></CENTER>
101
LED1 and LED2 are 950 nm infra-red LEDs, R1 is a 0.25 watt resistor.
104
Because LEDs are diodes, they only conduct one way. Since the
105
sound-card outputs a wave that goes both positive and negative, two
106
LEDs are placed anti-parallel, that way infrared is emitted on both the
107
positive and negative cycles.
110
R1 is used to limit the current, this presents a load to the sound-card
111
that is roughly the same as a pair of 32 ohms headphones. To make the
112
transmission more powerful, you can try lowering the value of R1 (or
113
just short it out), but this might damage your sound-card, the LEDs, or
114
both. So try at your own risk!
117
Another way to make the transmission more powerful is to use a small
118
speaker amplifier (5 watts or less), in this case a 5 watt resistor
119
should be used for safety. The volume should be adjusted so that the
120
amplifier outputs its full voltage without clipping.
122
<H2 ALIGN=CENTER>Setting up:</H2>
124
Compile LIRC with the audio driver (not the IR diode or alsa ones) and
125
install it as usual. Connect the circuit to the sound-card and set the
126
volume to the maximum level. Start lircd, the -d flag can be used to
127
select the audio device and/or sample-rate, the syntax is
128
<code>api:device[@samplerate[:latency]]</code> or
129
<code>@samplerate[:latency]</code>.
136
lircd -d ALSA:default<br>
137
lircd -d ALSA:default@48000<br>
138
lircd -d ALSA:default@48000:0.02<br>
140
lircd -d @48000:0.05<br>
144
Use irsend to test if it works.
147
A samplerate of 48 kHz is about the bare minimum needed to make a
148
modulated 19 khz sine, if your soundcard supports 96 kHz, you should
152
<H2 ALIGN=CENTER>Choosing an audio device:</H2>
155
If you want to use a different soundcard, check the lircd log for lines
160
Found input device 0 OSS:/dev/dsp<br>
161
Found input device 1 OSS:/dev/dsp1<br>
162
Found input device 2 ALSA:SB Audigy 1
163
[SB0092]: ADC Capture/Standard PCM Playback (hw:0,0)<br>
164
Found input device 3 ALSA:SB Audigy 1
165
[SB0092]: Mic Capture (hw:0,1)<br>
166
Found input device 4 ALSA:SB Audigy 1
167
[SB0092]: Multichannel Capture/PT Playback (hw:0,2)<br>
168
Found input device 6 ALSA:HDA ATI SB: HDA Generic (hw:1,0)<br>
169
Found input device 13 ALSA:spdif<br>
170
Found input device 14 ALSA:default<br>
171
Found output device 0 OSS:/dev/dsp<br>
172
Found output device 1 OSS:/dev/dsp1<br>
173
Found output device 2 ALSA:SB Audigy 1
174
[SB0092]: ADC Capture/Standard PCM Playback (hw:0,0)<br>
175
Found output device 5 ALSA:SB Audigy 1
176
[SB0092]: Multichannel Playback (hw:0,3)<br>
177
Found output device 6 ALSA:HDA ATI SB: HDA Generic (hw:1,0)<br>
178
Found output device 7 ALSA:front<br>
179
Found output device 8 ALSA:rear<br>
180
Found output device 9 ALSA:center_lfe<br>
181
Found output device 10 ALSA:surround41<br>
182
Found output device 11 ALSA:surround50<br>
183
Found output device 12 ALSA:iec958<br>
184
Found output device 13 ALSA:spdif<br>
185
Found output device 14 ALSA:default<br>
186
Found output device 15 ALSA:dmix<br>
190
Now use the string for the device you want to use after the device number
191
as argument for the -d flag like this:<br>
192
<code>lircd -d "ALSA:HDA ATI SB: HDA Generic (hw:1,0)"</code><br>
195
<H2 ALIGN=CENTER>Known issues:</H2>
198
The audio driver uses PortAudio to interface with the sound-card, there
199
seems to be a bug in some later versions that makes portaudio hang
200
completely, lircd becomes unresponsive and you have to kill it with
201
<code>killall -9 lircd</code>. To get around this use the PortAudio
202
stable release from December 7, 2007.<br>
205
Low latency values will cause dropped audio, when this happens lines like
206
this will be printed in the lircd log:<br>
210
WARNING: Input overflow ALSA:HDA ATI SB: HDA Generic (hw:1,0)@96000:0.02<br>
211
WARNING: Output underflow ALSA:HDA ATI SB: HDA Generic (hw:1,0)@96000:0.02<br>
215
To prevent this you can set the niceness of lircd to -20 or increase the latency.
218
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
221
<CENTER>[<A HREF="http://www.lirc.org/">LIRC homepage</A>]<BR>
222
<I>The LIRC Manual, last update: 24-May-2009</I></CENTER>
225
<TD WIDTH="15%"> <BR></TD>
231
<TD CLASS="menu" WIDTH="100%"> <BR>