Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate PortAudio support on Linux. #489

Merged
merged 5 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ set(USE_STATIC_SPEEXDSP FALSE CACHE BOOL
"Download and build static speex instead of the system library.")
set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
"Download and build static wxWidgets instead of the system library.")
set(USE_PULSEAUDIO FALSE CACHE BOOL
set(USE_PULSEAUDIO TRUE CACHE BOOL
"Use PulseAudio instead of PortAudio for audio I/O.")

if(USE_STATIC_DEPS)
Expand Down Expand Up @@ -326,6 +326,9 @@ else(CODEC2_BUILD_DIR)
endif()
endif(CODEC2_BUILD_DIR)

if (NOT USE_PULSEAUDIO AND LINUX)
message(WARNING "Use of PortAudio on Linux has been deprecated and may be explicitly disallowed in a future release. It is highly recommended that you use FreeDV's built-in PulseAudio support instead as this generally gives better results, especially on distributions that now use pipewire for audio.")
endif(NOT USE_PULSEAUDIO AND LINUX)

#
# Find or build portaudio/PulseAudio Library
Expand Down Expand Up @@ -353,7 +356,7 @@ On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
if(NOT ${PORTAUDIO_VERSION} EQUAL 19 AND NOT MINGW)
message(WARNING "Portaudio versions other than 19 are known to have issues. You have been warned!")
endif()
elseif(USE_PULSEAUDIO)
elseif(USE_PULSEAUDIO AND LINUX)
message(STATUS "Finding PulseAudio...")
find_package(PulseAudio REQUIRED)
if(PULSEAUDIO_FOUND)
Expand Down
1 change: 1 addition & 0 deletions USER_MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
* Adjust sizing of main page tabs for better readability. (PR #487)
3. Build system:
* Update Codec2 to v1.2.0. (PR #483)
* Deprecate PortAudio support on Linux. (PR #489)
4. Cleanup:
* Remove 2400B mode from the UI. (PR #479)

Expand Down
4 changes: 3 additions & 1 deletion build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -x -e
UT_ENABLE=${UT_ENABLE:-0}

# Allow building of either PulseAudio or PortAudio variants
FREEDV_VARIANT=${1:-portaudio}
FREEDV_VARIANT=${1:-pulseaudio}
if [[ "$FREEDV_VARIANT" != "portaudio" && "$FREEDV_VARIANT" != "pulseaudio" ]]; then
echo "Usage: build_linux.sh [portaudio|pulseaudio]"
exit -1
Expand Down Expand Up @@ -56,6 +56,8 @@ fi
mkdir -p build_linux && cd build_linux && rm -Rf *
if [[ "$FREEDV_VARIANT" == "pulseaudio" ]]; then
PULSEAUDIO_PARAM="-DUSE_PULSEAUDIO=1"
else
PULSEAUDIO_PARAM="-DUSE_PULSEAUDIO=0"
fi
cmake $PULSEAUDIO_PARAM -DUNITTEST=$UT_ENABLE -DCMAKE_BUILD_TYPE=Debug -DCODEC2_BUILD_DIR=$CODEC2DIR/build_linux -DLPCNET_BUILD_DIR=$LPCNETDIR/build_linux ..
make VERBOSE=1
8 changes: 4 additions & 4 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
if(USE_PULSEAUDIO)
if(USE_PULSEAUDIO AND LINUX)
set(AUDIO_ENGINE_LIBRARY_SPECIFIC_FILES
PulseAudioDevice.cpp
PulseAudioEngine.cpp
)

else(USE_PULSEAUDIO)
else(USE_PULSEAUDIO AND LINUX)
set(AUDIO_ENGINE_LIBRARY_SPECIFIC_FILES
PortAudioDevice.cpp
PortAudioEngine.cpp
)

endif(USE_PULSEAUDIO)
endif(USE_PULSEAUDIO AND LINUX)

add_library(fdv_audio STATIC
AudioDeviceSpecification.cpp
Expand All @@ -24,4 +24,4 @@ if(BOOTSTRAP_WXWIDGETS)
add_dependencies(fdv_audio wx::core wx::base wx::aui wx::html wx::net wx::adv wx::propgrid wx::xrc)
target_compile_definitions(fdv_audio PRIVATE ${WXBUILD_BUILD_DEFS})
target_include_directories(fdv_audio PRIVATE ${WXBUILD_INCLUDES})
endif(BOOTSTRAP_WXWIDGETS)
endif(BOOTSTRAP_WXWIDGETS)