Page 1 of 1

Loud click on startup

Posted: 11 Apr 2024 13:11
by digdogsdad
I am on Linux Mint 21.2 Victoria. I have a small script that I use for Korean vocab practice, which uses cvlc, but there is always a loud click when I start the script and it plays the first file, which is a real pain if I have headphones on. After that, other files played by the script continue without the click. Is there any way of suppressing the click on startup? VLC sits on the taskbar after first run even tho' cvlc closes, but the click still happens at next start of script. It is playing m4a type files (one Korean word per file), and I have also noticed that on very short files cvlc sometimes (not often) cuts off the end of the file.

Here is my script:

#!/bin/bash
if [ "$1" == "" ]
then
echo Please enter page number.
else
PAGE=$(expr $(expr $1 / 2) \* 2)
DIRECTORY="./Korean/VisualDictionary/DK_VisualDictionary/P$(expr 1000 + $PAGE | cut -b 2,3,4)"

clear; echo Playing: Pages $PAGE and $(expr $PAGE + 1): Directory $DIRECTORY; #Debug line

#Loop forever (break with control-c)
while true
do
#We want to play files in different random order each time
for FILE in $(find $DIRECTORY -type f | sort -R)
do
#echo $FILE; #Debug Line
cvlc --no-loop --play-and-exit $FILE >/dev/null 2>&1

if [ "$2" == "" ]; then PAUSE="2"; else PAUSE="$2"; fi
sleep $PAUSE
done
done
fi

Re: Loud click on startup

Posted: 11 Apr 2024 13:48
by digdogsdad
I note it is not vlc on taskbar, it is audio control with an entry saying "vlc stopped"

Re: Loud click on startup

Posted: 11 Apr 2024 14:05
by RĂ©mi Denis-Courmont
VLC itself won't cause any clicks unless they're in the source audio track. This is usually caused by hardware and/or driver limitations, such as power management that VLC has no control over.

Re: Loud click on startup

Posted: 11 Apr 2024 15:23
by digdogsdad
OK, I found a fix:

sudo tee /etc/modprobe.d/snd-hda-intel.conf <<<'options snd-hda-intel power_save=0'

Now I just get a single click on system startup and VLC does not click any more.