The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

raspberrypi.org/magpi The Official Raspberry Pi Projects Book 73


PI DECK Projects


>STEP-01
Put the record on
Once Pi Deck is set up, place a control vinyl on the
turntable, power up the Pi, and insert the USB stick.
Waxed paper under a felt slipmat will reduce friction.

>STEP-02
Position the stylus
Put the stylus on the control vinyl and use your
hand movements to find the first beat of the record.
Cue this via the mixer headphones or the waveform
display in xwax.

>STEP-03
Scratch away
From this point on, the control works just like an
analogue vinyl record. You can back-cue and scratch
the vinyl, for instance, pushing the record forward or
in reverse.

HEY, MR DJ


all you need is a USB stick packed
with music files. “As long as there
is low latency in both directions of
travel, you can make effects such
as rubbing the kick drum beats,
scratching and backspins sound,
feel and look realistic,” Daniel says.
Motivated by a desire to show
that low latency applications
could work reliably on small and
inexpensive ARM devices such


as the Pi, Daniel and Chris got to
work. They used xwax (xwax.org),
an open-source DVS for Linux
capable of playing MP3, FLAC, and
AAC files, among others. “But
because xwax isn’t easy for people
new to GNU/Linux to set up the
system optimally, we created a
ready-made Debian image for the
Raspberry Pi that is specialised
for this one application,” reveals
Daniel. “It means DJs don’t have
to go through as many steps to
get it running.”
The pair had tested Raspbian
images and various kernels with
hand-soldered audio hardware to
create the inputs and outputs that
they needed. “Then we tried a HAT
sound card from audioinjector.net
and some USB audio interfaces
which include phono cartridge
preamplifiers. These are needed
because the stylus on the record
outputs a signal at a very low level,
compared to other audio devices.”


The greatest challenge was
getting the audio interfaces to
work with low latency since many
of the known techniques are
for PC architecture. “Interrupt
tweaking doesn’t work the same
way on the ARM architecture, for
instance,” Daniel explains, “but
switching to newer Linux kernels
helped a lot.” The majority of
the work involved configuring

and scripting various programs
to work smoothly together with
minimal user input. “Most of the
setup is done with shell script,
which is easy to hack.”
A screen completed the package.
Daniel and Chris decided to use
the official Raspberry Pi seven-
inch touchscreen. “We wanted
something that would be easy to
set up,” Daniel continues, “but the
Pi Deck works with any compatible
screen. If you’re not using a
touchscreen, an ordinary mouse
can be used to click the buttons.
A QWERTY keyboard is useful for
searching music titles.”
Since creating the Pi Deck last
October, the pair have been excited
at the level of positive feedback.
Hearing about people using it
across the world has been music to
their ears. “People appreciate the
low latency and stability,” Daniel
concludes. “These are the crucial
factors for any performance.”

Most of the setup is done with


shell script, which is easy to hack


The Audio Injector stereo sound card adds line-level audio inputs to the Pi

Free download pdf