LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 03-14-2020, 11:19 PM   #1
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 14.2+ (-current)
Posts: 110

Rep: Reputation: Disabled
Talking RPi3 (Sarpi) - Retroarch stuttering sound *finally* fixed via pulse audio tsched setting


After moving from Sarpi kernel/modules 4.19.34 to any newer kernel/modules, I started experiencing audio stuttering in Retroarch when launching any game. The stuttering would normally stop after some minutes of running the game. Displaying the framerate on the screen showed that framerate was below 60fps while the stuttering was going on.

Having sound disabled (which happened accidentally when a recent kernel broke the sound module) allowed a normal 60fps framerate. This suggested that the problem was with sound, and I ran across a report of someone having the same issue on an RPi4 so it didn't appear the issue was a performance/computing limitation of the RPi3.

For months I tried various retroarch.cfg settings, changing the selected audio driver, trying different audio/video sync settings and various other suggested tweaks. Nothing helped.

Today, completely by accident (I don't remember how in fact), I ran across a post discussing how to fix audio stutter in Steam on a Raspberry Pi:

https://steamcommunity.com/app/35338...2464753800526/

It suggested to edit /etc/pulse/default.pa

And change this line:

Code:
load-module module-udev-detect
to:

Code:
load-module module-udev-detect tsched=0
After making this change and rebooting, the change can be verified by running this command below and looking for tsched=no in the ouput:

Code:
pactl list | grep tsched
Accorcing to the ArchWiki, tsched controls how audio scheduling is done, and this section is relevant:
Quote:
The newer implementation of the PulseAudio sound server uses timer-based audio scheduling instead of the traditional, interrupt-driven approach.
Timer-based scheduling may expose issues in some ALSA drivers. On the other hand, other drivers might be glitchy without it on, so check to see what works on your system.
As to why it was newer kernels that made this problem appear? No idea. Maybe some change in kernel timing/scheduling behavior that somehow impacted the sound timing. Or maybe the ALSA driver that comes with newer kernels/modules exposes some issue which is triggered if tsched is enabled.

Total luck finding this solution - not something I'd ever figure out in this lifetime.

References:

Raspberry pi 4 poor audio, stuttering potential fix
https://steamcommunity.com/app/35338...2464753800526/

For pulseaudio what does tsched do (and what are the defaults)?
https://askubuntu.com/questions/371595

PulseAudio/Troubleshooting -> Glitches, skips or crackling
https://wiki.archlinux.org/index.php...roubleshooting
 
Old 03-14-2020, 11:40 PM   #2
eduardr
Member
 
Registered: Sep 2011
Distribution: Slackware64 14.2+ (-current)
Posts: 110

Original Poster
Rep: Reputation: Disabled
This fix is reported (in the Steam forum post) to help not just with Steam and Retroarch, but also with sound in various browsers (playing videos etc), and in rdesktop.
 
Old 03-17-2020, 02:10 AM   #3
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by eduardr View Post
This fix is reported (in the Steam forum post) to help not just with Steam and Retroarch, but also with sound in various browsers (playing videos etc), and in rdesktop.
This is quite interesting. I've done some reading into this and learned a thing or two. Not being much of a desktop user on Slackware ARM, Raspberry Pi sound output isn't something I deal with, ever.

It seems there may be inferences for tsched on ARM64. That's certainly something to watch for the future.
 
1 members found this post helpful.
  


Reply



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
Audio output to File - Pulse Audio pr0xibus Linux - Software 3 08-26-2019 06:36 AM
SARPi website new URL - sarpi.co.uk Exaga Slackware - ARM 4 01-28-2018 06:36 PM
Pulse counter or frequency of incoming pulse train jayhorizon Programming 15 10-29-2010 04:29 AM
Audio/Amarok(?) stuttering sound Sammael Linux - Software 5 08-26-2006 06:42 AM

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

All times are GMT -5. The time now is 01:30 PM.

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
Open Source Consulting | Domain Registration