drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
193 stars 49 forks source link

PulseAudio Support #16

Closed drowe67 closed 2 years ago

drowe67 commented 5 years ago

A few people have requested pulse audio support on Linux.

drowe67 commented 3 years ago

Basic operation tested by @tmiw on 6 Feb 2021, posted to digitalvoice Goggle group:

Here's another screenshot with multiple applications using PulseAudio simultaneously (WSJT-X and FreeDV grabbing receive audio from SparkSDR). Again, it seemed to work properly in brief testing:

Screen Shot 2021-02-05 at 12 52 13 AM

@timw asked for feedback and specific bug reports but there has been no response (up to 22 Feb).

mike-hb commented 3 years ago

as stated before in the list

I use opensuse thumbleweed 64bit an the newest git pull from today (2021-03-26T14:52 Z)

with compile by build_linux.sh, I got an error freedv-gui/src/hamlib.cpp: In Elementfunktion »bool Hamlib::connect(unsigned int, const char*, int, int)«: freedv-gui/src/hamlib.cpp:140:57: Fehler: »FILPATHLEN« wurde in diesem Gültigkeitsbereich nicht definiert 140 | strncpy(m_rig->state.rigport.pathname, serial_port, FILPATHLEN - 1); | ^~~~~~ make[2]: [src/CMakeFiles/freedv.dir/build.make:225: src/CMakeFiles/freedv.dir/hamlib.cpp.o] Fehler 1 make[2]: Verzeichnis „freedv-gui/build_linux“ wird verlassen make[1]: [CMakeFiles/Makefile2:134: src/CMakeFiles/freedv.dir/all] Fehler 2 make[1]: Verzeichnis „freedv-gui/build_linux“ wird verlassen make: *** [Makefile:171: all] Fehler 2

After defining the missing FILPATHLEN in the head of that file hamlib.cpp setting it to 80, git commit and again "build_linux.sh" -- it was compiled.

So I tried to use it.

After starting pavucontrol and executing build_linux/src/freedv I was asked to configure audio.

the offered audio devices are a very limited list and the needed USB Soundcard for the microphone as well as the USB soundcard of the radio (mcHF) was _notlisted in the audio dialogs

Than I tried both soundcards to use "pulse" -- this was banned after "apply"

Any help needed. vy 73 Michael

mike-hb commented 3 years ago

Next step: I tried computer+ radio: pulse Computer+audioI/O default after some seconds I got the error ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred Expression 'err' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3350 Expression 'ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3891 Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4269 freedv: src/hostapi/alsa/pa_linux_alsa.c:3382: OnExit: Assertion `data' failed. Abgebrochen (Speicherabzug geschrieben)

  1. try -- stop pavucontrol start again freeDVgui audioconfig shows some more sounddevices (2 times more) but the separate microphone soundcard was not shown in the input TX dialog and the radio USB-soundcard is not shown as well
mike-hb commented 3 years ago

next step try again after finish of all audio programs (e.g wsjtx), stop pavucontrol started freedvGUI; now all needed soundcards (the radio I/O) was shown I sleected pulse for computer-audio-I/O and the USB-soundcard-mcHF for the radio when I "Start" listening with "Start" in freedv I got: Your USB Interface mchf: Audio (hw:3,0) device cannot be found and may have been removed from your system. Please go to Tools->Audio Config... to confirm your audio setup. (This is due to a configuration of pavucontrol and pulse audio using applications like wsjtx) WSJTX is not running at this time

