Duplicated audio sample played after silence

Bug #2100497 reported by Heather Lemon
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pipewire (Ubuntu)
Status tracked in Questing
Noble
Confirmed
Medium
Ioanna Alifieraki
Oracular
Confirmed
Medium
Ioanna Alifieraki
Plucky
Confirmed
Medium
Ioanna Alifieraki
Questing
Confirmed
Medium
Ioanna Alifieraki

Bug Description

[IMPACT]

Playing audio from on an Ubuntu instance Noble and later, results in duplicated audio samples
after a silence interval (no audio buffer pushed in the pipeline for some time).

It affects Noble, Oracular, Plucky and Questing.

The problem started because in Noble we've switched from pulseaudio to pipewire.
This issue is not reproducible on pulseaudio.

Upstream commit (1) is required as a depedency:
https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/cf7e91702417276cbb062ed23fa424ced3864121

The issue is fixed by upstream commit (2):
https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/c62905d911485369556b68e074b1ec73162ef545

[TEST CASE]

The issue is not always reproducible.

Install audacity and then launch 1 terminal + 1 pavucontrol + 1 audacity window and then:

- Start recording on audacity (even without playing anything)
- Execute the sample app with "./audio_test test_audio.wav"
- Go to pavucontrol and set:
--- In the playback tab, pick your audio output for 'audio_test' app
--- In the recording tab, pick the "Monitor of" the same audio output device for the audacity app
- Stop the recording in audacity and open a new clean audacity window (ctrl+n)
- Start recording and immediately jump to the terminal and execute the sample app (./audio_test test_audio.wav)

You will be able to see similar behavior in the audio spectrogram generated by audacity,
when comparing it with the one from the upstream bug (with the incorrect audio being played from the buffer after the silence). To make it more visible, you can import the audio file (test_audio.wav) using File>Import, align and compare them.

[WHERE PROBLEMS COULD OCUUR]

This SRU introduces 2 commits.

(1) https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/cf7e91702417276cbb062ed23fa424ced3864121
pulse-server: make a function to silence a buffer

This commit changes the stream_process() function of pulse-server and cuts out some code to turn it into
a function without modifying it. The regression potential here is minimal (no any functional change), however
any potential problem would regard pulse server.

(2) https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/c62905d911485369556b68e074b1ec73162ef545
pulse-server: clear old data when jumping forwards

This commit addresses the issue by checking if a forward jump has happened in the ringbuffer, if so
the samples jumped over are cleared. The change is happens in modules/module-protocol-pulse/server.c.
Any potential regression would affect audio playback.

[OTHER]

autopkgtest for N, O, P passing.

Upstream bugs:
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4464
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4114

Tags: patch
Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

audio test 2 file

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

wav file

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

sound after silence

description: updated
Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for questing attached.

description: updated
Changed in pipewire (Ubuntu Questing):
status: New → Confirmed
Changed in pipewire (Ubuntu Plucky):
status: New → Confirmed
Changed in pipewire (Ubuntu Oracular):
status: New → Confirmed
Changed in pipewire (Ubuntu Noble):
status: New → Confirmed
importance: Undecided → Medium
Changed in pipewire (Ubuntu Oracular):
importance: Undecided → Medium
Changed in pipewire (Ubuntu Plucky):
importance: Undecided → Medium
Changed in pipewire (Ubuntu Questing):
importance: Undecided → Medium
Changed in pipewire (Ubuntu Noble):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in pipewire (Ubuntu Oracular):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in pipewire (Ubuntu Questing):
assignee: nobody → Ioanna Alifieraki (joalif)
Changed in pipewire (Ubuntu Plucky):
assignee: nobody → Ioanna Alifieraki (joalif)
Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for plucky attached.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for oracular attached.

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

Debdiff for noble attached.

description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp2100497_questing.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.