1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
ABOUT
=====
This is a project to provide automated control over a relay that switches
audio. The idea being that you can automatically route line-out audio from the
computer to different locations/amps.
Schematics for the audio switching unit can be found in the project directory.
In summary, a relay is controlled to switch stereo input audio between two
outputs. Also, one of the outputs can be overridden by plugging in some
headphones.
The software below is for a MinimusUSB and will turn it in to a USB serial
device with a unique vendor and product id. It is based on LUFA.
BUILDING THE PROJECT
====================
Lufa Setup
----------
Download the LUFA project and unpack it in to the root directory of this
project. Then, either rename the LUFA directory to "LUFA", or just symlink to
it (which will allow you to have several versions of the library, should you
want to). For example,
$ wget http://lufa-lib.googlecode.com/files/LUFA-120730.zip
$ unzip LUFA-120730.zip
$ ln -s LUFA-120730 LUFA
Building and uploading
----------------------
Having unpacked LUFA, build the audio-switcher software.
$ cd src
$ make
Then, plug in your MinimusUSB, put it in to DFU upload mode (whilst holding
down button B, press reset). You can confirm it is ready with `lsusb`, which
should list the following device present:
ID 03eb:2ffa Atmel Corp.
Now upload the audio switcher software.
$ make dfu
Finally, reset the MinimusUSB. You can confirm that the software is working
with `lsusb`, which should show the following device present (note the product
id is different):
ID 03eb:ba7f Atmel Corp.
CONTROL
=======
The audio switcher is a serial device. To turn the audio switcher on and off,
you can connect to the serial device and send commands (followed by a newline).
The following commands are supported:
0 - turn relay off
1 - turn relay on
? - query state of relay (returns a 0 or 1)
. - toggle relay
You can also use the `audio-switch` shell script included in this project,
which finds the correct serial device to talk to and has a nice command-line
interface.
REFERENCE
=========
You can find out more about the excellent LUFA project here:
http://www.fourwalledcubicle.com/LUFA.php
|