After starting again the system (may be there was one audio program which occupied the external USB-soundcard for the microphone, this was listed also: next: i configured the radio-soundcardstream I/O the audioI/O was pulse --rec and play for RX and TX was tested -- ok

"START" listening with start: the program freedv crashes again: ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred Expression 'err' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3350 Expression 'ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3891 Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4269 freedv: src/hostapi/alsa/pa_linux_alsa.c:3382: OnExit: Assertion `data' failed. Abgebrochen (Speicherabzug geschrieben)

BTW apvucontrol was not running at this test.

Hopefully this is a better information to find the error. Thanks Michael

ghost commented 3 years ago

Have you run this troubleshooting:

https://en.opensuse.org/Sound_troubleshooting

mike-hb commented 3 years ago

Dear Steve,

thanks for this information. But I think, that this does not help for my situation (have you found my further reports); well, I read the sound troubleshooting, and was looking for steps to apply for my system.

if I stop pulseaudio with pulseaudio -k freedv works as the only audio app.

But no other audio program is than available, which used pulse audio before -- they have to be reconfigured -- This is no option for my multi purpose desktop linux system

Am 26.03.21 um 17:52 schrieb Steve Sampson:

Have you run this troubleshooting:

https://en.opensuse.org/Sound_troubleshooting https://en.opensuse.org/Sound_troubleshooting

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/drowe67/freedv-gui/issues/16#issuecomment-808368614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2X7DCPU3W2IMES3AJKTRLTFS3UZANCNFSM4H6PHGXQ.

tmiw commented 3 years ago

BTW, the compile error with hamlib was fixed in #109 (commit 3179bd7ab3fd2309ca25741fbb3e7ef05b0b83d5). I'll see about getting OpenSuSE up in a VM soon and try to duplicate the issue on my end.

drowe67 commented 3 years ago

Thanks @mike-hb. Do you have an Ubuntu system available? It would interesting to see if you can reproduce Mooneer's example on the same operating system, but using your hardware. That would help us to narrow down the problem.

mike-hb commented 3 years ago

Yes, I will try tomorrow -- so please give me 24 h to report the observations on ubuntu system with a laptop. It would be nice, when it works... We will see.

tmiw commented 3 years ago

So yeah, I brought up an OpenSuSE VM tonight and did some playing. I had to disable a few of the checks in the code in order to be able to set each of the four devices to "pulse". Unfortunately, it seemed to be crashing a fair bit with underrun errors, so I switched to my Ubuntu environment for further testing; I'll have to figure out why later.

Meanwhile, on Ubuntu, I'm getting no audio on any of the channels when they're all set to "pulse". If I use the ALSA devices directly (USB Audio Codec for the IC-7200 and the VM's built-in sound card for speaker/mic) they seem to work fine, though I'm occasionally seeing the radio's device drop off of some of the selection boxes. Only using PulseAudio for one of the sound cards seems to work a bit better, and is probably why it seemed to work well for me initially.

Anyway, I'll have to research more and get back to you guys. Some of the PulseAudio API seems pretty similar to PortAudio, so I wonder if biting the bullet and just adding native support would be straightforward.

mike-hb commented 3 years ago

Dear List, (especially Mooneer),

I have tested now my ubuntu laptop -- see details on the OS in messages-freedv.txt This file shows a glue of 3 command line outputs. The last block is an repeated error message after "Start" in freedv under a special condition -- see below.

I compiled the github from today 20210327T0932 Z

without starting pavucontrol, I got the audio dialog in freedv as shown in the next screenshot: Audioconfig-without-PavuCntl

Configuring of audio must not include the "pulse" device --> freedv hangs or no sound. But Everything works as expected if I configure the physical alsa devices. (TX and RX works)

Step 2: now Starting PaVuControl, free DV is still running as in the step before all devices are shown in pavucntl dialog tabs Than: hit "Start" in FreeDV results in "no function / hang of freedv and the Error messages shown in the last block of my appended textfile (above) I got an error dialog Error-with PavuCntl-after Start

Now Stop Freedv

Step 3 Starting PavuCntl Starting FreeDV Go to audio config dialog of freedv Audioconfig-with-PavuCntl

My conclusion Pavucontrol catches all devices even when they are used by freedv. After that, when we want to change the use of audio input or aoutput devices in freeDV, all of the defined devices are not available to freeDV

On the other hand, I described a workaround for the combination of freedv with pulseaudio in a limited environment with only freedv audio application -- The use of PavuControl as an universal audio device manager is prohibited by the audio device manager of freedv -- they do not work together but work against each other.

My recommendation: the best harmonic use of pulse audio harmonic would be to neglect the internal freedv audio device manager and use the pulse audio mechanisms and Pavucontrol Pulse will do all the sample rate conversions needed. This could be automaticaly configured if pulse audio is detected. Or, if the selected audio device in freedv is "pulse", this could be used for both audio device blocks -- there must be no check of different sound cards; all further arrangements would be done with Pavucontrol, as this is already done under operation of wsjtx and fldigi or qsstv. (I fear that this will be to much work for the limited number of "non-windows-user" in the ham community. But I think that this harmonic operation under linux is necessary to make the program "accepted" by the ham community who use linux with "quisk", freedv and other SDR- and ham radio application programs) So let me close with an appeal (a feature request) for the support of pulse audio under linux. This will offer the Fruit-PI-Computer class as a front end for ham radio application.

Let me end with a big Thank you so much for this program freedv -- as mentioned before in the list, for the DARC (The German ham radio club) it is a strategic initiative to support and push modern technologies like the free codec2 and the neuronal network technologies for the estimation of the codec coefficients. This can demonstrate the vitality and the relevance of ham radio for the presence and the future.

vy 73 Michael, DK5HH

drowe67 commented 3 years ago

Thanks @mike-hb and @tmiw - looks like it's a consistent problem across Linux operating systems. That's good in a way, makes it easier to reproduce and hence debug :slightly_smiling_face:

@tmiw yes I've also used a single Pulse output device before (useful wheen other applications have taken control of the default sound device).

@mike-hb it does indeed look like an arbitration problem - two programs trying to take control of the same sound devices. Tricky, as we need to maintain ALSA support, and ideally minimise the number of platform specific changes we make.

@mike-hb - FreeDV is unusual in that in needs 2 sound cards (two play and two record channels). Are there any other applications that require two sound cards? I am wondering how Pulse handles this?

tmiw commented 3 years ago

My understanding is that it's possible to create app-specific streams that are then mapped to specific sound devices in e.g. pavucontrol. (That seemed to be the case with Quisk, anyway, as I saw a "QuiskDigitalOut" one there when I was playing with it.) FreeDV would likely do something similar to allow people to recognize which stream is the computer->radio one, etc.

drowe67 commented 3 years ago

@tmiw - agreed - I was using Quisk recently and noticed a couple of sound devices appear in the Ubuntu control panel - which took over as my default sound device! They seemed to persist after Quisk was shut down. Not sure if that was a bug or artifact of the Linux sound system.

Pulse support is starting to feel like a pretty major change, effectively coding up an alternative to PortAudio which has worked pretty well for us up until now. I guess in the code it could be handled by an intermediate layer.

drowe67 commented 3 years ago

So let me close with an appeal (a feature request) for the support of pulse audio under linux. This will offer the Fruit-PI-Computer class as a front end for ham radio application.

Let me end with a big Thank you so much for this program freedv -- as mentioned before in the list, for the DARC (The German ham radio club) it is a strategic initiative to support and push modern technologies like the free codec2 and the neuronal network technologies for the estimation of the codec coefficients. This can demonstrate the vitality and the relevance of ham radio for the presence and the future.

vy 73 Michael, DK5HH

Thanks Michael :slightly_smiling_face: - I'm pleased that DARC values the innovation FreeDV and it's associated technologies brings to Ham Radio.

Is there any other support DARC or it's members can bring to FreeDV? For example members who would like to assist with coding C or C++? Anyone who has coded Pulse Audio applications? At the moment there are just two of us working on freedv-gui - which is why it is difficult to address every user request.

I am also covering Codec 2, various modems (including a new, open source HF data system), the core FreeDV API etc etc, and both Mooneer and I have other things we need to do in life.

FreeDV is a hobby for us, and issues like a deep dive into Linux sound means finding 25-50 hours of our volunteer time, and committing to supporting the feature, answering questions, and fixing bugs into the future....

tmiw commented 3 years ago

It looks like the PortAudio library might soon have support for PulseAudio per PortAudio/portaudio#336. I was able to link the code in that PR into FreeDV tonight (via minor changes to cmake/BuildPortaudio.cmake and -DUSE_STATIC_PORTAUDIO=1) and it seemed to detect the PulseAudio devices with no issues:

Screen Shot 2021-04-08 at 12 57 13 AM

I also tried to transmit and receive using only Pulse devices (no ALSA) and that seemed to work as well, but I admittedly didn't extensively test them. For reference, here are the changes I made to use the above PR:

diff --git a/cmake/BuildPortaudio.cmake b/cmake/BuildPortaudio.cmake
index 5474a0c..0803593 100644
--- a/cmake/BuildPortaudio.cmake
+++ b/cmake/BuildPortaudio.cmake
@@ -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)
@@ -38,7 +38,9 @@ ExternalProject_Add(portaudio
 )
 else()
 ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    #URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    GIT_REPOSITORY https://github.com/illuusio/portaudio.git
+    GIT_TAG PulseAudioHostAPI
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
     CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
@@ -56,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)

