How to build DSD 1.7 with Cygwin

Status
Not open for further replies.

M105

Member
Joined
Sep 13, 2005
Messages
399
I would like to do some experimenting with the old DSD source code under Windows. I found these instructions on rtl-sdr.com https://www.rtl-sdr.com/tag/cygwin/

I made it to step 5 but I am unable to link the files. I have installed all the libsndfile libraries available in Cygwin and have tried to link using many variations of this command.
gcc -lsndfile *.o -o dsd.exe

The libsndfile is being found but the linker is reporting undefined references to the calls to various sndfile routines within the object files.
-----------------
I am not a linux guru so I am somewhat lost in all this. Please keep this in mind when answering!
---
Can someone please help by providing some detailed instructions or pointing me to some information. Thanks!
 

M105

Member
Joined
Sep 13, 2005
Messages
399
Thanks! I tried it but get the same errors. Here is what the compiler is reporting:

dsd_audio.o:dsd_audio.c:(.text+0x5f6): undefined reference to `sf_write_short'
dsd_audio.o:dsd_audio.c:(.text+0x9e2): undefined reference to `sf_open_fd'
dsd_audio.o:dsd_audio.c:(.text+0xa0a): undefined reference to `sf_strerror'
dsd_audio.o:dsd_audio.c:(.text+0xb24): undefined reference to `sf_open'

and so on...
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
The 'sf_xxxxxx' references are for "libsndfile"

Maybe path to "libsndfile" library is not defined?

EDIT:
In your first post you said you used "gcc -lsndfile *.o -o dsd.exe"
I just found something that mentioned the switch might be:

Code:
-lsndfile-1
 
Last edited:

M105

Member
Joined
Sep 13, 2005
Messages
399
Yes sndfile-1.dll did eliminate the sf_ errors. Apparently I didn't compile the dsd files properly as I am still getting some other reference errors.

dsd_frame.odsd_frame.c(.text+0xb7e): undefined reference to `check_NID'
dsd_main.odsd_main.c(.text+0x1051): undefined reference to `GIT_TAG'
p25p1_hdu.op25p1_hdu.c(.text+0x21e): undefined reference to `check_and_fix_golay_24_6'
p25p1_hdu.op25p1_hdu.c(.text+0x389): undefined reference to `encode_golay_24_6'
p25p1_hdu.op25p1_hdu.c(.text+0x549): undefined reference to `check_and_fix_redsolomon_36_20_17'
p25p1_hdu.op25p1_hdu.c(.text+0x5c4): undefined reference to `encode_reedsolomon_36_20_17'
p25p1_ldu.op25p1_ldu.c(.text+0x357): undefined reference to `check_and_fix_hamming_10_6_3'
p25p1_ldu.op25p1_ldu.c(.text+0x442): undefined reference to `encode_hamming_10_6_3'
p25p1_ldu1.op25p1_ldu1.c(.text+0x8b5): undefined reference to `check_and_fix_reedsolomon_24_12_13'
p25p1_ldu1.op25p1_ldu1.c(.text+0x930): undefined reference to `encode_reedsolomon_24_12_13'
p25p1_ldu2.op25p1_ldu2.c(.text+0x933): undefined reference to `check_and_fix_reedsolomon_24_16_9'
p25p1_ldu2.op25p1_ldu2.c(.text+0x9ae): undefined reference to `encode_reedsolomon_24_16_9'
p25p1_tdulc.op25p1_tdulc.c(.text+0x126): undefined reference to `check_and_fix_golay_24_12'
p25p1_tdulc.op25p1_tdulc.c(.text+0x20e): undefined reference to `encode_golay_24_12'
p25p1_tdulc.op25p1_tdulc.c(.text+0x432): undefined reference to `check_and_fix_reedsolomon_24_12_13'
p25p1_tdulc.op25p1_tdulc.c(.text+0x4dd): undefined reference to `encode_reedsolomon_24_12_13'
collect2: error: ld returned 1 exit status
 
S

simpilo

Guest
try this

