Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make UHD/USRP support optional so Trunk Recorder can be built on systems that provide GNU Radio and gr-osmosdr but do not have GNU Radio UHD or the native UHD library installed.
Previously, GnuradioUHD and LibUHD were discovered as optional dependencies, but their library variables were linked unconditionally by the main executable and built-in plugins. When UHD was unavailable, those variables were set to NOTFOUND, causing the CMake generate step to fail.
Changes
Add TR_HAVE_UHD to indicate whether both GNU Radio UHD and the native UHD library are available.
Add TR_UHD_LIBRARIES and TR_UHD_LIBRARY_DIRS so targets can safely reference UHD dependencies only when UHD support is available.
Guard the GNU Radio UHD header and USRP-specific source code with TR_HAVE_UHD.
Remove the unused UHD include from main.cc.
Update built-in plugins to use the optional UHD library list.
Provide a clear runtime error if a configuration requests the usrp driver from a build compiled without UHD support.
USRP behavior is unchanged when UHD is installed.
Testing
Tested on FreeBSD 15.1-RELEASE amd64 with:
Clang 19.1.7
GNU Radio 3.10.12
gr-osmosdr 0.2.6 with Airspy support
libairspy
Trunk Recorder 5.2.x
Verified:
Clean CMake configure succeeds with GNU Radio UHD and native UHD absent.
Full clean build succeeds, including all built-in plugins.
The resulting trunk-recorder binary links against gr-osmosdr and libairspy without linking UHD.
Configuring a usrp source on a non-UHD build exits with a clear error message.
10 Msps complex IQ file replay works.
P25 Phase II control-channel decoding works.
TDMA voice recording works on both slots.
OP25 voice decode works.
WAV creation, FFmpeg processing, loudness normalization, and M4A generation work successfully.
This change is not FreeBSD-specific. It should also allow non-UHD builds on other platforms where only the other supported SDR/input drivers are needed.