this post was submitted on 03 Aug 2023
9 points (100.0% liked)

Arch Linux

7175 readers
3 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
9
submitted 11 months ago* (last edited 11 months ago) by Infernal_pizza to c/[email protected]
 

I use DisplayPort audio as my main output, and it seems there is a slight delay between the sink being started and me actually hearing anything (the audio isn't delayed I just miss the start). I've managed to mostly fix it by disabling suspend on idle, so now once I've played some audio once its fine.

However when I reboot I then miss the first bit of audio again. I have no idea what I need to do to fix this. If I try to manually enable the sink with with pacmd suspend 0 I still get the same issue. The only potential fix I can think of is to set a KDE startup command for pacmd play-file and point it to a very short silent audio file. Does anyone have any better ideas?

Edit: I forgot to mention, when suspend on idle is enabled there is an audible pop every time the audio starts and suspends. With suspend on idle disabled I still hear this pop on login (and the first time audio is played) which suggests something is happening when I log in

Edit 2: Apparently it still does it every time the audio stream switches to a different app, however if I start the second one playing before I pause the first it starts straight away

all 12 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 11 months ago (1 children)

Does that happen on PipeWire too? In my experience it's a lot more reliable and has a much better internal design.

[–] Infernal_pizza 1 points 11 months ago

I just tried pipewire but it didn’t make any difference

[–] [email protected] 1 points 11 months ago (1 children)

I have noticed this too on pipewire. Everytime a new audio stream starts , even from a paused state, there is a small delay before it is heard. Not a syncing problem as the audio is synced, but a delayed start. I thought it might have something do with the sound bar I had routed the audio through. Based on your experience, seems not. I did experience the same delay when using HDMI port instead of DisplayPort too (IIRC). So it might be something else not related to port.

[–] Infernal_pizza 1 points 11 months ago (1 children)

Interesting, how is your sound bar connected?

[–] [email protected] 2 points 11 months ago* (last edited 11 months ago) (2 children)

Initially, I used HDMI -> Soundbar -> Monitor. The soundbar handles the sound and forwards the video signal to the monitor. Right now, it's the same, except it is using display port for Laptop to Soundbar connection. Hope I understood the question correctly. If you ever figure out the delay, please do update with a solution.

[–] Infernal_pizza 2 points 11 months ago

I'll let you know if I find anything, I've just posted on the Arch forums as well so hopefully someone there can help. If not then unfortunately this one might stay unsolved

[–] Infernal_pizza 2 points 11 months ago (1 children)

I’ve found a janky fix that seems to work. I noticed that if you start a second audio stream while the first one was still playing it started straight away. There is a pulseaudio module called module-sine which generates a constant sine wave and you can choose the frequency.

So I added load-module module-sine frequency=1 to /etc/pulse/default.pa. This constantly plays an inaudible sound wave which seems to keep the stream alive and stops the popping/delays. I’m not 100% sure if that is a good fix or not as you are effectively constantly playing audio, but I can’t find a better way to solve it!

[–] [email protected] 2 points 11 months ago (1 children)

I guess that's one way to fix it. Thanks for letting me know.

However, I think I will keep searching for a different fix. Playing a sound constantly will keep on nagging me, even though it shouldn't. Also I am worried about what will happen when an application like mpv wants full access to the device, but there is an ongoing stream there.

On a side note, since this came up and I have been paying attention, I noticed that some of the system notification sound that I keep missing are caused due to this delay :(

On the plus side, since I almost constantly listen to some music at low volume, I might actually be doing your fix in a round about manual way. This was how I noticed that system notification played fine, if music was already playing, but not otherwise.

[–] Infernal_pizza 2 points 11 months ago (1 children)

One other suggestion I saw was to create a file under /etc/modprobe.d/disableHdaPowersave.conf with the content options snd-hda-intel power_save=0, but that made no difference to me. If you do find anything else please let me know as I'm not 100% happy with my solution!

[–] [email protected] 2 points 11 months ago

Thanks, but that didn't make any difference for me as well. I will let you know if I find anything else.