drowe67 / freedv-gui

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

Audio settings lost between runs of FreeDV and between Stop and Start of modem. #432

Closed barjac closed 1 year ago

barjac commented 1 year ago

I see this myself in Linux and have heard several of reports of Windows users seeing the same.

I suspect that this may have come to light recently as a side effect of running FreeDV Reporter in a browser.

I can't be sure but when the modem stops the browser could be grabbing the default audio device, and if a browser is open when attempting to start the modem it could already have grabbed it. All conjecture at present, however in my case closing the browser fixes it on some occasions.

This is important as I have one amateur friend who has tried to get FreeDV running and has hit this issue. His comment was that it's not worth continuing with until this issue can be fixed. :(

Tyrbiter commented 1 year ago

I think PR #422 was intended to fix this problem, do you have that included in your current version?

tmiw commented 1 year ago

I think PR #422 was intended to fix this problem, do you have that included in your current version?

Yep. I'll see if I can get .11 out tonight.

barjac commented 1 year ago

I think PR #422 was intended to fix this problem, do you have that included in your current version?

I guess so as the only remaining PR when I pulled master at aa280d1 was #429. I will be testing again tomorrow on the 5366.5 net so if .11 is out I will try it.

I'm not 100% sure I saw this issue though while I was testing that version for the other problem.

Tyrbiter commented 1 year ago

I'm not 100% sure I saw this issue though while I was testing that version for the other problem.

I definitely have not seen it since PR #422 went in, but a Windows user on the 1.8.10.1 release is quite likely to do so, it's going to be important to get the expected fix out to them quickly.

On Linux you can see what's happening using pavucontrol to monitor what happens with the audio devices.

barjac commented 1 year ago

I just started FreeDV and all seemed fine. I stopped the modem and tried to re-start and I got the 'Sound Device Removed' error dialogue. pavucontrol looks correct showing the USB headset as mic in and speakers out. The onboard audio as line in and line out. Browser was not running but klog was. All audio settings in FreeDV are now wrong and either blank or 'default' . Attempting to set them back I find that the USB audio (headset) is missing from the list (because I opened this browser?). On closing FF they re-appear and can be selected. FreeDV Start works and I have a waterfall. I can now stop and Start the modem at will - go figure! I also stopped and re-started the browser and klog and it's still all fine again. :( I will try to find out how to reproduce this reliably.

tmiw commented 1 year ago

I just started FreeDV and all seemed fine. I stopped the modem and tried to re-start and I got the 'Sound Device Removed' error dialogue. pavucontrol looks correct showing the USB headset as mic in and speakers out. The onboard audio as line in and line out. Browser was not running but klog was. All audio settings in FreeDV are now wrong and either blank or 'default' . Attempting to set them back I find that the USB audio (headset) is missing from the list (because I opened this browser?). On closing FF they re-appear and can be selected. FreeDV Start works and I have a waterfall. I can now stop and Start the modem at will - go figure! I also stopped and re-started the browser and klog and it's still all fine again. :( I will try to find out how to reproduce this reliably.

Wait, is this with master or with 1.8.10.1?

barjac commented 1 year ago

Master at https://github.com/drowe67/freedv-gui/commit/aa280d1de916475f9faa4f72b2eedd5753d6f362 without PR #429

freedv-1.8.11-0.20230612.aa280d1.2.mga This is the currently installed version. ...1.mga was with PR#429 ...2.mga was without the PR#429 patch, so yes absolutely certain.

barjac commented 1 year ago