@mike-hb, would you be willing to try the version of PortAudio in that PR and see if FreeDV works any better for you? If it does, we should be able to pick up the changes pretty quickly once they're merged to master as I believe that's where pa_snapshot.tgz comes from.

mike-hb commented 3 years ago

@tmiw OH -- what a nice step forward -- looks good form your documentation (above) So your former suggestions: it may be a system inherent solution was a very clever idea!

I will try to adapt the given diffs to my last actual pull of the git archive and try it out. Please let me some time for that testing, at least until monday to check and report it.

mike-hb commented 3 years ago

@tmiw OH -- what a nice step forward -- looks good form your documentation (above) So your former suggestions: "it may be a system inherent solution", was a very clever idea!

I will report my steps staying in the top level directory of the github-repo:

  1. applying the patch -- called pulseaudio.patch in my case -- without a git pull failed (I have to manual insert in the dialog "File to patch: cmake/BuildPortaudio.cmake"
  2. git pull
  3. apply: patch --verbose -u -b -p2 -i pulseaudio.patch
  4. ./build_linux.sh --> works without errors
  5. calling ./build_linux/src/freedv --verbose works normal and reults: the program starts as expected the audio configuration dialog shows API "ALSA" devices only and only those, which are not bind to the pavucontrol (as before)
  6. I tried again without pavucontrol -- no change in the audio configuration dialog but these ALSA-API-devices which are now released from the pavucontrol-application

I tried this on my opensuse Thumbleweed desktop as well as on a thinkpad laptop with ubuntu 20.4 LTS with the same result in the audio configuration dialog (only devices API ALSA)

So I need some more assistance: Did I use the correct preparation before compilation? What should I add for the debugging?

hope, this helps for the next iteration Michael

tmiw commented 3 years ago

@mike-hb, I forgot to mention that the build_linux.sh script needs to be modified as well. On the final cmake line (the one that builds FreeDV itself and includes paths to Codec2 and LPCNet), you'll also need to add -DUSE_STATIC_PORTAUDIO=1 for the patch to take effect. Hopefully that makes sense. (I'm not in front of my primary development machine at the moment so I can't generate a new patch with changes to that file, but might be able to do so later today.)

mike-hb commented 3 years ago

@tmiw -- oh sorry; I forgot to add this line in the script; I did add this parameter to the last cmake-call. Than I ran the build_linux.sh

But : I got an error: make[2]: Keine Regel vorhanden, um das Ziel „external/dist/lib/libportaudio.a“, benötigt von „src/freedv“, zu erstellen. Schluss. make[2]: Verzeichnis „/home/hartje/Dokumente/devel/afu/freedv-gui/build_linux“ wird verlassen make[1]: [CMakeFiles/Makefile2:163: src/CMakeFiles/freedv.dir/all] Fehler 2 make[1]: Verzeichnis „/home/hartje/Dokumente/devel/afu/freedv-gui/build_linux“ wird verlassen make: *** [Makefile:171: all] Fehler 2

As I read, the portaudio should be build, but there is no rule for it? Any help will be shorten the process... Thanks in advance Michael

mike-hb commented 3 years ago

From die CMakeLists.txt I found that the more important parameter could be -DUSE_STATIC_DEPS

So, I tried the -DUSE_STATIC_DEPS=1 -- but I got the same error (missing rule libportaudio.a)

So, as it is now evening here, I look for another mail tomorrow morning... hopefully there will be a solution for that minor addition... (or I can spend some time to find it myself -- but this will take some more time, I fear.)

drowe67 commented 3 years ago

@tmiw - when convenient, is it worth making this a PR rather than a patch?

drowe67 commented 3 years ago

Good work @mike-hb :+1: This can be fiddly work, thanks for having a try :slightly_smiling_face:

tmiw commented 3 years ago

@mike-hb, looks like OpenSUSE uses lib64 instead of lib, hence why it couldn't find libportaudio.a. I've tested this version of the patch and it seems to build and run okay in my VM:

diff --git a/build_linux.sh b/build_linux.sh
index 8e26be4..c035edc 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 -DUSE_STATIC_PORTAUDIO=1 -DCMAKE_BUILD_TYPE=Debug -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux ..
 make VERBOSE=1
diff --git a/cmake/BuildPortaudio.cmake b/cmake/BuildPortaudio.cmake
index 5474a0c..3fd39dc 100644
--- a/cmake/BuildPortaudio.cmake
+++ b/cmake/BuildPortaudio.cmake
@@ -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)
@@ -38,7 +38,9 @@ ExternalProject_Add(portaudio
 )
 else()
 ExternalProject_Add(portaudio
-    URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    #URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
+    GIT_REPOSITORY https://github.com/illuusio/portaudio.git
+    GIT_TAG PulseAudioHostAPI
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
     CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
@@ -46,7 +48,14 @@ ExternalProject_Add(portaudio
     INSTALL_COMMAND $(MAKE) install
 )
 endif()
-set(PORTAUDIO_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a)
+
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+if(LIB64)
+    set(PORTAUDIO_LIB_SUFFIX "64")
+else()
+    set(PORTAUDIO_LIB_SUFFIX "")
+endif(LIB64)
+set(PORTAUDIO_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib${PORTAUDIO_LIB_SUFFIX}/libportaudio.a)

 if(WIN32)
     find_library(WINMM winmm)
@@ -56,7 +65,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)

