Bug 2218364

Summary: Pipewire-0.3.72-1 through 0.3.75-1 (and associated packages) adds delay to input audio from microphone.
Product: [Fedora] Fedora Reporter: George Kokinis <george.kokinis>
Component: pipewireAssignee: Wim Taymans <wtaymans>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: brunovern.a, information, wtaymans
Target Milestone: ---Keywords: Desktop, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of pactl info.
none
Output of journalctl --user -u pipewire.
none
Output from pw-top
none
Output of pw-dump. none

Description George Kokinis 2023-06-28 21:07:35 UTC
After upgrading to Pipewire 0.3.72-1 on Fedora 38, audio input (at least from a microphone) has significant delay (approximately 1.6 seconds). This is noticeable in the visualiser in Gnome sound settings, as well as in Discord (flatpak), and on https://www.onlinemictest.com/ inside Firefox 114.0.2-1.fc38.  

Downgrading pipewire (sudo dnf downgrade pipewire --allowerasing) to 0.3.67-1 and restarting pipewire (either the full system or via systemctl) stops this from occurring.

Reproducible: Always

Steps to Reproduce:
1. Have the specified version of pipewire and associated packages installed.
2. Use an application that takes mic input, and responds visually to that input.
3. Speak into the microphone.
Actual Results:  
There is a delay (approximately 1.6 seconds) between speaking into the microphone and the application responding.

Expected Results:  
Minimal delay between input and response.

My microphone is a Presonus Revelator Dynamic USB-C, which has worked perfectly with Linux until this update; I originally thought it was an FX preset I'd messed up in Presonus' windows software.
I will attach pactl logs etc as attachments. Any other useful logs, let me know and I'll get them to you.

Comment 1 George Kokinis 2023-06-28 21:09:52 UTC
Created attachment 1973035 [details]
Output of pactl info.

Comment 2 George Kokinis 2023-06-28 21:14:31 UTC
Created attachment 1973036 [details]
Output of journalctl --user -u pipewire.

Output of journalctl --user -u pipewire for boots from today. Multiple restartsq are me swapping version to test that downgrading fixes my issue.

Comment 3 Wim Taymans 2023-06-29 07:17:53 UTC
what is the output of pw-top? can you attach the output of pw-dump when the problem is happening?

Comment 4 George Kokinis 2023-06-29 16:57:55 UTC
Created attachment 1973206 [details]
Output from pw-top

Comment 5 George Kokinis 2023-06-29 16:58:58 UTC
Created attachment 1973207 [details]
Output of pw-dump.

Comment 6 George Kokinis 2023-07-10 19:59:34 UTC
Tested today - Same bug still occurs in pipewire 0.3.73-1.fc38.

Comment 7 George Kokinis 2023-07-18 11:39:22 UTC
Tested again today, still occurs in pipewire-0.3.74-1.fc38.

Comment 8 George Kokinis 2023-07-25 22:11:33 UTC
Tested today, still occurs in 0.3.75-1.fc38.
Are there any configuration changes I can make to give you more information?
And is it worth compiling pipewire locally, or is the fedora build "stock" enough that it shouldn't make a difference.

I suppose that sticking on an old version isn't too much of an issue for now, but I'm worried that at somepoint a security update will be released and I won't be able to update to it due to this bug.

Comment 9 Wim Taymans 2023-07-26 08:10:50 UTC
I am pretty sure that this is caused by the use of hires timestamps and the driver is not giving accurate timestamps.

You could check this theory by setting api.alsa.htimestamp=false on the node properties of the hardware nodes: https://pipewire.pages.freedesktop.org/wireplumber/configuration/alsa.html#node-properties

There seem to be other people suffering from this bug, I might disable hires timestamps by default in future versions.

Comment 10 George Kokinis 2023-07-26 16:56:25 UTC
Evening Wim,
Thanks for that, I have added a rule to set that in the config and it now seems to work. Much appreicated.