Remote Radio setup - trying to run remote audio , puseaudio and freeDV

174 views
Skip to first unread message

Warren

unread,
Oct 10, 2021, 6:41:17 PM10/10/21
to digitalvoice
Hi,

I used freeDV on Linux earlier in it's development but had a break from radio for a while. Set up a new remote station and have most things working quite nice except freeDV. I'd like to be able to get it running again.

Remote Station:

Yaesu FT-991
Raspberry Pi 4 - ubuntu Mate
nomachine server
Wireguard for VPN

<< internet >> 

Client station:

Wireguard for VPN
Linux PC (* pref)
freeDV 1.6.1
Macbook (possible alternate)
USB headset
nomachine client

Currently I have the mic from the USB headset piped through nomachine to the soundcard input of the FT-991 (for SSB) , and also the output of the Yaesu soundcard through nomachine back to client station headset (or HDMI audio on monitor). I use some pulseaudio modules to make that work.

Pulse audio configuration extra steps like this on the RPI: 

pactl load-module module-null-sink sink_name=dummy
pacmd set-default-sink dummy
pacmd load-module module-loopback source=alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo sink=dummy
pactl load-module module-loopback source=nx_voice_out.monitor sink=alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo

I use this setup for voice (SSB and FM), and then also run wsjtx or fldigi on the RPi and only feedback radio RX audio to the client station.

I've been struggline trying to find a way to run freeDV.

I tried the linux utility tool USBIP to extend the USB Soundard from the RPi to the Linux client. It worked with the low data connection to control the radio [I could run FLRIG on the client to USB0] , but with the Audio connection [USB1] it was cutting out and generally behaving weird. Seems this may not be practical on a slowish (1.5MBps DSL) connection.

I have freeDV installed on both end and have been trying to figure out how to pipe audio around that freeDV can tap in/out of.

I use pulseaudio for null sinks with nomachine and it works nice - was thnking similar for the Linux PC but it doesn't seem freeDV recognizes pulseaudio and the alsa it sees doesn't support the configuration.

Questions:

1) Has anybody run freeDV with audio over IP ? What kind of setup did you use?
2) I think pulseaudio in conjunction with nomachine might support what I need - but how do I get pulseaudio to be recognized on freeDV?
3) Should I run freeDV application on the server side (radio) or client ? thoughts?
4) Other ideas to accomplish remote operation ? Maybe I try a new direction

Sorry for the long first post - but looking forward to the braintrust making some suggestions I can try! :)

Thanks!
Warren (KI7IZY)

Mooneer Salem

unread,
Oct 11, 2021, 1:36:52 PM10/11/21
to digita...@googlegroups.com
Hi Warren,

I have a Linux VM running here that communicates over Ethernet to my Hermes Lite 2 SDR. On the VM, I run Quisk to communicate with the radio and have four loopback audio interfaces (two for the digital audio I/O Quisk<->FreeDV and two for the analog audio input/out to/from FreeDV). I also run Mumble on my laptop as well on the VM to hear and transmit the analog audio. The GUI is currently using Xrdp but I'm open to suggestions there, especially if it's something that works better on a typical cable internet connection with poor upload.

BTW I have the VM copy of FreeDV compiled using a PortAudio PR that enables PulseAudio support (https://github.com/PortAudio/portaudio/pull/336). You should be able to update the PortAudio build configuration in the cmake/ folder of the freedv-gui code to use it in conjunction with adding -DUSE_STATIC_PORTAUDIO to freedv-gui's cmake call in build_linux.sh.

Thanks,

-Mooneer K6AQ

--
You received this message because you are subscribed to the Google Groups "digitalvoice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digitalvoice...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/digitalvoice/9605aa30-9808-4924-9fca-6599a913645en%40googlegroups.com.

Warren

unread,
Oct 11, 2021, 6:22:37 PM10/11/21
to digitalvoice
Hi Mooneer ,

Thanks for getting back to me - we made some QSOs when I was able to operate my station locally in Phoenix :)  Lot of info in your response, let me try and understand a bit better.