@drowe67, we'll probably want to do a PR for the lib64 part of the above patch. It might not be worthwhile to fully include the patch as the changes should in theory end up in master (though I wonder if we should just be cloning their repo instead of downloading pa_snapshot.tgz).

tmiw commented 3 years ago

BTW you'll probably want to use git reset --hard and delete build_linux, codec2 and LPCNet folders before applying the above patch and attempting another build (or alternatively, delete the entire freedv-gui folder and re-clone it) just to make sure there's nothing floating around from the previous attempt.

mike-hb commented 3 years ago

many Thanks to Mooneer

  1. Try (no success) my next report shows a hanging make: after remove of LPCNet, build_linux and codec2 and git reset --hard I applied the patches to build_linux.sh and cmake/BuildPortaudio.cmake then ./buildlinux.sh after some time: it hangs with the following last lines

.... Scanning dependencies of target vq_mbest [100%] Building C object misc/CMakeFiles/vq_mbest.dir/vq_mbest.c.o [100%] Linking C executable vq_mbest [100%] Built target vq_mbest Klone nach 'LPCNet' ... remote: Enumerating objects: 34, done. remote: Counting objects: 100% (34/34), done. remote: Compressing objects: 100% (24/24), done. remote: Total 2212 (delta 16), reused 25 (delta 10), pack-reused 2178 Empfange Objekte: 100% (2212/2212), 56.59 MiB | 2.03 MiB/s, fertig. Löse Unterschiede auf: 100% (1527/1527), fertig. Bereits auf 'master' Ihr Branch ist auf demselben Stand wie 'origin/master'. Bereits aktuell. -- The C compiler identification is GNU 10.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- LPCNet version: 0.2 -- freedv-gui current git hash: cd90264 -- Host system arch is: x86_64 -- Looking for available CPU optimizations on Linux/BSD system... -- avx2 processor flags found or enabled.

  1. Try: (successful compilation) git clone the actual freedv-gui-repo into an new folder apply patches to build_linux and cmake/BuildPortaudio.cmake compiling --> seems ok;