https://www.george-smart.co.uk/scrapbook/digital_speech_decoder/

it works but sometimes mbelib gets placed in a folder DSD doesn't see so you have to find three mbelib files and move them to the right folder DSD expects..Using local loop helps too. I had best results on Lubuntu Xenial. It should work on any Debian distro.

if mbelib error examples

Find it:
sudo find / | grep -i libmbe.so.1

moving it
sudo ln -s /usr/local/lib/i386-linux-gnu/libmbe* /usr/lib/

never forget sudo ldconfig
 
Last edited:
S

simpilo

Guest
Yes its a linux build. DSD 1.7 will have high cpu usage in Windows. Use it in a linux distro.
 

M105

Member
Joined
Sep 13, 2005
Messages
399
Thanks again but respectfully, that isn't what I was asking for. I want to build it with Cygwin.
 

woodpecker

Member
Joined
Aug 7, 2005
Messages
729
I can't remember which version of the source exactly that I use and I've heavily modified it for things like basic privacy but I wrote a compile script to use in Cygwin as below:-

cd /home/dsd-1.7
make clean
cd /home/mbelib-1.2.3
make clean
make -j5
sleep 2
cp /home/mbelib-1.2.3/*.o /home/dsd-1.7
cd /home/dsd-1.7
make -j5
sleep 5
gcc -O2 -Wall -L/usr/local/lib -o dsd mbelib.o dsd_main.o dsd_symbol.o dsd_dibit.o dsd_frame_sync.o dsd_file.o dsd_audio.o dsd_serial.o dsd_frame.o dsd_mbe.o dsd_upsample.o p25p1_hdu.o p25p1_ldu1.o p25p1_ldu2.o p25p1_tdulc.o p25_lcw.o x2tdma_voice.o x2tdma_data.o dstar.o dstar_header.o nxdn_voice.o nxdn_data.o dmr_voice.o dmr_data.o provoice.o ambe3600x2250.o imbe7200x4400.o ecc.o imbe7100x4400.o ambe3600x2400.o
cp ./dsd.exe ..
 

mk92682

Newbie
Joined
Oct 6, 2018
Messages
1
Could you please kindly share the modified source? For science, obviously.
Thanks so much.
 

M105

Member
Joined
Sep 13, 2005
Messages
399
THANK YOU WOODPECKER.

I will digest all that the first chance I get.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
OK had a go at compiling DSD 1.7 using Cynwin and got it going.

Compiled on Windows 7 Professional 32 bit

This is what did:
Code:
[b]Install Cynwin[/b]

Create folder cynwin_install somewhere in HDD
 - Download web installer from [url]https://cygwin.com/install.html[/url]
 - Run installer
   - Click "Run" at the "Open file - Security Warning"
   - Click "Yes" at the UAC dialog
   - Click "Next"
   - "Install from Internet"
   - Set "Root Directory" - Anywhere that doesn't have white space in path
     - "Install For" "All Users"
   - Set "Local Package Directory" same as "Root Directory" if you like.
   - Click Next (Use System Proxy Settings)
   - Will access net to retrieve list of "Available Download Sites"
     - Select one and Click Next
   - Will access net to retrieve list of packages
   - Full screen will show packages
     - View = "Category" 
     - Use search feature to install the following packages:

*** [This is what I installed - All of them may not be needed] ***
 
===============================================================================

Search sndfile:

 - Audio   - [bin][src]  mingw64-x86_64-libsndfile: Sampled audio data library (1.0.28-2)
 - Libs    - [bin][src]  libsndfile-devel: Sampled audio data library (1.0.28-2)
             [bin][src]  libsndfile 1: Sampled audio data library (1.0.28-2)
           

===============================================================================

Search cmake:

 - Devel   - [bin] cmake: Cross-platform makefile generation system (3.6.2-2)
 - Editors - [bin] emacs-cmake: Cross-platform makefile generation system (Emacs mode) (3.6.2-2)       [not need ?]

===============================================================================

Search make:
 - Devel   - [bin] make: The GNU version of the 'make' utility

===============================================================================
Search gcc:

Probably not all needed

 - Devel   - [bin] [src] gcc-core: GNU Compiler collection (C, OpenMP) (7.3.0-3)
             [bin] gcc-g++: GNU Complier Collection (C++) (7.3.0-3)
             [bin] mingw64-i86-gcc-core: GCC for Win32 (i686-w64-ming32)toolchain (C, OpenMP)(6.4.0-1)
             [bin] mingw64-i686-gcc-g++: GCC for Win32 (i686-w64-ming32)toolchain (C++)(6.4.0-1)
             [bin] mingw64-x86_64-gcc-core: GCC for Win64 toolchain (C, OpenMP)(6.4.0-2)
             [bin] mingw64-x86_64-gcc-g++: GCC for Win64 toolchain (C++)(6.4.0-2)

 - Libs    - [bin] libgcc 1: GCC C runtine library (7.3.0-3)

===============================================================================
 
search portaudio
 - Libs    - [bin] [src] libportaudio-devel: Cross platform audio I/O library

===============================================================================

NOTE: When selecting packages additional packages will automatically be installed






===============================================================================
Additional sources and Compiling
===============================================================================

[b]Compiling mbelib[/b]

 Download mbelib zip from: [url]https://github.com/szechyjs/mbelib[/url]


Extract zip to cynwin installed folder \home\USERNAME\mbelib-master


cd mbelib                           # Move into source folder
mkdir build                         # Create build directory
cd build                            # Move to build directory
cmake ..                            # Create Makefile for current system
make                                # Compiles the library
make install                        # Library is installed into computer

===============

[b]Compiling itpp[/b]

Download "itpp-4.3.1.tar.bz2" from [url]https://sourceforge.net/projects/itpp/files/[/url]

Copy "itpp-4.3.1.tar.bz2" to cynwin installed folder \home\USERNAME\

Extract "itpp-4.3.1.tar.bz2":
 bzip2 -cd itpp-4.3.1.tar.bz2 | tar xf -
 cd itpp-4.3.1

 mkdir build
 cd build
 cmake ..
 make
 make install

==

NOT sure if needed for DSD:
 BLAS library not found.
 LAPACK library not found.
 FFT library not found.

===============

[b]Compile DSD 1.7[/b]

 Downlowd dsd 1.7 zip from: [url]https://github.com/szechyjs/dsd[/url]


Extract zip to cynwin installed folder home\USERNAME\dsd-master1.7

 cd dsd-master1.7                    # Move into source folder
 mkdir build                         # Create build directory
 cd build                            # Move to build directory
 cmake ..                            # Create Makefile for current system
 make                                # Compiles DSD - This shows a few warnings @ 9%, 17% but this seem to be OK
 make install                        # Installs DSD to the system


Compiled files are in the following locations:


 /dsd-master1.7/build/dsd.exe

 /bin cygFLAC-8.dll
 /bin cyggcc_s-1.dll
 /bin cyggomp-1.dll
 /bin cyggsm-1.dll
 /bin cygogg-0.dll
 /bin cygportaudio-2
 /bin cygsndfile-1.dll
 /bin cygstdc++-6.dll
 /bin cygvorbis-0.dll
 /bin cygvorbisenc-2.dll
 /bin cygwin1.dll

 /itpp-4.3.1/build/itpp  cygitpp-8.dll
 /mbelib-master/build    cygmbe-1.dll


Copy them to a folder of your choosing

run DSD with options
 dsd -v   to see options (See: [url]https://github.com/szechyjs/dsd/wiki/Operation[/url])

 dsd -i /dev/dsp -o /dev/dsp   to start decoding

dsd uses default audio input and output devices as set by windows.
I have not had luck using numbers with -i -o options as seen via dsd -a

In test, I set output of SDR# to Virtual Cable line 1 and made it default.
Output to speaker should already be default.

Tested on DMR (-fr)

Hopefully this is useful for people to get it going.
 

M105

Member
Joined
Sep 13, 2005
Messages
399
FANTASTIC!
Maybe if we can get a few more folks working with the code there will be some additions like P25 Phase II.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
For me, All P25 Phase 1 and II are encrypted and are not of interest to me.

You could study the P25 Phase II code that already exists in the OP25 project.
It's a mix of C and Python code but it could give you an idea how to start implementing it.
 

M105

Member
Joined
Sep 13, 2005
Messages
399
I may do that on P25 II code. I wish it was in DSD+ as most of it around me is not encrypted and would be great to have on my Windows setup.
---
I tried following your instructions and have hit a stump at Compile DSD 1.7. When I issue the cmake .. command the error below. Any idea what I did wrong?
========================
$ cmake ..
CMake Warning at /usr/share/cmake-3.6.2/Modules/Platform/CYGWIN.cmake:15 (message):
CMake no longer defines WIN32 on Cygwin!

(1) If you are just trying to build this project, ignore this warning or
quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
the CMake cache. If later configuration or build errors occur then this
project may have been written under the assumption that Cygwin is WIN32.
In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.

(2) If you are developing this project, add the line

set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required

at the top of your top-level CMakeLists.txt file or set the minimum
required version of CMake to 2.8.4 or higher. Then teach your project to
build on Cygwin without WIN32.
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:1 (project)


CMake Error at /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find MBE (missing: MBE_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/FindMBE.cmake:15 (find_package_handle_standard_args)
CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/mrewo/dsd-master/build/CMakeFiles/CMakeOutput.log".
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
I may do that on P25 II code. I wish it was in DSD+ as most of it around me is not encrypted and would be great to have on my Windows setup.
---
I tried following your instructions and have hit a stump at Compile DSD 1.7. When I issue the cmake .. command the error below. Any idea what I did wrong?
========================
$ cmake ..

CMake Warning at /usr/share/cmake-3.6.2/Modules/Platform/CYGWIN.cmake:15 (message):
CMake no longer defines WIN32 on Cygwin!

(1) If you are just trying to build this project, ignore this warning or
quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
the CMake cache. If later configuration or build errors occur then this
project may have been written under the assumption that Cygwin is WIN32.
In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.

(2) If you are developing this project, add the line

set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required

at the top of your top-level CMakeLists.txt file or set the minimum
required version of CMake to 2.8.4 or higher. Then teach your project to
build on Cygwin without WIN32.
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:1 (project)


CMake Error at /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find MBE (missing: MBE_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/FindMBE.cmake:15 (find_package_handle_standard_args)
CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/mrewo/dsd-master/build/CMakeFiles/CMakeOutput.log".

I also received the green text warning. This should be OK to ignore.

The red text indicates the cmake can't find mbelib.a in expected location. I think that location should be \usr\local\lib
This is copied when you run "make install". You sure you did that command?
I think I forgot that command 1st time around.
 

M105

Member
Joined
Sep 13, 2005
Messages
399
I must have missed that step. I got it to compile.
=======================
Thanks a million. Maybe in a few months I will understand what I did! :)
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
I must have missed that step. I got it to compile.
=======================
Thanks a million. Maybe in a few months I will understand what I did! :)

You welcome, let the fun begin.

I left it running since I compiled it. Kind of cool to see where it all started and where it is now.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,845
Using different sound I/O devices with DSD v1.7 on windows

I have been messing around with this code a bit more.

It seems you can select different audio inputs and output devices with DSD v1.7 on windows by using the 'pa:' sub option for the options '-i' and '-o'. Normally you would use: (which only uses the windows default devices)
Code:
dsd -i /dev/dsp -o /dev/dsp

So to get a list of I/O devices use:
Code:
[b]dsd -a[/b]

Then using the numbers portaudio associates with the I/O devices:
Code:
[b]dsd -i pa:1 -o pa:7[/b]

EDIT: I've noticed that when using this method, exiting out of DSD takes a little longer to respond to the CTRL-C.
 
Last edited:
Status
Not open for further replies.
Top