You have 4 loopback interfaces I understand - are these ALSA loopback or Pulseaudio loopback modules? Would you mind sharing the commands for an example if not too much trouble. I find it kind of confusing routing stuff and looping back stuff all over!

On the PortAudio / PulseAudio VM topic - are you suggesting I try a VM which has this support? or are you saying I can easily do it myself by re-building the version I have (1.6.1) . I really don't know much about compiling/building but the freeDV build instructions just worked so I was able to originally do it.

I found the file  Buildportaudio-2.0.cmake ; I'm not sure exactly what needs to be modified in that file?

I found the build_linux.sh file and at the end I see the section to build freedv-gui . The cmake line is as follows:

cmake -DCMAKE_BUILD_TYPE=Debug -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux ..

are you suggesting I add -DUSE_STATIC_PORTAUDIO to the line above like this:

cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_STATIC_PORTAUDIO -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux ..

Thanks,

Warren (KI7IZY)

Mooneer Salem

unread,
Oct 11, 2021, 10:11:03 PM10/11/21
to digita...@googlegroups.com
Hi Warren,

These are ALSA loopback devices but on the VM, PulseAudio is still able to see and use them. I set them up by adding /etc/modprobe.d/vac.conf with the following:

options snd-aloop enable=1,1,1,1 index=4,5,6,7 id=vac1,vac2,vac3,vac4 pcm_substreams=2,2,2,2

And with the following in ~/.config/pulse/default.pa:

update-source-proplist alsa_output.4.analog-stereo.monitor device.description=vac0.dest
update-source-proplist alsa_input.4.analog-stereo device.description=vac0
update-source-proplist alsa_output.5.analog-stereo.monitor device.description=vac1.dest
update-source-proplist alsa_input.5.analog-stereo device.description=vac1
update-source-proplist alsa_output.6.analog-stereo.monitor device.description=vac2.dest
update-source-proplist alsa_input.6.analog-stereo device.description=vac2
update-source-proplist alsa_output.7.analog-stereo.monitor device.description=vac3.dest
update-source-proplist alsa_input.7.analog-stereo device.description=vac3
update-sink-proplist alsa_output.4.analog-stereo device.description=vac0.source
update-sink-proplist alsa_output.5.analog-stereo device.description=vac1.source
update-sink-proplist alsa_output.6.analog-stereo device.description=vac2.source
update-sink-proplist alsa_output.7.analog-stereo device.description=vac3.source

With the above, vac0 and vac1 go between Quisk and FreeDV while vac2 and vac3 go between FreeDV and Mumble.

As for building FreeDV + static PortAudio, it looks like I made the following changes on my local copy (- = removed lines, + = added lines):

diff --git a/build_linux.sh b/build_linux.sh
index 8e26be4..76f530a 100755
--- a/build_linux.sh
+++ b/build_linux.sh
@@ -39,5 +39,5 @@ export LD_LIBRARY_PATH=$LPCNETDIR/build_linux/src
 # Finally, build freedv-gui
 cd $FREEDVGUIDIR && git pull
 mkdir  -p build_linux && cd build_linux && rm -Rf *
-cmake -DCMAKE_BUILD_TYPE=Debug -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux -DUSE_STATIC_PORTAUDIO=1 ..
 make VERBOSE=1
diff --git a/cmake/Buildportaudio-2.0.cmake b/cmake/Buildportaudio-2.0.cmake
index 7b1dd55..f2136d9 100644
--- a/cmake/Buildportaudio-2.0.cmake
+++ b/cmake/Buildportaudio-2.0.cmake
@@ -1,4 +1,4 @@
-set(PORTAUDIO_GIT "https://github.com/PortAudio/portaudio.git")
+set(PORTAUDIO_GIT "https://github.com/illuusio/portaudio.git")
 
 # required linking libraries on linux. Not sure about windows.
 find_library(ALSA_LIBRARIES asound)