Excellent: the audio config dialog is showing all interfaces ALSA and pulseaudio At that time, pavucontrol is running Start with testing and report the results later....

Thanks for now Michael

mike-hb commented 3 years ago

first impression of the testing with pulse audio devices:

  1. freeDV radio Soundcard is the mcHF-Soundcard -->works fine parallel with wsjtx and / or fldigi

  2. redirect a websdr from firefox to freeDV
    this is done with a pulseaudio "virtual device" named L2_RX2app firefox feeds into the virtual device, freedv reads from "monitor of L2_RX2app"
    (could be parametrized with pavucontrol) freeDV outputs to the speaker of the desktop this works also

  3. as Freedv has 2 inputs and 2 outputs the name is identical in the pavucontrol dialog an improvement would be when these names are different e.g FDV-SC1 and FFDV-SC2 image

The figure above shows a part of the "Aufnahme"-Tab (recording) dialog of pavucontrol

Pavocontrol shows devices only during there is a program reading from or feeding into a device. When this process is stopped, then the device is not listed any more in pavucontrol -- this could be a reason, that freedv expected durable devices. ??

I should confirm that my both linux systems (opensuse desktop, 6 years old, ubuntu v20.4 on a thinkpad x230, 5 years old) are using the 64-bit mode and so they are using lib64; this is now working

