Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Audacious - ALSA reports underruns on new hardware
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Sun Aug 21, 2016 7:07 pm    Post subject: [SOLVED] Audacious - ALSA reports underruns on new hardware Reply with quote

I'm confused, but after I've migrated to my new machine, Audacious began reporting buffer underruns and audio skips.

Code:
ALSA lib /tmp/portage/media-libs/alsa-lib-1.0.29/work/alsa-lib-1.0.29/src/pcm/pcm.c:7905:(snd_pcm_recover) underrun occurred


I've specifically built my new machine with Soundblaster Audigy SE card, based on CA0106 chip, which I used on my previous machine and it used to work perfectly there.
Buffer underruns usually occur during high system load, when CPU is unable to put enough audio samples into ring buffer in time. However, my new system is octocore FX-8350. And system isn't under huge workload. I don't see any reasons for buffer underruns to occur. Setting higher buffer size in Audacious doesn't help.

There's some information on Arch Wiki which indicates that dynamic CPU frequency scaling governor might cause audio skipping:

Quote:
Some combinations of ALSA drivers and sound chips may cause audio skipping as the governor changes between frequencies, switching back to a non-changing governor seems to stop the audio skipping.


However, I've tried setting all cores to performance governor and it doesn't make any difference, underruns still occur. I wonder, what might cause those.


Last edited by NilPointer on Mon Aug 22, 2016 6:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Mon Aug 22, 2016 4:00 am    Post subject: Reply with quote

Hi,

there is one thing I do under Linux, I disable any powersaving everywhere I can, processor, wireless card, Pci bus, Usb bus, Bluetooth ... but, your problem may come from Audacious itself. I use Audacious. It do not support some types of multimedia.

I have use it to listen to radio from Internet, sometimes the streaming stop but, it can come from my ISP. What I suggest is to use other multimedia softwares, Vlc and Mplayer, but for Mplayer, in command lines. You may not have underruns. Two similar symptoms value more than one.
_________________
Paul
Back to top
View user's profile Send private message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Mon Aug 22, 2016 6:06 pm    Post subject: Reply with quote

I've managed to pin down the problem - if I disable HPET in BIOS, Audacious stops skipping audio. But that's weird. I mean, HPET is high-precision timing source and if you think logically, enabling it should be beneficial for multimedia functionality. Yet Audacious begins to skip on local MP3s.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Aug 22, 2016 8:28 pm    Post subject: Reply with quote

If it's that then you should be able to override it at runtime instead of having to mess with the BIOS:
Code:
cd /sys/devices/system/clocksource/clocksource0
echo acpi_pm > current_clocksource

(There might be a driver-specific thing in /sys/module/*/parameters that'd help, but I don't use Creative hardware so can't really say.)
Back to top
View user's profile Send private message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Tue Aug 23, 2016 7:56 pm    Post subject: Reply with quote

Thanks, Ant P., that worked! That's better solution, because it doesn't cut off HPET and it's possible to switch to it.

Actually, clocksource defaults to tsc, not the hpet at boot time:

Code:
$ cat current_clocksource
tsc


Even though hpet (and acpi_pm) are available:

Code:
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm


I wonder if TSC on Vishera CPUs is broken or something? Isn't TSC supposed to be a most precise clocksource?

Setting clocksource to TSC or HPET causes Audacious to skip a second occasionally due to underrun. Setting to acpi_pm clocksource fixes the problem. Is there any advantage to use tsc or hpet?
Back to top
View user's profile Send private message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Thu Aug 25, 2016 6:26 pm    Post subject: Reply with quote

Looks like I've finally found a proper, ultimate solution to the problem.

My kernel used to be compiled with Voluntary Kernel Preemption (Desktop). I've recompiled it with Preemptible Kernel (Low-Latency Desktop) and Audacious stopped skipping on tsc clocksource.
Back to top
View user's profile Send private message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Sat Aug 27, 2016 9:55 am    Post subject: Reply with quote

In the end, I've completely disabled the HPET in the BIOS, looks like I have a malfunctioning HPET circuit on motherboard. Even if clocksource was acpi_pm, system felt jittery and choppy (even though it's running from SSD on octocore CPU). Problems were not only limited to Audacious, but games also felt choppy and even when moving the windows around quickly, they occasionally jumped rather than moving smoothly. After disabling HPET via BIOS, system became noticeably more responsible.

Also, like Logicien adviced, I've disabled powersaving for CPU - Cool'n'Quiet, C1E and C6 power states. Idle power consumption has doubled (but still less than max TDP) but guess it's worth it, since system responsiveness increased further.

Now my machine really works like I've expected it to, when I was assembling it.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Aug 29, 2016 11:02 am    Post subject: Reply with quote

The C1E feature on mine (6 years old K10) is broken in the same way. I turned it on once, the system went into a coma whenever there were no keyboard/mouse interrupts...

The others seem a bit overkill though. For the first one you can just set the cpufreq governor to "performance" (or schedutil in 4.7; ondemand has always been terrible). C6 shouldn't hurt anything either (I hope).
Back to top
View user's profile Send private message
NilPointer
n00b
n00b


Joined: 02 Feb 2015
Posts: 41

PostPosted: Sun Sep 04, 2016 8:37 am    Post subject: Reply with quote

Ant P. wrote:
The C1E feature on mine (6 years old K10) is broken in the same way. I turned it on once, the system went into a coma whenever there were no keyboard/mouse interrupts...

The others seem a bit overkill though. For the first one you can just set the cpufreq governor to "performance" (or schedutil in 4.7; ondemand has always been terrible). C6 shouldn't hurt anything either (I hope).


Yes, I actually thought so, too. Just re-enabled them yesterday (except for broken C1E). Pretty much everything works fine, well, except for Audacious, but I'm beginning to think it's probably an Audacious issue, because other ALSA apps don't seem to produce underruns. It underruns even on performance governor.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum