software/sndxfer

git clone https://git.elephly.net/software/sndxfer

Extend the README.

rekadoTue Jul 05 21:47:23+0200 2016

6c5d067

software/sndxfer
namelast commitdate
.gitignoreDefine sndxfer Guile module.Tue Jul 05 21:35:06+0200 2016
AUTHORSInitial commit.Fri Jul 01 08:20:50+0200 2016
COPYINGInitial commit.Fri Jul 01 08:20:50+0200 2016
ChangeLogInitial commit.Fri Jul 01 08:20:50+0200 2016
Makefile.amDefine sndxfer Guile module.Tue Jul 05 21:35:06+0200 2016
NEWSInitial commit.Fri Jul 01 08:20:50+0200 2016
READMEExtend the README.Tue Jul 05 21:47:23+0200 2016
configure.acInitial commit.Fri Jul 01 08:20:50+0200 2016
guix.scmInitial commit.Fri Jul 01 08:20:50+0200 2016
main.cSet number of frames exactly.Tue Jul 05 20:00:17+0200 2016
sndxfer/Export procedures, move script to test.scm.Tue Jul 05 21:36:20+0200 2016
test.scmExport procedures, move script to test.scm.Tue Jul 05 21:36:20+0200 2016
test.shExport procedures, move script to test.scm.Tue Jul 05 21:36:20+0200 2016

README

1
This library aims to provide procedures to easily send a stream of
2
bytes via the analogue audio output and decode an analogue signal
3
received over the line input to a stream of bytes.
4
5
The output is an amplitude-modulated 48kHz signal.  Every byte is
6
split into 2-bit tuples, which are then mapped to an amplitude level.
7
8
* Enter development environment with Guix
9
The easiest way to create an environment in which all development
10
dependencies are available is GNU Guix.  A package expression is
11
defined in =guix.scm= so all you need to do is execute the following
12
command to create a subshell with all development dependencies:
13
14
#+BEGIN_SRC sh
15
guix environment -l guix.scm
16
#+END_SRC
17
18
* Bootstrap
19
sndxfer uses Autotools.  Generate the =configure= script like this:
20
21
#+BEGIN_SRC sh
22
autoreconf -vif
23
#+END_SRC
24
25
* Build
26
After bootstrapping issue the usual commands of the GNU build system:
27
28
#+BEGIN_SRC sh
29
./configure
30
make
31
#+END_SRC
32
33
* Test
34
First, you should configure your audio device to use the highest
35
supporting sampling rate.  In the case of my audio hardware this is
36
96kHz.  This is done by creating a file named =.asoundrc= in your home
37
directory with the following contents:
38
39
#+BEGIN_EXAMPLE
40
pcm.sndxfer {
41
  format U8_LE
42
  rate 96000
43
  type hw
44
  card 0
45
  device 0
46
}
47
#+END_EXAMPLE
48
49
sndxfer will only use a PCM plug device with the name “sndxfer”.
50
51
Then connect an audio cable to your default audio interface and
52
connect two oscilloscope probes to each channel.  Then generate a test
53
signal with:
54
55
#+BEGIN_SRC sh
56
./test.sh
57
#+END_SRC
58
59
Print the generated test signal with
60
61
#+BEGIN_SRC sh
62
export GUILE_LOAD_PATH=$PWD:$GUILE_LOAD_PATH
63
guile -e main -s test.scm print
64
#+END_SRC
65