@Mooneer can you verify the interrupted streaming when the source is missing?

My impression now: we are close to a release candidate of this pulseaudio module!

Many Thanks for that improvement -- this is a great step for the linux community and the use of freedv in a linux environment (as well as the fruit pi-class)

Michael

tmiw commented 3 years ago

I'll need to figure out how to add and remove devices on the fly to see if I can duplicate the crash issue you're seeing, @mike-hb. In the meantime, I'll play with that PulseAudio fork and see if I can submit a patch against that PR that will allow us to override the stream names to help with the confusion.

tmiw commented 3 years ago

Actually, I think I misunderstood your previous comment. Yeah, the devices disappear when I push the Stop button here as well. That's expected, though, but if the "PulseAudio source" and "PulseAudio sink" descriptions can be overridden it'll probably help.

tmiw commented 3 years ago

More experimentation with the PulseAudio source code resulted in me being able to override those labels as per the following:

Screen Shot 2021-04-12 at 3 40 24 AM Screen Shot 2021-04-12 at 3 40 31 AM

The author did push some other code since the last test that was causing issues, though, so those will also need to be worked through.

mike-hb commented 3 years ago

Dear Mooneer?!

Today i made a git pull removed build_linux/ LPCNet/ codec2/ and recompiled The first error (wxWidgets library was missing) -- wxWidgets_3_2-devel Version 3.1.4 installed -- compiled ok but after "start" button + 3 sec --> crash: "Speicherabzug geschrieben"

a restart with --verbose; does not give deeper insight hopefully you can create an idea what to do

Thanks in advance

tmiw commented 3 years ago

@mike-hb, this is a known issue with Codec2 that we're working on. Thanks for letting us know!

mike-hb commented 2 years ago

I am sorry to reopen the issue: after a "git pull" and recompile evrything, freedv works only with stopped pavucontrol. So I stiil can't use freedv together with the pavucontrol Pulseaudio. may be that this is due to the portaudio issue and the workaround is still not merged into the distributed library? -- Any comment on this?

so let me ask again: any hope for the linux guys with pulseaudio as the standard audio system?

tmiw commented 2 years ago

I am sorry to reopen the issue: after a "git pull" and recompile evrything, freedv works only with stopped pavucontrol. So I stiil can't use freedv together with the pavucontrol Pulseaudio. may be that this is due to the portaudio issue and the workaround is still not merged into the distributed library? -- Any comment on this?

so let me ask again: any hope for the linux guys with pulseaudio as the standard audio system?

Hmm, I wonder if you ran into an issue with the latest PR code for PortAudio as I'm not sure FreeDV itself would care what you do inside pauvcontrol. Are you still using Thumbleweed or are you on a different version of OpenSuSE now? I can see if I can duplicate it here in my VM environment.

As for having FreeDV support PulseAudio natively, I'm open to it but it would be nice to have PortAudio's upcoming Pulse support reliably work if possible.

mike-hb commented 2 years ago

hello Mooneer,thanks for reply, Yes, I am still using thumbleweed; Just for information update: I am with the hamgroup freedv of the german radioclub DARC and we discussed the use of freedv on linux. I think David and you are involved in the starting acitivities -- I mentioned it a year ago in the google group.

Just to inform you: the github master can be compiled and it works normal but without pavucontrol ; the v1.62-test breaks during compile (may be another issue -- we should discuss later?)

Michael

tmiw commented 2 years ago

I updated the packages in my Thumbleweed VM last night and did a full rebuild (freedv-gui master + PortAudio from https://github.com/PortAudio/portaudio/pull/336) and while there was some UI weirdness (resolved by also using -DBOOTSTRAP_WXWIDGETS=1, see build_osx.sh for usage details) freedv-gui doesn't seem to crash with pavucontrol open. Would it be possible to run the application with gdb and provide a backtrace when it does crash? That should help narrow down what's causing the issue.

Also re: v1.6.2-test, let's discuss that separately.

tmiw commented 2 years ago

@mike-hb et al, feel free to pull down master and build using ./build_linux.sh pulseaudio. While it should work okay, please open a new issue if you encounter any problems.