I just came in and restarted the machine and started FreeDV only. Audio configs all gone again. It was all closed down cleanly before I took the dog for a walk :( Bed time now. 73

tmiw commented 1 year ago

I'm going to work on releasing .11 now because as @Tyrbiter mentioned, the issue fixed in #422 is way more visible (I was even able to duplicate on macOS). The other issue @barjac mentioned can probably wait until we can get more reliable steps to reproduce.

BTW @barjac, just to make sure, it was built with PulseAudio/pipewire, right? Not PortAudio? I haven't heard of nearly as many issues happening with the former.

barjac commented 1 year ago

On 14/06/2023 05:07, Mooneer Salem wrote: //-------------------

BTW @barjac https://github.com/barjac, just to make sure, it was built with PulseAudio/pipewire, right? Not PortAudio? I haven't heard of nearly as many issues happening with the former.

portaudio has always been a BuildRequire since I started maintaining it over 8 years ago. :\

I will test a build against pulseaudio.

Our current BRs are:

BuildRequires: cmake BuildRequires: libsioclient-devel BuildRequires: pkgconfig(codec2) >= 1.0.3 BuildRequires: pkgconfig(hamlib) >= 4.1 BuildRequires: pkgconfig(portaudio-2.0) BuildRequires: pkgconfig(samplerate) BuildRequires: pkgconfig(sndfile) BuildRequires: pkgconfig(sox) BuildRequires: pkgconfig(speex) BuildRequires: pkgconfig(speexdsp) BuildRequires: wxgtku3.0-devel BuildRequires: desktop-file-utils BuildRequires: lpcnetfreedv-devel >= 0.2-7.20211003

Thanks, Barry

Tyrbiter commented 1 year ago

Does mageia use, or is it intending to use, pipewire @barjac ?

barjac commented 1 year ago

On 14/06/2023 09:37, Brian wrote:

Does mageia use, or is it intending to use, pipewire @barjac https://github.com/barjac ?

Hi Brian,

In Mageia 9 which is in final stages of development, the use of PulsaAudio will still be default.

I am testing in a Mageia 9 with native PusleAudio.

However, users can manually switch to PipeWire in the 'Mageia Control Centre' which is a fairly complex process concealed behind a single check box.

Am I correct in assuming that since PipeWire still relies on PulseAudio libs that FreeDV built against PA will still be happy in a PW system?

Barry

barjac commented 1 year ago

Build fails without PortAudio:

-- Package 'portaudio-2.0', required by 'virtual:world', not found CMake Error at CMakeLists.txt:346 (message): portaudio library not found. On Linux systems try installing: portaudio-devel (RPM based systems)

tmiw commented 1 year ago

Build fails without PortAudio:

-- Package 'portaudio-2.0', required by 'virtual:world', not found CMake Error at CMakeLists.txt:346 (message): portaudio library not found. On Linux systems try installing: portaudio-devel (RPM based systems)

You'll need to pass "pulseaudio" to build_linux.sh, which basically uses the following for cmake:

cmake -DUSE_PULSEAUDIO=1 ...

Am I correct in assuming that since PipeWire still relies on PulseAudio libs that FreeDV built against PA will still be happy in a PW system? Barry

Correct.

barjac commented 1 year ago

-DUSE_PULSEAUDIO=1 fixed it, thanks. Package build completed OK so will test after a re-boot to my clean system.

All looks OK now. Tested Stop/Start modem. Stop/Start FreeDV with and without browser/klog and re-boot without losing settings :)

Thanks Mooneer for thinking of that!

Tyrbiter commented 1 year ago

On 14/06/2023 09:37, Brian wrote: Does mageia use, or is it intending to use, pipewire @barjac https://github.com/barjac ? Am I correct in assuming that since PipeWire still relies on PulseAudio libs that FreeDV built against PA will still be happy in a PW system?

It's fine on Fedora 38, and has been in general since Fedora 34 when pipewire became the default. I had one problem with wireplumber that took some time to resolve but it's all been working nicely since then. Massive development work has been happening but mostly around the edges rather than core library code. I rarely do git builds of pipewire or wireplumber these days, I just update the distro packages.

Fedora has a pipewire-pulse package so I would expect Mageia to take the same route. I hope it all just works, the early adopters have had all the pain :-/

barjac commented 1 year ago

Fedora has a pipewire-pulse package so I would expect Mageia to take the same route. I hope it all just works, the early adopters have had all the pain :-/

We had all sorts of conflicts with Pipewire which hopefully the new Mageia tool sorts out now. I must make a new Mga9 installation for testing all the amateur packages with Pipewire to be sure it works as expected. /OT Where is the report frequency list stored in freedv? Should it not be user editable somewhere in the configs for those who use it and want to add special frequencies?

Tyrbiter commented 1 year ago

Where is the report frequency list stored in freedv? Should it not be user editable somewhere in the configs for those who use it and want to add special frequencies?

Currently the frequencies for the drop-down list are at topFrame.cpp:461

barjac commented 1 year ago

Where is the report frequency list stored in freedv? Should it not be user editable somewhere in the configs for those who use it and want to add special frequencies?

Currently the frequencies for the drop-down list are at topFrame.cpp:461

So definitely not user adjustable. It's just that I see lots of odd frequencies in use on Reporter around the world, so if people are going to use the hamlib feature to set frequencies, then I would think that they would like to be able to add their favourite club net frequency etc. Maybe the hard coded 'Master' list with a configurable list which adds user frequencies in sort order to the master and somehow identifies these in the list with maybe a * to remind users that these are not 'official'. Just my $0.02.

Tyrbiter commented 1 year ago

I'm sure this will change, the work in progress is being dealt with in this PR:

https://github.com/drowe67/freedv-gui/pull/434

@tmiw will almost certainly include some user suggestions into the feature.

tmiw commented 1 year ago

That might be another PR as it's not quite related to the QSY feature, but will keep that in mind.

tmiw commented 1 year ago

Going to close this issue since the main problem seems to be resolved. The additional frequency list feature should be discussed in #460.