~ubuntu-branches/ubuntu/natty/lirc/natty-proposed

« back to all changes in this revision

Viewing changes to doc/html/audio.html

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2010-04-02 15:06:19 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100402150619-y1z8c1yqv621a11o
Tags: 0.8.7~pre2-0ubuntu1
* Update to 0.8.7~pre2
  - Fixes issues with lirc on maverick. (LP: #620498)
* Add lirc-in-kernel-ioctls.patch to use ioctls from the kernel for drivers.
* Drop patches upstream now:
  - debian/patches/appleir_repeat_issue.patch
  - debian/patches/hauppauge-tv-card.patch
  - debian/patches/lirc-i2c-2.6.patch
  - debian/patches/lirc_dev-2.6.33.patch
* Add updated-driver-names.patch 
* Refresh patches:
  - debian/patches/02_Makefile.in
  - debian/patches/13-warning-cleanup
* Update extra transmitter and remote databases to not reference atiusb.
* debian/control:
  - Update branches to be owned by ~mythbuntu-dev
* Disable in-kernel-support when starting lircd, and re-enable when
  stopping.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
 
 
3
<HTML>
 
4
  <HEAD>
 
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">
 
10
  </HEAD>
 
11
  
 
12
  <BODY BACKGROUND="../images/marb18.jpg"
 
13
    BGCOLOR="#FFFFFF" TEXT="#000000" ALINK="#8080FF">
 
14
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
 
15
      <TR>
 
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">
 
23
        </TD>
 
24
      </TR>
 
25
      <TR>
 
26
        <TD WIDTH="100%">&#160;<BR>
 
27
          <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
 
28
            <TR>
 
29
              <TD WIDTH="15%">&#160;<BR></TD>
 
30
              <TD WIDTH="70%" ALIGN="LEFT" VALIGN="TOP">&#160;<BR>
 
31
 
 
32
<!-- Text ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 
33
 
 
34
<P>
 
35
The receiver part for this driver is described <A HREF="http://people.inf.ethz.ch/mringwal/lirc/">here</A>.
 
36
</P>
 
37
<A NAME="audio_transmitter"></A><HR>
 
38
<H1 ALIGN=CENTER>Using the audio driver for transmitting.</H1>
 
39
<P>
 
40
Pros:
 
41
</P>
 
42
<UL>
 
43
<LI>Very simple circuit.</LI>
 
44
<LI>No need for a kernel module.</LI>
 
45
</UL>
 
46
<P>
 
47
Cons:
 
48
</P>
 
49
<UL>
 
50
<LI>Doesn't transmit very far without an amplifier (about 3 meters
 
51
when directly aiming).</LI>
 
52
 
 
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
 
55
kHz sine).</LI>
 
56
 
 
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
 
59
latency.
 
60
<P>
 
61
 A workaround for this is to keep irw running with a bash
 
62
script like this:
 
63
</P>
 
64
<code>
 
65
#!/bin/bash<br>
 
66
while [ true ]; do<br>
 
67
irw || true<br>
 
68
sleep 1<br>
 
69
done<br>
 
70
</code>
 
71
</LI>
 
72
</UL>
 
73
 
 
74
 
 
75
<H2 ALIGN=CENTER>How it works:</H2>
 
76
<br>
 
77
<P>
 
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.
 
85
</P>
 
86
 
 
87
<CENTER><img src="../images/audio_wave.png"></CENTER>
 
88
 
 
89
<P>
 
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.
 
93
</P>
 
94
<P>
 
95
The rectification is done using the following circuit:
 
96
</P>
 
97
 
 
98
<CENTER><img src="../images/audio_transmitter.png"></CENTER>
 
99
 
 
100
<P>
 
101
LED1 and LED2 are 950 nm infra-red LEDs, R1 is a 0.25 watt resistor.
 
102
</P>
 
103
<P>
 
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.
 
108
</P>
 
109
<P>
 
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!
 
115
</P>
 
116
<P>
 
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.
 
121
</P>
 
122
<H2 ALIGN=CENTER>Setting up:</H2>
 
123
<P>
 
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>.
 
130
</P>
 
131
<P>
 
132
Examples:
 
133
</P>
 
134
 
 
135
<code>
 
136
lircd -d ALSA:default<br>
 
137
lircd -d ALSA:default@48000<br>
 
138
lircd -d ALSA:default@48000:0.02<br>
 
139
lircd -d @48000<br>
 
140
lircd -d @48000:0.05<br>
 
141
</code>
 
142
 
 
143
<P>
 
144
Use irsend to test if it works.
 
145
</P>
 
146
<P>
 
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
 
149
use that.
 
150
</P>
 
151
 
 
152
<H2 ALIGN=CENTER>Choosing an audio device:</H2>
 
153
 
 
154
<P>
 
155
If you want to use a different soundcard, check the lircd log for lines
 
156
like these:
 
157
</P>
 
158
<P>
 
159
<code>
 
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>
 
187
</code>
 
188
</P>
 
189
<P>
 
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>
 
193
</P>
 
194
 
 
195
<H2 ALIGN=CENTER>Known issues:</H2>
 
196
 
 
197
<P>
 
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>
 
203
</P>
 
204
<P>
 
205
Low latency values will cause dropped audio, when this happens lines like
 
206
this will be printed in the lircd log:<br>
 
207
</P>
 
208
<P>
 
209
<code>
 
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>
 
212
</code>
 
213
</P>
 
214
<P>
 
215
To prevent this you can set the niceness of lircd to -20 or increase the latency.
 
216
</P>
 
217
 
 
218
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 
219
 
 
220
                <BR><BR>
 
221
                <CENTER>[<A HREF="http://www.lirc.org/">LIRC homepage</A>]<BR>
 
222
                  <I>The LIRC Manual, last update: 24-May-2009</I></CENTER>
 
223
                <BR><BR>
 
224
              </TD>
 
225
              <TD WIDTH="15%">&#160;<BR></TD>
 
226
            </TR>
 
227
          </TABLE>
 
228
        </TD>
 
229
      </TR>
 
230
      <TR>
 
231
        <TD CLASS="menu" WIDTH="100%">&#160;<BR>
 
232
        </TD>
 
233
      </TR>
 
234
    </TABLE>
 
235
  </BODY>
 
236
</HTML>