RadioReference on Facebook   RadioReference on Twitter   RadioReference Blog
 

Go Back   The RadioReference.com Forums > Software > Digital Voice Decoding Software

Digital Voice Decoding Software For discussion of software applications which decode digital voice formats such as P25, NXDN, MotoTRBO, etc. Please use the HF Digital Signals forum for anything below 30MHz.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-2012, 9:56 AM
Member
   
Join Date: Dec 2012
Posts: 4
Post DSD for Raspberry Pi

Hello everyone!

I decided to share my successes/failures so far in compiling DSD on the Raspbian Wheezy distribution for the Raspberry Pi.

---Setup---
- Raspberry Pi Model-B with 256MB of RAM.
- USB Microphone-in for discriminator audio-in (C-Media device: http://dx.com/p/virtual-5-1-surround-usb-2-0-external-sound-card-22472)
- Raspbian Wheezy distro, 2012-10-28-wheezy-raspbian
- 4GB SD card
- MbeLib 1.2.3 https://github.com/szechyjs/mbelib
- DSD 1.4.1 https://github.com/szechyjs/dsd (I am using the copy from here since other people have not been releasing their source code for their patches/forks)

---OS Install---
1. Download Raspbian "wheezy", (http://www.raspberrypi.org/downloads)
2. Install onto SD card using Win32DiskImager or dd (http://www.raspberrypi.org/downloads)
3. Connect RaspberryPi to an internet connection with DHCP
4. Attach Keyboard and USB sound card
5. Boot RaspberryPi and login with user: pi password: raspberry
6. Close the config tool that first comes up by hitting Esc.
7. Update/upgrade system utils. I used the command: "sudo apt-get update && sudo apt-get upgrade" (this will take a while)

If you can't get to this point, see: http://elinux.org/R-Pi_Troubleshooting

---DSD Install---
7. Type the following lines:
cd ~
mkdir dsd-src
cd dsd-src
wget -O mbelib.zip https://github.com/szechyjs/mbelib/archive/master.zip
wget -O dsd.zip https://github.com/szechyjs/dsd/archive/master.zip
unzip mbelib.zip
unzip dsd.zip
cd mbelib-master
sudo make
sudo make install
cd ..
cd dsd-master
sudo make
sudo make install
cd /
dsd -h


---Running DSD (Experimental)---
By default, Raspbian won't have a /dev/audio or /dev/dsp for DSD to use. You have to enable OSS emulation.

8. Enable OSS emulation: sudo modprobe snd-pcm-oss

Now there should be a /dev/dsp and /dev/dsp1 (as well as a /dev/audio and /dev/audio1). dsp1 is most likely your USB sound card.



10. Start DSD by typing: dsd -i /dev/dsp1 -o /dev/dsp1 [Options].
For example, I use: dsd -i /dev/dsp1 -o /dev/dsp1 -fp -v 1



Current issues:
-Whenever I try to use the RaspberryPi audio output (via HDMI or built-in output jack), DSD causes a kernel panic. So I just stick with the USB in/out (/dev/dsp1). I don't know if this is a USB stack issue, and OSS emulation issue, or what.

-Decoding is very slow and almost unusable. I have only tested ProVoice at this point, so I'll be tweaking the settings/DSD code to hopefully optimize it.

-You may want to try overclocking your RaspberryPi, see: http://lifehacker.com/5944867/overcl...-your-warranty


I would like to hear everyone else's opinions and experiences concerning anything OSS/ALSA/DSD.

Cheers.
Reply With Quote
Sponsored links
  #2 (permalink)  
Old 12-09-2012, 8:25 PM
rick10's Avatar
Member
  Amateur Radio Operator
Amateur Radio
 
Join Date: Mar 2004
Location: rick10
Posts: 12
Default DSD on Rasberry PI

I also am trying to get DSD running on my Rasberry PI. I did the same as you show and wasn't getting much. I added the compiler options:
-march=armv6
-mfpu-vfp
-mfloat-abi=hard

This helped a little. Then I setup over clocking to 800Mhz.
I set the boot variable dwc_otg.speed=1 to lower the USB speed. Not sure this did anything.

I still don't really have decent decode? It may just be that the hardware is just not enough.
Reply With Quote
  #3 (permalink)  
Old 12-10-2012, 2:09 PM
Member
   
Join Date: Dec 2012
Posts: 4
Default

I'm wondering if OSS emulation is causing a performance hit, and if implementing ALSA audio would improve the capture/playback?

I tried aplay/arecord to make sure the audio device could record and playback 48000 bit audio and it worked fine, no underruns.

I'm going to try determining which piece of code is struggling so bad.
Reply With Quote
  #4 (permalink)  
Old 12-11-2012, 1:33 PM
Member
   
Join Date: Dec 2012
Posts: 4
Default

I have done some further tests with a Provoice IMB file. Right now it takes RPi DSD 17 seconds to decode 7 seconds worth of audio, versus an Ubuntu VM that takes < 1 second to decode the same audio.

Tried this with the gcc flags you mentioned as well.
Reply With Quote
  #5 (permalink)  
Old 12-13-2012, 8:59 AM
rick10's Avatar
Member
  Amateur Radio Operator
Amateur Radio
 
Join Date: Mar 2004
Location: rick10
Posts: 12
Default

I did some tests on my system and ran both my system and the pi at the same time and I agree the PI is way behind in decode. I am afraid the difference is so great we may not be able to fix it. I ran dsd with valgrind on my system to see where we could look to optimize but I think this is just beyond my capabilites. I am testing on Nexedge signal so my results will be different but the most time is predictably spent in the mbelib section for getframe. There is a lot of floating point math so someone that is good with C may be able to optimize some of it.
Reply With Quote
Sponsored links
  #6 (permalink)  
Old 12-13-2012, 6:53 PM
Member
   
Join Date: Dec 2012
Posts: 4
Default

I've started converting the library and DSD to use a 32-bit fixed-point numbering system. Once I've got all the bugs worked out I'll share my findings. I hope that I can maintain the level of precision required, and if the floating point tables are any indicator of that, then it should work. We'll see if its any faster though.

The fixed point library I'm using is based on this: Fixed Point Math Library for C | Free software downloads at SourceForge.net
Reply With Quote
  #7 (permalink)  
Old 12-17-2012, 3:30 AM
Member
   
Join Date: Sep 2002
Location: Toronto, Ontario
Posts: 2,364
Default

Quote:
Originally Posted by rick10 View Post
I did some tests on my system and ran both my system and the pi at the same time and I agree the PI is way behind in decode. I am afraid the difference is so great we may not be able to fix it.
Of course it can be fixed. DSD wastes resources (RAM and CPU) just about everywhere in the code. You may want to start with the million cosine values that are calculated every second - a full one third of which aren't even used! That 33% reduction in CPU load alone almost gets you to your real time decoding goal.
Reply With Quote
  #8 (permalink)  
Old 01-07-2013, 4:04 PM
AZScanner's Avatar
Member
   
Join Date: Dec 2002
Location: Somewhere in this room. Right now, you're very cold.
Posts: 3,110
Default

Wow, glad I read up on this before running out and getting one - I had the crazy idea that a Raspberry could run both DSD and a trunked channel decoder. I guess that was expecting WAY too much from one of these little machines.

Oh well, it was fun to dream.
-AZ
__________________
Author of ActiveEMS - Phoenix Fire Now Free!
Coming soon: http://phoenixfirevideos.net
Incident Notification now in Beta on Twitter: @PhoenixFireVids
Reply With Quote
  #9 (permalink)  
Old 06-24-2013, 8:21 AM
rick10's Avatar
Member
  Amateur Radio Operator
Amateur Radio
 
Join Date: Mar 2004
Location: rick10
Posts: 12
Default DSD running on odroid-x2

I got DSD to run on a odroid-x2 platform which has a 1.6g clock rate. The boards are $135.00 so no where near as cheap as the raspberry pi.

I converted DSD to use pulseaudio so I didn't have to worry about the emulation and that does seem to save some cpu cycles on the pulseaudio server. I guess the next step is to see if I can make it work on android with all these smart phones out there that would be a cheap and packaged way to run DSD.
Reply With Quote
Sponsored links
  #10 (permalink)  
Old 09-03-2013, 4:00 PM
Member
  Premium Subscriber
Premium Subscriber
Amateur Radio Operator
Amateur Radio
 
Join Date: Nov 2009
Location: oxford,ma
Posts: 7
Default raspberry pi and dsd update

as pi's firmware, raspbian, mbelib, and dsd have all been updated in the months since the original post, i decided to try this myself using a raspberry pi "b", rs pro-2048 w/discriminator tap, homemade patch cable and logitech usb dongle (i've used the scanner, cable and dongle for several years with unitrunker running on windows 7).

installed from 2013-07-26-wheezy-raspbian.img and did all the usual sysadmin tasks such as updating packages and firmware, etc., etc., then did the following:

sudo apt-get install cmake
cd ~
mkdir dsd-src
cd dsd-src
wget -O mbelib.zip https://github.com/szechyjs/mbelib/archive/master.zip
wget -O dsd.zip https://github.com/szechyjs/dsd/archive/master.zip
unzip mbelib.zip
unzip dsd.zip
rm *.zip
cd mbelib-master
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib
cd ~/dsd-src/dsd-master
mkdir build
cd build
cmake ..
make
sudo make install
add snd-pcm-oss to /etc/modules
amixer cset numid=3 1
<reboot>

moved the dongle over to the pi and ...

for a brief few (10 or so) seconds i was getting informational output for a live p25 transmission after executing "dsd -i /dev/dsp1 -n -v 1"

then ... nothing ... not a single bit of output for the past three days ... i've rebooted multiple times and quadruple checked everything i can think of that could help and even over-clocked ... suspecting an issue with the scanner/cable/dongle i moved them back over to the win7 pc, d/l'ed dsd106.exe and a cygwin1.dll and was immediately presented with textual information regarding live p25 transmissions along with dstar from my dvap/id51a combo.

not really sure what this all means ... it was working for a few seconds and has not since for many hours ... no idea what to look at to see if it can be persuaded to function again ... if anyone has any ideas or suggestions, i'm open.

-p
Reply With Quote
  #11 (permalink)  
Old 12-02-2013, 10:56 PM
Markb's Avatar
Member
  Premium Subscriber
Premium Subscriber
Amateur Radio Operator
Amateur Radio
 
Join Date: Feb 2002
Location: Planet Earth
Posts: 604
Default

I may be barking up the wrong tree here, but I was just reading this in the DSD source code on github:

" The best sound and minimum cpu usage is achieved with separate sound
cards for input and output
********

if you specify different input/output devices DSD will use 8k as the
output sample rate and the lack of resampling results in much better
audio as well as lower cpu consumption."

Could having a sound card on the output side be enough to get the Pi to decode?


Sent from my Samsung Galaxy S4 using Tapatalk
Reply With Quote
  #12 (permalink)  
Old 12-03-2013, 12:23 AM
Member
   
Join Date: Sep 2002
Location: Toronto, Ontario
Posts: 2,364
Default

Quote:
Originally Posted by Markb View Post
Could having a sound card on the output side be enough to get the Pi to decode?
No. Upsampling adds 80,000 floating point multiplies and 120,000 floating point divides every second, but that's a drop in the bucket compared to the one million cosine values calculated every second. If you want your Pi, implement a cosine lookup table.
Reply With Quote
  #13 (permalink)  
Old 02-24-2014, 12:25 AM
The_dog's Avatar
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Aug 2004
Posts: 140
Default

I noted the ram Raspberry Pi Model-B with 256MB of RAM.
from my notes of dsd the ram should be 512MB of Ram Min
and the cpu speed needs to be ??? Speed ??? because I don't know the
speed off hand I have the info written down some where
will post later
Reply With Quote
  #14 (permalink)  
Old 09-11-2014, 8:43 PM
Member
   
Join Date: Sep 2014
Posts: 14
Default Model B+

I have not conducted thorough research on running DSD on a Raspberry, however from earlier posts here is appears the issue has been insufficient RAM i.e. 256MB on the Pi.

Well, the new Model B+ which was released in July has 512MB.

Has anyone begun to look once more at Pi DSD decoding?
Reply With Quote
  #15 (permalink)  
Old 09-18-2014, 9:59 AM
poltergeisty's Avatar
Member
   
Join Date: May 2004
Location: RLG, Fly heading 053, intercept 315 DVV, look for the SAM
Posts: 3,460
Default

I ran DSD+ on a Dell Mini 910 netbook and it produced about 70% decode rate. The netbook only has an Atom 1.6 GHz proc. So compare a PI to that and see what you will get.

I'm even surprised a USB sound card can decode due to the sample rate those things have.
__________________
Sent from my PSX emulator.


Reply With Quote
Sponsored links
  #16 (permalink)  
Old 09-18-2014, 11:16 AM
mancow's Avatar
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Feb 2003
Location: N.E. Kansas
Posts: 4,666
Default

Would this be of any use or improvement?

https://www.sparkfun.com/products/13025

Powered by the Intel® Atom™ SoC dual-core CPU and including an integrated WiFi, Bluetooth LE, and a 70-pin connector to attach a veritable slew of shield-like “Blocks” which can be stacked on top of each other. It’s no wonder how this little guy is lowering the barrier of entry on the world of electronics!

The Intel® Edison packs a robust set of features into its small size, delivering great performance, durability, and a broad spectrum of I/O and software support.
Reply With Quote
  #17 (permalink)  
Old 09-18-2014, 2:19 PM
vince48's Avatar
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: May 2001
Location: Hayward, CA.
Posts: 491
Default

interesting!
Reply With Quote
  #18 (permalink)  
Old 09-18-2014, 3:09 PM
Forts's Avatar
Mentor
  RadioReference Database Admininstrator
Database Admin
Audio Feed Provider
Audio Feed Provider
 
Join Date: Dec 2002
Location: Strathroy, Ontario Canada
Posts: 3,942
Default

Odd... I can run DSD+ on my atom powered netbook with perfect decoding and it barely breaks a sweat.

Sent from my SGH-I747M using Tapatalk
__________________
Middlesex County/Strathroy-Caradoc Fire Paging Alerts: http://groups.google.com/group/middlesex-fire
Reply With Quote
  #19 (permalink)  
Old 09-18-2014, 5:30 PM
Member
   
Join Date: Dec 2005
Posts: 225
Default

- Odd... I can run DSD+ on my atom powered netbook with perfect decoding and it barely breaks a sweat.

Same for me. I did find though that the quality/sampling rate of the soundcard can make a massive difference
Reply With Quote
  #20 (permalink)  
Old 09-19-2014, 12:15 AM
Markb's Avatar
Member
  Premium Subscriber
Premium Subscriber
Amateur Radio Operator
Amateur Radio
 
Join Date: Feb 2002
Location: Planet Earth
Posts: 604
Default

Here is another possibility:

http://www.tbsdtv.com/launch/tbs-291...m-mini-pc.html

I think we are getting close ......
Reply With Quote
Reply

Tags
alsa, digital voice decoding, dsd, oss, raspberry pi

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 2:05 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
All information here is Copyright 2012 by RadioReference.com LLC and Lindsay C. Blanton III.Ad Management by RedTyger
Copyright 2011 by RadioReference.com LLC Privacy Policy  |  Terms and Conditions