I have not seen anyone compile asterisk app_rpt on an Odroid-U3. I believe this should have enough horsepower to do DSP.
This is based on the Fedora Odroid remix as most of the packages that are needed are there. In this wiki I will start with a ready to go Fedora installation. If you don't know how to do this, goto www.ordoid.in website and follow the instructions. I recommend using an SD card of at least 8GB in size. Complete all the first boot stages and it is ready to go.
These Instructions have been written for the U3, but should work on the U2
You need to complete the steps in Initial Steps and Update the kernel before going any further.
update the software repositories:
yum update
Install the following software
yum install -y gcc gcc-c++ make openssl-devel newt-devel ncurses-devel doxygen libtermcap-devel libxml2-devel perl curl curl-devel libusb libusb-devel zlib-devel unixODBC-devel libtool libpri alsa-oss
Download the current version of Allstar/Asterisk with app_rpt and a modified version of zaptel and Untar them:
The modified version of zaptel is here on the website: zaptel.tar.gz
wget stats.allstarlink.org/dl/installcd/files.tar.gz tar zxvf zaptel.tar.gz tar zxvf files.tar.gz
After kernel 3.8 The kernel has depreciated CONFIG_PROC_FS function. meaning it may be the end of Zaptel. We will have to try and use DahDi
I have patched zaptel to allow it to work with the newer kernel of the odroid. Build it:
cd ~/zaptel ./configure KSRC=~/linux-odroid-3.8.y make menuconfig
In the zaptel menuconfig, you only need to select ztdummy in the kernel modules.
Now install zaptel:
KSRC=~/linux-odroid-3.8.y make KSRC=~/linux-odroid-3.8.y make install KSRC=~/linux-odroid-3.8.y make config KSRC=~/linux-odroid-3.8.y make install-udev
There is an installation fault with udevadm and zaptel. This causes the incorrect devices in /dev. rather than re-writing the code, there is a simple fix for this:
The command make install-udev installs a file in /etc/udev/rules.d called zaptel.rules
rename this file to 20zaptel.rules
mv zaptel.rules 20zaptel.rules
This means the file will be called towards the beginning of the system startup.
This file needs to be modified with symlinks to make sure the correct devices appear to the system.
nano 20zaptel.rules
Modify the contents of this file as follows (Add the SYMLINK bits):
# udev rules to generate the /dev/zap device files (if not yet provided # by your distribution): KERNEL=="zapctl", NAME="zap!ctl", SYMLINK+="zap/ctl" KERNEL=="zaptranscode", NAME="zap!transcode", SYMLINK+="zap/transcode" KERNEL=="zaptimer", NAME="zap!timer", SYMLINK+="zap/timer" KERNEL=="zapchannel", NAME="zap!channel", SYMLINK+="zap/channel" KERNEL=="zappseudo", NAME="zap!pseudo", SYMLINK+="zap/pseudo" KERNEL=="zap[0-9]*", NAME="zap!%n", SYMLINK+="zap/%n" # zaptel devices with ownership/permissions for running as non-root SUBSYSTEM=="zaptel", OWNER="asterisk", GROUP="asterisk", MODE="0660"
The kernel module will not load on boot so a config file needs to be made that automatically loads it.
echo ztdummy > /etc/modules-load.d/zaptel.conf
Now set zaptel to start on boot:
chkconfig zaptel on
after you run that script you can start zaptel:
service zaptel start
The Alsa-oss emulation drivers need to be loaded before the Asterisk program or it will fail with a usb lockup. Create a file that automatically loads it:
echo snd-pcm-oss > /etc/modules-load.d/pcm-snd-oss.conf
for the interim, to load it before a reboot, run the following command:
modprobe snd-pcm-oss
I have modified a version of chan-usbradio.tar.gz This file could be an old version of the file.
We now need to edit the chan_usbradio.c file. Remove any occurences of this string:
&& !defined(AST_BUILDOPT_LIMEY)
This will make sure that chan_usb compiles correctly under the kernel that the odriod runs.
cd ~/asterisk/channels nano chan_usbradio.c
You also need to add the following includes at the start of the file:
#include <dirent.h> #include <libgen.h>
This goes between #include <search.h> and #include <linux/ppdev.h> around line 50 or so.
Move into the Asterisk source folder created above.
Run the following command to create the build menu:
./configure && make menuselect
When the menu appears, make sure you select at least app_rpt and chan_usbradio.
After selecting all the items you want, save the changes.
Now run:
make && make install
By default Asterisk is not installed as a service. To accomplish this a file needs to be copied to the init.d folder:
cp ~/asterisk/contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
Asterisk can now be started by the following:
service asterisk start
As Udevadm loads devices and other things willy nilly, and as I do not know how to make them sequence, we need to build a couple of little scripts to make asterisk load well and truly after snd-pcm-oss loads. To do this, run the following commands:
Create a delayed start program:
cd ~ echo #/bin/bash > delaystart.sh echo "" >> delay start.sh echo "/usr/bin/at now +2 minutes < /root/astart.sh"
Create the asterisk start program:
cd ~ echo #/bin/bash > astart.sh echo "" >> delay start.sh echo "/usr/sbin/service asterisk start"
Change them to executable:
chmod +x delaystart.sh chmod +x astart.sh
Now a Cron Job needs to be created at reboot that calls the delayed start program:
crontab -e
When editing the crontab, enter the following and press :w :q
to save and exit:
@reboot /usr/bin/sh /root/delaystart.sh >/dev/null &
If all is good, you should be able to reboot the Odroid, and it will load zaptel, ztdummy, pcm-snd-oss and then after 2 mins, Asterisk.
Got to the configs folder and copy the config files for asterisk to run
cd ~/configs cp *.conf /etc/asterisk/ cd usbradio cp *.conf /etc/asterisk/
After the config files have been copied, restart asterisk:
service asterisk restart
It should now be looking for a fob and attempting to work.
To get the sound files specific to app_rpt, goto the asterisk source folder and enter the following:
cp sounds/* /var/lib/asterisk/sounds -a
The configuration files are fairly self explanatory, and there is mountains of information at Allstarlink.org
Anything out of the ordinary, and examples on how to reload asterisk from the keypad/web interface so the radio's can change identity (ie from analogue to D-star) will eventually turn up here.
I have noticed that the Odroid has trouble with DSP processing. however when the monitor is not connected from boot, it free's up processing power and looks to be able to handle it.
The USB ports keep their numbers, so having a 3 radio controller should not be an issue at all. I would like to find a USB host with a multiTT chip inside it to see if it can be expanded to 7 ports (2 on the 'droid and 5 on the hub).