Comment 131 for bug 1851518

Revision history for this message
Duke Fong (duke-c) wrote :

@PowerKiKi
The to912 script needs to be re-run after the audio sleeps. I have been running it manually for two years. Yesterday, I wrote a script that runs automatically after booting. It is much more convenient now. The script snippet:

LAST=0
while true; do
    #pacmd list-sink-inputs | grep -w state | grep -q RUNNING && CUR=1 || CUR=0
    cat /proc/asound/card0/pcm0p/sub0/status | grep -q RUNNING && CUR=1 || CUR=0

    sleep 1
    [ $LAST != $CUR ] && echo "audio state: $LAST -> $CUR @ $(date)"
    if [ $LAST == 0 ] && [ $CUR == 1 ]; then
        echo "run fix_audio ..."
        ./to912_fix_audio.sh &> /dev/null
    fi
    LAST=$CUR
done