LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-14-2017, 03:55 AM   #1
ppencho
Member
 
Registered: Jan 2004
Location: Bulgaria
Distribution: Slackware64-current
Posts: 94

Rep: Reputation: Disabled
Steam game causes crackling sound


The game is Life Is Strange Episod 1 - you could play it for free.

After few minutes the sound starts to crackle. In the console I have the following output:
Code:
ALSA lib pcm.c:8251:(snd_pcm_recover) underrun occurred
And this repeats while the game is running. Workaround is to use ALSA by itself with commented pulse redirection in /etc/asound.conf:
Code:
# ALSA system-wide config file
# By default, redirect to PulseAudio:
#pcm.default pulse
#ctl.default pulse
This solves the issue but I prefer a cleaner solution if it is possible. I googled and found some solutions but they do not work for me:
LINK

I tested with the suggested values:
Code:
default-fragments = 5
default-fragment-size-msec = 2
Also with several different, no luck, the same behavior. Do you have any experience with such a problem?
 
Old 01-14-2017, 05:01 AM   #2
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,007
Blog Entries: 16

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
Does you game support output directly to pulseaudio? It's better to use native output rather than the 'pulse' alsa plugin if possible (it's there to support "legacy" alsa programs).


pulseaudio can be prone to cpu starvation/scheduling latency on a heavily loaded system, and that results in stutters/crackling. You could try running your game as 'nice -n 19' and see if that helps pulse keep up.

I toyed with running pulseaudio under real-time scheduling, but I found that in practice niceing gave better results.
 
Old 01-14-2017, 05:51 AM   #3
ppencho
Member
 
Registered: Jan 2004
Location: Bulgaria
Distribution: Slackware64-current
Posts: 94

Original Poster
Rep: Reputation: Disabled
I am not sure if the game supports a direct output to pulse, at least there is no option in the game settings to select it. Here is the script that starts the game, with libasound.so.2 inside:
Code:
#!/bin/sh

GAMEROOT=$(cd "${0%/*}" && echo $PWD)

if [ -z "${SteamAppId}" ]; then
    echo "LifeIsStrange not launched from steam, launching steam with steam://run/319630"
    steam steam://run/319630
    exit 0
fi


unset LC_ALL

HAS_CURL=$( command -v curl-config )
if [ -n "${HAS_CURL}" ]; then
    SSL_CERT_FILE="$( curl-config --ca )"
else
    if [ -e "/etc/ssl/certs/ca-certificates.crt" ]; then
        SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
    elif [ -e "/etc/pki/tls/certs/ca-bundle.crt" ]; then
        SSL_CERT_FILE="/etc/pki/tls/certs/ca-bundle.crt"
    elif [ -e "/var/lib/ca-certificates/ca-bundle.pem" ]; then
        SSL_CERT_FILE="/var/lib/ca-certificates/ca-bundle.pem"
    fi
fi
export SSL_CERT_FILE
HAS_OPENSSL=$( command -v openssl )
if [ -n "${HAS_OPENSSL}" ]; then
    SSL_CERT_DIR="$( openssl version -d | sed -E 's/.*\"(.*)\"/\1/' )/certs"
    export SSL_CERT_DIR
fi

LD_PRELOAD_ADDITIONS=

HAS_CATALYST="$(grep fglrx /proc/modules)"
if [ -n "${HAS_CATALYST}" ]; then
    LD_PRELOAD_ADDITIONS="../lib/x86_64/libtcmalloc_minimal.so:${LD_PRELOAD_ADDITIONS}"
fi

HAS_LSB_RELEASE=$(command -v lsb_release)
if [ -n "${HAS_LSB_RELEASE}" ] && [ "$(lsb_release -c | cut -f2)" = "trusty" ]; then
    LD_PRELOAD_ADDITIONS="/usr/lib/x86_64-linux-gnu/libasound.so.2:${LD_PRELOAD_ADDITIONS}"
fi

MINIMUM_THREAD_SIZE_WRAPPER="${GAMEROOT}/bin/libminimum_thread_stack_size_wrapper.so"
if [ -e "${MINIMUM_THREAD_SIZE_WRAPPER}" ]; then
    LD_PRELOAD_ADDITIONS="${MINIMUM_THREAD_SIZE_WRAPPER}:${LD_PRELOAD_ADDITIONS}"
fi

export LD_PRELOAD="${LD_PRELOAD_ADDITIONS}:${LD_PRELOAD}"

cd "$GAMEROOT/bin"

"${GAMEROOT}/bin/LifeIsStrange" "$@"
RESULT=$?

exit ${RESULT}
If you meant to try this:
Code:
nice -n 19 ./LifeIsStrange.sh
It did not help.

slackware64-current multilib w/o the huge updates from Jan 12
 
Old 01-14-2017, 06:07 AM   #4
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,007
Blog Entries: 16

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
Quote:
Originally Posted by ppencho View Post
If you meant to try this:
Code:
nice -n 19 ./LifeIsStrange.sh
It did not help.
Yes, that's what I was getting at. Oh well, it was worth a go.
 
1 members found this post helpful.
Old 05-06-2017, 04:22 AM   #5
ppencho
Member
 
Registered: Jan 2004
Location: Bulgaria
Distribution: Slackware64-current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Not sure if it is because a game update or the latest pulseaudio 10 in -current, but it works now. SOLVED!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Blaster 24 - Crackling sound Suse 10.2 x64 Gschmidt1 Linux - Hardware 1 01-25-2007 09:12 AM
help crackling/boiling soup sound in madriva 2006 with sound blaster audigy mbman Mandriva 1 01-14-2006 10:23 PM
Sound Crackling mailmaldi Linux - Newbie 3 08-22-2005 12:00 AM
Audigy2 NX Crackling Sound erikwebb Linux - Hardware 3 10-16-2004 10:18 PM
Sound Crackling Audigy 2 redneon Linux - Hardware 7 10-06-2004 12:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration