From 28bd311aabce9fbf0c5a2ab14a27157d285b332e Mon Sep 17 00:00:00 2001 From: Justin Travis Date: Mon, 15 Nov 2021 04:07:46 -0500 Subject: [PATCH] KASM-2021 Add fragment_size argument for ffmpeg pulseaudio - newer versions of ffmpeg need this applied or the audio will be choppy --- src/common/startup_scripts/vnc_startup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index 0b7abc8..6627cec 100644 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -98,11 +98,11 @@ function start_audio_out (){ if [[ $DEBUG == true ]]; then echo 'Starting audio service in debug mode' - no_proxy=127.0.0.1 ffmpeg -f pulse -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio & + no_proxy=127.0.0.1 ffmpeg -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio & KASM_PROCS['kasm_audio_out']=$! else echo 'Starting audio service' - no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 & + no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 & KASM_PROCS['kasm_audio_out']=$! echo -e "\n------------------ Started Audio Out ----------------------------" echo "Kasm Audio Out PID: ${KASM_PROCS['kasm_audio_out']}";