Rekayasa

Project: Broadcast Airband ke Internet Pakai Raspberry Pi

Kasus: Bagaimana mendengarkan frekuensi penerbangan melalui internet? Disini akan digunakan rig radio sebagai penerima frekuensi, menyalurkan output ke Raspberry, kemudian disiarkan ke internet menggunakan Shoutcast.

A. Perangkat Utama yang DIbutuhkan

  • Raspberry Pi B (atau yang lebih baru; B+, 2B, 3B, dst)
  • Rig Radio Icom 2200H AIrband (tidak semua tipe ini airband)
  • SDCard untuk Raspi 16GB
  • Soundcard USB
  • Kabel audio jack mini mono 3,5mm to mini mono 3,5mm

 

B. Persiapan Awal

  1. Instalasi OS di Raspi, bisa klik disini.
  2. Penyiapan server Shoutcast, bisa cari disini.

 

C. Instalasi Darkice di Raspberry

  • menambah repositori
sudo sh -c "echo 'deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi' >> /etc/apt/sources.list"
sudo apt-get update
  • menginstall dependensi
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
  • config compile
mkdir src && cd src/
apt-get source darkice
cd darkice-1.0/
nano debian/rules

#!/usr/bin/make -f

%:
	dh $@

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	ln -s /usr/share/misc/config.guess .
	ln -s /usr/share/misc/config.sub .
	dh_auto_configure -- --prefix=/usr --sysconfdir=/usr/share/doc/darkice/examples --with-vorbis-prefix=/usr/lib/arm-linux-gnueabihf/ --with-jack-prefix=/usr/lib/arm-linux-gnueabihf/ --with-alsa-prefix=/usr/lib/arm-linux-gnueabihf/ --with-faac-prefix=/usr/lib/arm-linux-gnueabihf/ --with-aacplus-prefix=/usr/lib/arm-linux-gnueabihf/ --with-samplerate-prefix=/usr/lib/arm-linux-gnueabihf/ --with-lame-prefix=/usr/lib/arm-linux-gnueabihf/ CFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard'
  • compile
debchange -v 1.0-999~mp3+1

tambahkan :

darkice (1.0-999~mp3+1) UNRELEASED; urgency=low

  * New build with mp3 support

 --  <pi@raspberrypi>  Sat, 11 Aug 2012 13:35:06 +0000
dpkg-buildpackage -rfakeroot -uc -b
  • install darkice
sudo dpkg -i ../darkice_1.0-999~mp3+1_armhf.deb
  • menyiapkan file config
sudo cp /usr/share/doc/darkice/examples/darkice.cfg /etc/
nano /etc/darkice.cfg

isi file config

[general]
duration        = 0        # duration of encoding, in seconds. 0 means forever
bufferSecs      = 2         # 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    # this references to the audio hardware 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 a ShoutCast server
# there may be up to 8 of these sections, named [shoutcast-0] ... [shoutcast-7]
# these can be mixed with [icecast-x] and [icecast2-x] sections
  [shoutcast-0]
  bitrateMode     = cbr           # constant bit rate mode
  bitrate         = 48            # bitrate of the stream
  quality         = 0.5           # encoding quality
  server          = xx.xx.xx.xx   # host name of the server
  port            = 9309          # source port of the ShoutCast server, usually 8001
  password        = xxxxxxxx        # source password to the ShoutCast server
  name            = Radio Pi # name of the stream
  url             = http://atcjogja.siaran.org  # URL related to the stream
  genre           = radiocall     # genre of the stream
  public          = yes           # advertise this stream
  • catatan penting

Colok USB Soundcard ke Raspi dan ketik command di bawah untuk mendapat info HW

aplay -l   # note lower-case "L" option2

Nomor Port adalah +1 dari nomor port broadcast Shoutcast

 

C. Integrasi

  • nyalakan Icom 2200H, tune di freq. airband airport terdekat
  • colok kabel audio ke Icom menuju ke port mic USB soundcard
  • nyalakan Raspberry, koneksikan ke internet
  • jalankan darkice dengan command “sudo darkice”
rear panel iCom radio rig

 

D. Troubleshoot

Error “DarkIce: LameLibEncoder.cpp:75: lame lib opening underlying sink error [0]” adalah indikasi Darkice pada Raspberry Pi gagal terkoneksi ke server ShoutCast. Pastikan port pada file config +1 dari port radio Shoutcast.

 

Semoga bermanfaat!

Leave a Comment

Your email address will not be published. Required fields are marked *