this post was submitted on 03 Nov 2023
5 points (100.0% liked)

Void Linux

494 readers
1 users here now

Void Linux is an independent distribution, developed entirely by volunteers.Install once, update daily. Your system will always be up-to-date.Void use runit as the init system and service supervisor. xbps is the native system package manager. https://voidlinux.org/

founded 4 years ago
MODERATORS
 

It's an older PC, a P4 I use as a radio streamer mostly, so the install is x86.

The problem is, audio seems to play back faster. I have it set up to boot up the streaming application after boot (Tuner, about 20 seconds after boot since it uses a spinning IDE HDD, so the rig is slow on boot) and sometimes (rarely) everything will be fine, the playback speed will be fine. But, most of the time, the audio plays back faster. In some rare cases, I've also noticed it can play slower as well. Also, if the audio is fine after Tuner starts and you change radio streams, back to square one, it starts playing the audio faster.

I tried running other applications, like VLC and Audacious to see if the same thing is happening in them. Yep, the same thing. I still haven't tried Winamp with wine.

I still use PulseAudio on that rig. I didn't see a reason to switch since it did it's job, I don't really need anything fancy on it, just a workable audio out was all I needed.

Also, I have no idea when this actually started happening (everything worked fine when I set it up a few years ago, 1.5 or 2 years ago I think) since I haven't used it in a while as a streamer, but I needed to use it now. I thought it might be a kernel/driver bug, so I rolled back a snapshot a few months ago (I think a snapshot that still had some 5.x version of the kernel), and it did kinda work (the fast playback speeds were less sporadic) but it didn't eliminate the problem completely.

Please, tell me what commands to run on this thing, I'll do it and post the output. It uses an onboard audio card, some old Intel card part of the chipset I think. Here is the output from lspci regarding the audio.

Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

I'm thinking PulseAudio is so outdated now that it causes problems like these on certain chipsets/audio controllers, but I'm not sure. I know I'll have to eventually switch to PipeWire, but I was hoping I could ride the PulseAudio train a little longer.

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago (2 children)

Sounds to me like maybe the sample rate is changing away from what your application expects (44.1 vs. 48 kHz). I used to have this problem with Pulse quite often, but I don't remember if I fixed it before switching to PipeWire.

Pulse has a "preferred sample rate" setting in its config files, but it seems to only really be a suggestion, and Pulse tends to ignore it.

[–] PCChipsM922U 4 points 1 year ago* (last edited 1 year ago)

OK, I think I solved it :). Just needed to manually set some parameters in /etc/pulse/daemon.conf.

resample-method = soxr-hq
avoid-resampling = false
enable-remixing = yes
default-sample-rate = 44100
alternate-sample-rate = 48000

I think defining the default and alternative sample rate mostly solved the problem, the other settings were just in case, I didn't check if it worked with or without them.

[–] PCChipsM922U 1 points 1 year ago

So, how do I force it to use a particular sample rate? Cuz I think the streams are 44.1KHz (as is with most audio) and if it speeds up, the sample rate should be set to 48KHz if my logic serves me correctly.

This is just a temporary fix, I'll switch to PipeWire as soon as I can, I just wanna do some work in my workshop and listen to music...