@@ -22,7 +22,7 @@ else()
     set(CONFIGURE_COMMAND ./configure --enable-cxx --enable-option-checking --without-alsa --without-jack --without-oss --without-asihpi --without-winapi --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist CFLAGS=-g\ -O2\ -mmacosx-version-min=10.9 LDFLAGS=-framework\ CoreServices\ -framework\ AudioUnit\ -framework\ CoreFoundation\ -framework\ AudioToolbox\ -framework\ CoreAudio)
 endif(BUILD_OSX_UNIVERSAL)
 else()
-    set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+    set(CONFIGURE_COMMAND autoreconf -i && ./configure --enable-cxx --without-jack --with-pulseaudio --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
 endif()
 
 include(ExternalProject)
@@ -40,7 +40,7 @@ ExternalProject_Add(portaudio
 else()
 ExternalProject_Add(portaudio
     GIT_REPOSITORY ${PORTAUDIO_GIT}
-    GIT_TAG origin/master
+    GIT_TAG PulseAudioHostAPI
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
     CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
@@ -58,7 +58,8 @@ if(WIN32)
 elseif(NOT APPLE)
     find_library(RT rt)
     find_library(ASOUND asound)
-    list(APPEND PORTAUDIO_LIBRARIES ${RT} ${ASOUND}
+    find_library(PULSE pulse)
+    list(APPEND PORTAUDIO_LIBRARIES ${RT} ${ASOUND} ${PULSE}
     )
 endif(WIN32)
 include_directories(${CMAKE_BINARY_DIR}/external/dist/include)

Hope all of this helps!

Thanks,

-Mooneer K6AQ

Warren

unread,
Oct 11, 2021, 10:58:33 PM10/11/21
to digitalvoice
It might be a bit over my head , but i'll go through to manually change the files when i get a bit of time and will try to build it - thanks :)

Warren

unread,
Oct 12, 2021, 2:24:40 PM10/12/21
to digitalvoice
Hi Mooneer - I modified my files to build and unfortunately it crashes with errors and messages I don't really understand, but it seems like one of these lines I added it doesn't like:

+    find_library(PULSE pulse)
+    list(APPEND PORTAUDIO_LIBRARIES ${RT} ${ASOUND} ${PULSE}
     )

I think this is the relevant error part:

System is Linux

-- Looking for dl library.

--   dl library: /usr/lib/x86_64-linux-gnu/libdl.so

-- Build type will be: Debug

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:

PULSE

Do you think I missed something or need to define something else for it to build?

Mooneer Salem

unread,
Oct 12, 2021, 7:10:31 PM10/12/21
to digita...@googlegroups.com
Hi Warren,

It sounds like you may need to install the libpulse-dev package. Those two lines integrate the PulseAudio library into FreeDV; as the library isn't there, the PULSE variable never gets set properly (and thus the error). Hope that helps!

Thanks,

-Mooneer K6AQ

Warren

unread,
Oct 12, 2021, 11:23:25 PM10/12/21
to digitalvoice
I will definitely give your suggestion a try - I thought I had that but there are some similar sounding names. That is for my Linux machine 

In parallel I have tried using my Mac with Blackhole and Nomachine to route audio and it's seems to work !! :D 

I don't hear anybody on air tonight and I tried CQ but I'll keep using the QSO finder and maybe we'll be able to check if successful.

Thanks for your suggestions and support!

Mooneer Salem

unread,
Oct 13, 2021, 4:12:32 AM10/13/21
to digita...@googlegroups.com
No worries! I will be trying to remote into my home station during Pacificon this weekend and operating FreeDV that way but we'll see how that goes. Hope to hear from people here soon!

-Mooneer K6AQ

Warren

unread,
Oct 14, 2021, 12:54:01 AM10/14/21
to digitalvoice
I have some other setup issues to work out but I wanted to report that your help with the build instructions and missing library did the trick - V1.6.1 now built with PulseAudio , it launches and seems to see all my PA stuff so that's real progress :)   Thx!

Mooneer Salem

unread,
Oct 14, 2021, 4:16:35 AM10/14/21
to digita...@googlegroups.com
Great to hear! Hopefully the rest of the setup goes smoothly :)

-Mooneer K6AQ

Reply all
Reply to author
Forward
0 new messages