Rabarar's Blog

A blogging framework for mild hackers.

Jetson TK-1 Nvidia L4T Linux Platform

| Comments

Jetson TK-1 - Embedded SBC SuperComputer Power for Pennies

jetsonhacks

Okay, so everyone has a blast playing with the < $50 raspberry pi, but what if you take it up a notch. I mean drop a few extra bucks (more like $160 extra) and you can have some serious power in a small little footprint. The Jetson TK-1 is a Kepler GPU with 192 cuda cores and 4-Plus-1 quad-core ARM Cortex A15 CPU. That’s a lotta power for $192 (retail). But wait, there’s more. It comes with 1Ge ethernet connector, 2Gb ram, 16Gb eMMC memory, USB, Audio, SATA, HDMI, and RS-232 serial port (old school).

The board supports a derivative of ubuntu 14.04 called L4T. Additionally, there is support for Cuda 6.5, OpenCV, and OpenGL, as well as samples - NVIDIA GameWorks OpenGL Samples 2.11. Definitely checkout the floating Teapot!.

Aside from all the graphic power offered by this platform. You can use it as a streaming server too. Real-time mp3 streaming is easy as pi! Er, easy as Jetson!!

Darkice & Icecast2

I thought I’d see how easy it was to setup Darkice and stream live audio from the mic on the Tegra to my Icecast2 server.

To build the source we first need to install all the dependencies:

1
sudo apt-get --no-install-recommends install build-essential devscripts autotools-dev fakeroot dpkg-dev debhelper autotools-dev dh-make quilt ccache libsamplerate0-dev libpulse-dev libaudio-dev lame libjack-jackd2-dev libasound2-dev libtwolame-dev libfaad-dev libflac-dev libmp4v2-dev libshout3-dev libmp3lame-dev

It took less than a 5 minutes to get it set up! Download the Darkice source and build (configure) it with the --with-alsa and --with-alsa-prefix, and --with-lame, and --with-lame-prefix, both pointing to the library directory for the shared libraries respectivly. After configuring and Making the darkice binary, you’ll need to setup a /etc/darkice.cfg file.

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
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration      = 0                # duration of encoding, in seconds. 0 means forever
bufferSecs    = 5                # size of internal slip buffer, in seconds
reconnect     = yes              # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device        = hw:1,0           # Alsa soundcard device for the audio input
sampleRate    = 44100            # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16               # bits per sample. try 16
channel       = 1                # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode   = vbr              # variable bit rate
format        = mp3              # format of the stream: mp3
quality       = 0.6              # quality of the stream sent to the server
server        = localhost        # host name of the server
port          = 8000             # port of the IceCast2 server, usually 8000
password      = SOURCE_PASSWORD  # source password to the IceCast2 server
mountPoint    = raspi         # mount point of this stream on the IceCast2 server
name          = RasPi            # name of the stream
description   = DarkIce on RasPi # description of the stream
url           = http://localhost # URL related to the stream
genre         = my genre         # genre of the stream
public        = no               # advertise this stream?
localDumpFile = recording.mp3    # Record also to a file

I set the device name to pulse. Fire it up and throw it in the background and you should see a stream registered on your Icecast2 server!

You may need to setup your audio port on the Jetson.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
amixer cset name="Stereo ADC MIXL ADC2 Switch" 0
amixer cset name="Stereo ADC MIXR ADC2 Switch" 0
amixer cset name="Int Mic Switch" 0
amixer cset name="ADC Capture Switch" 1
amixer cset name="RECMIXL BST1 Switch" 0
amixer cset name="RECMIXR BST1 Switch" 0
amixer cset name="RECMIXL BST2 Switch" 1
amixer cset name="RECMIXR BST2 Switch" 1
amixer cset name="Stereo ADC L1 Mux" "ADC"
amixer cset name="Stereo ADC R1 Mux" "ADC"
amixer cset name="Stereo ADC MIXL ADC1 Switch" 1
amixer cset name="Stereo ADC MIXR ADC1 Switch" 1
amixer cset name="Stereo ADC MIXL ADC2 Switch" 0
amixer cset name="Stereo ADC MIXR ADC2 Switch" 0
amixer cset name="IN1 Mode Control" "Single ended"
amixer cset name="IN2 Mode Control" "Single ended"
amixer cset name="Mic Jack Switch" 1

and then save the settings using:

1
alsactl store

It’s that easy!

Helpful links:

#### Next Up: Jetson TK-1 20-node cluster So, I was impulsive… I bought 20 of these boards, loaded up the JetPack and started to ponder - how I am going to power, connect, and house 20 of these boards.

Aside from stacking up the hardware, I’m thinking about the software to glue twenty of these things together too. Want to take advantage of cuda and maybe even mpi… stay tuned!!

Comments