This is an old revision of the document!
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 Setting up the Odroid and Kernel Operations before going any further.
update the software repositories: <pre>yum update</pre>
Install the following software <pre>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</pre>
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 <pre>wget stats.allstarlink.org/dl/installcd/files.tar.gz tar zxvf zaptel.tar.gz tar zxvf files.tar.gz </pre>
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: <pre>cd ~/zaptel ./configure KSRC=~/linux-odroid-3.8.y make menuconfig</pre>
In the zaptel menuconfig, you only need to select ztdummy in the kernel modules.
Now install zaptel: <pre>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</pre>
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
<pre>mv zaptel.rules 20zaptel.rules</pre>
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.
<pre>nano 20zaptel.rules</pre>
Modify the contents of this file as follows (Add the SYMLINK bits):
<pre> # 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” </pre>
The kernel module will not load on boot so a config file needs to be made that automatically loads it.
<pre>echo ztdummy > /etc/modules-load.d/zaptel.conf</pre>
Now set zaptel to start on boot:
<pre>chkconfig zaptel on</pre>
after you run that script you can start zaptel: <pre>service zaptel start</pre>
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:
<pre>echo snd-pcm-oss > /etc/modules-load.d/pcm-snd-oss.conf</pre>
for the interim, to load it before a reboot, run the following command:
<pre>modprobe snd-pcm-oss</pre>
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: <pre>&& !defined(AST_BUILDOPT_LIMEY)</pre> This will make sure that chan_usb compiles correctly under the kernel that the odriod runs. <pre>cd ~/asterisk/channels nano chan_usbradio.c</pre>
You also need to add the following includes at the start of the file: <pre>#include <dirent.h> #include <libgen.h></pre>
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: <pre>./configure && make menuselect</pre>
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:
<pre>make && make install</pre>
By default Asterisk is not installed as a service. To accomplish this a file needs to be copied to the init.d folder:
<pre>cp ~/asterisk/contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk</pre>
Asterisk can now be started by the following: <pre>service asterisk start</pre>
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: <pre>cd ~ echo #/bin/bash > delaystart.sh echo “” » delay start.sh echo “/usr/bin/at now +2 minutes < /root/astart.sh”</pre>
Create the asterisk start program: <pre>cd ~ echo #/bin/bash > astart.sh echo “” » delay start.sh echo “/usr/sbin/service asterisk start”</pre>
Change them to executable: <pre> chmod +x delaystart.sh chmod +x astart.sh </pre>
Now a Cron Job needs to be created at reboot that calls the delayed start program: <pre>crontab -e</pre>
When editing the crontab, enter the following and press :w :q
to save and exit:
<pre>@reboot /usr/bin/sh /root/delaystart.sh >/dev/null &
</pre>
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 <pre> cd ~/configs cp *.conf /etc/asterisk/ cd usbradio cp *.conf /etc/asterisk/</pre>
After the config files have been copied, restart asterisk: <pre>service asterisk restart</pre>
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: <pre>cp sounds/* /var/lib/asterisk/sounds -a</pre>
The configuration files are fairly self explanatory, and there is mountains of information at [http://www.ohnosec.org/drupal ohnosec.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).