Difference between revisions of "OP25"
m (→DES-OFB & More) |
|||
Line 43: | Line 43: | ||
* Uses Pavel's <tt>imbe_vocoder</tt>, which at the time produced better audio than the internal <tt>software_imbe_decoder</tt> | * Uses Pavel's <tt>imbe_vocoder</tt>, which at the time produced better audio than the internal <tt>software_imbe_decoder</tt> | ||
− | It should also be noted that the code is ugly (e.g. decryption done inside <tt>software_imbe_decoder.cc</tt> and decrypted frames are sent from there to <tt>imbe_vocoder</tt>). | + | It should also be noted that the code is '''hacking ugly''' (e.g. decryption done inside <tt>software_imbe_decoder.cc</tt> and decrypted frames are sent from there to <tt>imbe_vocoder</tt>). |
Instructions: | Instructions: | ||
Line 51: | Line 51: | ||
# Apply the [patch] in the source directory | # Apply the [patch] in the source directory | ||
#: <pre>patch -p0 < r219.des-ofb.diff</pre> | #: <pre>patch -p0 < r219.des-ofb.diff</pre> | ||
− | # Configure | + | # Configure, compile and install <tt>imbe_vocoder</tt> |
− | # | + | # In <tt>imbe_vocoder/src/lib/.libs</tt>, add some symlinks to provide libraries to the linker: |
− | # Modify your environment so the linker can find the imbe_vocoder: | + | #: <tt>ln -s _op25_imbe.so libop25_imbe.so</tt> |
+ | #: <tt>ln -s ../_op25_imbe.la _op25_imbe.la</tt> | ||
+ | # Modify your environment so the linker/loader can find the <tt>imbe_vocoder</tt>: | ||
#: <pre>LD_LIBRARY_PATH=<OP25 build directory>/imbe_vocoder/src/lib/.libs:/usr/local/lib:$LD_LIBRARY_PATH</pre> | #: <pre>LD_LIBRARY_PATH=<OP25 build directory>/imbe_vocoder/src/lib/.libs:/usr/local/lib:$LD_LIBRARY_PATH</pre> | ||
− | # | + | # Modify <tt>decoder/src/lib/Makefile.am</tt> to link to the <tt>imbe_vocoder</tt>. Altered lines are shown in full: |
+ | #:* <tt>AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) -I../../../imbe_vocoder/src/lib</tt> | ||
+ | #: For <tt>_op25_la_LIBADD = \</tt>, add an extra line (don't forget the slash to continue the previous line!): | ||
+ | #:* <tt>-L../../../imbe_vocoder/src/lib/.libs -lop25_imbe</tt> | ||
# Copy <tt><build directory>/imbe_vocoder/src/lib/_op25_imbe.so</tt> and <tt><build directory>/imbe_vocoder/src/lib/_op25_imbe.la</tt> to GNU Radio's Python installation directory, for example: | # Copy <tt><build directory>/imbe_vocoder/src/lib/_op25_imbe.so</tt> and <tt><build directory>/imbe_vocoder/src/lib/_op25_imbe.la</tt> to GNU Radio's Python installation directory, for example: | ||
#: <pre>/usr/local/lib/python2.7/dist-packages/gnuradio/</pre> | #: <pre>/usr/local/lib/python2.7/dist-packages/gnuradio/</pre> | ||
+ | # Configure, compile and install <tt>decoder</tt> | ||
Then you can test the decoder in GNU Radio Companion (as above) with [http://svn.spench.net/main/gr-baz/samples/OP25.grc OP25.grc] from [[gr-baz#OP25|gr-baz]], or you can run <tt>audio_p25_rx.py</tt> as follows: | Then you can test the decoder in GNU Radio Companion (as above) with [http://svn.spench.net/main/gr-baz/samples/OP25.grc OP25.grc] from [[gr-baz#OP25|gr-baz]], or you can run <tt>audio_p25_rx.py</tt> as follows: |
Revision as of 18:03, 9 November 2012
OP25 is an open-source implementation of the APCO Project 25 digital radio standard.
There have been a number of changes in its dependencies that cause recent version not to work. The important ones are:
- Removal of Legacy USRP code from GNU Radio (replaced by UHD)
- IT++ BCH routine no longer behaves as expected, so the error checking on the frame header never succeeds
- GNU Radio (and GRUEL) have changed and certain files are no longer found by the build system (e.g. gruel_common.i)
Here are some notes on getting it working.
Note: if you already have OP25 installed, fear not! I have published detailed instructions on how you can easily have multiple side-by-side installations of the same GNU Radio module, such as OP25.
Latest
This section applies to version 306 of the SVN source.
Apply the patch in the root of your source directory:
patch -p0 < r307.diff
Then go through the build process from the top (i.e. you must start with bootstrap!).
From gr-baz, copy (or symlink) the Legacy USRP shim usrp.py into the GNU Radio Python directory. This will enable all applications that use the legacy USRP Source Python interface to talk to any device supported by UHD! For example:
sudo ln -s ~/src/gr-baz/python/usrp.py /usr/local/lib/python2.7/dist-packages/gnuradio/usrp.py
Once OP25 is installed, you can test the decoder in GNU Radio Companion by opening the OP25.grc file. Make sure you:
- download, compile and install gr-baz for its OP25 extensions
- enable the appropriate source block for your setup (e.g. USRP, RTL2832U dongle or file source), and disable the rest!
DES-OFB & More
A while ago I modified version 219 of the SVN source to support DES-OFB decryption, among other things. This went unmaintained and was never merged. Therefore proceed at your own risk. Perhaps a kind soul will consider merging into the latest source?
This version has several features:
- DES-OFB decryption (entered as 64-bit hex key, uses Phil Karn's DES source)
- Dumps voice frames, encryption state and more to console
- Error correction on Low Speed Data Word
- Hamming error detection at frame level
- Decodes additional information from LDU1 and LDU2
- Uses Pavel's imbe_vocoder, which at the time produced better audio than the internal software_imbe_decoder
It should also be noted that the code is hacking ugly (e.g. decryption done inside software_imbe_decoder.cc and decrypted frames are sent from there to imbe_vocoder).
Instructions:
- Check out version 219of the SVN source:
-
svn co http://op25.osmocom.org/svn/trunk@219 op25
-
- Apply the [patch] in the source directory
-
patch -p0 < r219.des-ofb.diff
-
- Configure, compile and install imbe_vocoder
- In imbe_vocoder/src/lib/.libs, add some symlinks to provide libraries to the linker:
- ln -s _op25_imbe.so libop25_imbe.so
- ln -s ../_op25_imbe.la _op25_imbe.la
- Modify your environment so the linker/loader can find the imbe_vocoder:
-
LD_LIBRARY_PATH=<OP25 build directory>/imbe_vocoder/src/lib/.libs:/usr/local/lib:$LD_LIBRARY_PATH
-
- Modify decoder/src/lib/Makefile.am to link to the imbe_vocoder. Altered lines are shown in full:
- AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) -I../../../imbe_vocoder/src/lib
- For _op25_la_LIBADD = \, add an extra line (don't forget the slash to continue the previous line!):
- -L../../../imbe_vocoder/src/lib/.libs -lop25_imbe
- Copy <build directory>/imbe_vocoder/src/lib/_op25_imbe.so and <build directory>/imbe_vocoder/src/lib/_op25_imbe.la to GNU Radio's Python installation directory, for example:
-
/usr/local/lib/python2.7/dist-packages/gnuradio/
-
- Configure, compile and install decoder
Then you can test the decoder in GNU Radio Companion (as above) with OP25.grc from gr-baz, or you can run audio_p25_rx.py as follows:
./audio_p25_rx.py -f <freq>M -R <side> -O -o <output WAV file>.wav -k <DES key, 16 hex chars>
|