Commit Graph

8 Commits (539bd55969c972dae98047ae19b464ccfe0e43fc)

Author SHA1 Message Date
Mooneer Salem 539bd55969
Set thread names for additional threads in system. (#1103)
* Set thread names for additional threads in system.

* Fix linting errors.

* Add additional thread names for Mac and Windows.

* Use const reference for SetThreadName.

* Fix more linting errors.

* Fix PortAudio compiler error.

* Add missed thread names.

* VOX tone atomic doesn't need seq_cst.

* Only wake up non-RT playback thread if FIFO is less than half full.

* Only wake up the TX/RX threads after all audio received.

* Optimized RADE is only for radio integrations.

* Add missed changes.

* Need to build integ in order for lint to work.

* remove invalid target.

* Fix additional Linux compiler failures from previous changes.

* Additional compiler fixes.

* Exclude duplicate tests.

* Fix macOS CI failure.
2025-11-24 14:55:13 -08:00
Mooneer Salem 45de4762fa
Windows: Fix intermittent disappearance of audio devices (#974)
* Wrap all COM pointer accesses in a smart pointer to better track refcounts.

* Fix compiler error.

* We probably need to take a few more references when creating devices.

* Adjust how UTF8 strings are created just in case.

* Try caching device list to avoid as many calls into Windows.

* Fix typos.

* Add PR #974 to changelog.
2025-07-18 23:59:26 -07:00
Mooneer Salem 56400ede36
Fix additional intermittent Windows crashes on start. (#972)
* Fix additional intermittent Windows crashes on start.

* Try additional changes to make rade_loss more reliable.

* Add PR #972 to changelog.

* Widen some option fields due to being cut off on Windows.
2025-07-16 01:25:16 -07:00
Mooneer Salem 7576d7c148
Fix intermittent crash on Windows when pushing Start. (#943)
* Make sure we're capturing arguments by value to avoid memory corruption.

* Fix warnings discovered during other testing.

* Fix compiler error.

* Add PR #943 to changelog.
2025-06-21 19:24:47 -07:00
Mooneer Salem c5a041c989
Easy Setup: Use card names instead of device names for generating device list (#932)
* WIP code to get card/port names.

* Fix Linux compiler errors.

* Ensure that PulseAudio is adding card names when being interrogated.

* Initial logic to use card names instead of device names in Easy Setup dialog.

* WASAPI: Make sure Easy Setup can still work with FlexRadio virtual devices.

* Remove Windows-specific logic from Easy Setup dialog code.

* Add PR #932 to changelog.
2025-06-14 01:53:49 -07:00
Mooneer Salem 30c9e5b9c6
Remove 800XA, 700C, 2020 and 2020B. (#889)
* Remove 800XA, 700C, 2020 and 2020B from UI,

* Remove additional 700C references in UI.

* Remove 2020/AVX detection logic from codebase.

* Remove LPCNet from build scripts.

* Add PR #889 to changelog.

* Forgot to remove LPCNet from Windows installer generation.

* Generate Release build for GH workflows.

* Disable PSK Reporter reporting during test execution as invalid callsigns are used.

* Build type was being overwritten.

* Missed mutex removal.

* Temporarily use Instruments to trace macOS CI execution.

* Minor update.

* Use 2 minute window in xctrace to actually capture wanted events.

* Disable xctrace execution but keep in tests just in case.

* Hide main window during tests to prevent GUI from interfering.

* Experiment: set infifo2 max length to 30 seconds

* Oops, forgot to remove division from previous commit.

* Deallocation of PulseAudio stream should occur while mainloop is locked.

* Revert "Hide main window during tests to prevent GUI from interfering."

This reverts commit 69689bb927.

* Based on online code snippets nullptr for neg is fine.

* Clear PYTHONHOME if set on the user's system (Windows/macOS only).

* Bring back locking in TxRxThread just in case.

* Remove unneeded backslash.

* Revert "Bring back locking in TxRxThread just in case."

This reverts commit fc6a9f8797.

* Manually back out the changes instead of using git checkout.

* Use shared_ptr for LinkStep.

* Try removing the TX mode change mutex again.

* Try moving actual codec activity out of RT context.

* Fix compiler error.

* Fix issue preventing legacy modes from transmitting.

* Another attempt at preventing RX dropouts.

* Try putting mode TX into separate threads again.

* Only limit output samples if input samples were provided.

* Put codec RX back into RT context.

* Put TX on RT context.

* Remove unused code.

* Deallocation should occur only in the destructor.

* Fix Windows spectrum plot formatting issues.

* Prevent buffer overflow during TX/RX processing.

* Bring FRAME_DURATION back down to 10ms.

* We want to feed samples into the RADE/FreeDV TX/RX FIFOs regardless of whether there's room in the output.

* ParallelStep should only feed FRAME_DURATION ms worth of samples at a time.

* Sleep fallback should track FRAME_DURATION.

* Don't execute the parallel steps if there isn't enough room in the output FIFO.

* We really can only inject a portion of EOO samples at a time.

* Queue EOO as a single unit to ensure it gets transmitted as a unit.

* Allow ParallelStep to provide up to 4x the number of input samples as output.

* Back to processing 20ms frames.

* Run GH Linux tests using asan enabled.

* Suppress Python related memory leaks and Hamlib related invalid memory accesses.

* Forgot suppressions= in test execution.

* Add more leak suppressions based on GH output.

* Resolve memory leaks.

* Fix broken RadeTextTest.

* Additional suppressions from GH.

* Go back to processing TxNumSpeechSamples every TX cycle.

* Revert "Go back to processing TxNumSpeechSamples every TX cycle."

This reverts commit abe816d00b.

* Fix 1600 mode dropouts.

* Make TX single-threaded again.

* Revert back to last working pipeline logic (for fullduplex_* anyway).

* Revert most EOO behavior.

* Run AddressSanitizer tests separately as they interfere with real time audio.

* Need to start Xvfb etc. before asan tests.

* Only a subset of tests need to run with asan enabled.

* Fix issue causing PTT input not to work.

* Maybe we don't need to restart servers after all.

* Try using rtkit to ask for high priority instead of RT.

* Clear FIFOs a different way.

* Windows: determine minimum number of audio channels supported.
2025-05-26 12:29:47 -07:00
Mooneer Salem 6b2debfdb4
Second attempt at fixing Windows Start/Stop crashes (#881)
* Use shared setHelperRealTime in internal WASAPI threads.

* Capture this instead of all by reference in internal WASAPI threads.

* Clean up refcounts of COM objects.

* Missed release of default audio device.

* Event handle needs to be closed on stop().

* Fix cross-compile definitions to allow asan to be used in the first place.

* Make sure TX/RX thread stops before audio devices do.
2025-05-13 17:03:42 -07:00
Mooneer Salem 149d37230b
Move to using native audio on macOS and Windows (#847)
* Initial implementation of macOS audio handling using native APIs.

* Fix minor calculation issue in Easy Setup when generating sine waves.

* Fix spelling error.

* Fix issue causing distorted output audio.

* Refactor audio device info retrieval to a separate method.

* Get channel information for discovered macOS audio devices.

* Add support for retrieving default audio devices.

* Try using AVAudioSinkNode for getting mic/RX audio.

* Use AVAudioSourceNode for output side too.

* Fix compiler error.

* Set minimum macOS version to 10.15 due to PyTorch and new audio code requiring it.

* Disable universal build in GH action to make it run a bit faster.

* Additionally use Homebrew packages as deps instead of building own for GH action.

* Don't build hamlib if BUILD_DEPS is 0.

* Use matrix to test macOS build on both x86_64 and ARM64.

* Experiment: always sleep for 10ms every time through the TX/RX loop.

* Temporarily enable longer tests to make sure previous pass wasn't a fluke.

* Remove logic not available in 10.15.

* Revert "Experiment: always sleep for 10ms every time through the TX/RX loop."

This reverts commit 6019c9a522.

* Need to query valid sample rates from Core Audio.

* Validate provided sample rate and channel data when creating audio object.

* Set device sample rate to user-configured option.

* Sample rates could be different between input and output.

* Revert "Temporarily enable longer tests to make sure previous pass wasn't a fluke."

This reverts commit f90c4cd081.

* Remove now unused code.

* Harmonize native vs. PortAudio config across build scripts.

* Zero out audio by default to prevent buzzing.

* Update README to use new environment variable for audio driver control.

* Add COM wrapper class around ThreadedObject. Prerequisite for WASAPI audio support.

* Disable OLE 1.0 per Windows documentation.

* WIP WASPI device enumeration.

* Forgot to check in some changes.

* Fix compiler errors.

* Avoid deadlock during sample rate list retrieval.

* s/WASPI/WASAPI/g

* WIP WASAPIAudioDevice design.

* Full WASAPIAudioDevice implementation.

* Increase priority of audio tasks to prevent dropouts.

* Add missed nullptr initialization.

* Increase buffer time to 40ms

* Fix issue where non-English device names were getting corrupted.

* Add additional logging.

* Need to create macOS audio device name just like with Windows.

* Update README to document new config options.
2025-03-31 22:35:35 -07:00