Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 821271 - >=media-sound/pulseaudio-15.0: null-sink crashes after sample-spec reconfiguration
Summary: >=media-sound/pulseaudio-15.0: null-sink crashes after sample-spec reconfigur...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Igor V. Kovalenko
URL: https://gitlab.freedesktop.org/pulsea...
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2021-11-02 05:36 UTC by darkstalker
Modified: 2022-06-10 07:00 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,6.63 KB, text/plain)
2021-11-02 05:36 UTC, darkstalker
Details
pulseeffects log (pulseeffects_log.txt,15.19 KB, text/plain)
2021-11-02 05:36 UTC, darkstalker
Details
pulseaudio stack trace (trace_pulse.txt,40.11 KB, text/plain)
2021-11-02 16:01 UTC, darkstalker
Details
pulse verbose log (pulse-verbose.log.gz,50.13 KB, application/gzip)
2021-11-02 19:44 UTC, darkstalker
Details
pulseeffects stack trace (stacktrace_pulseeffects.txt,16.43 KB, text/plain)
2021-11-02 19:56 UTC, darkstalker
Details
debug patch for module-null-sink crash when sample rate is changed (file_821271.txt,726 bytes, text/plain)
2021-11-02 21:27 UTC, Igor V. Kovalenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkstalker 2021-11-02 05:36:22 UTC
Created attachment 747972 [details]
emerge --info

After the update to 'media-sound/pulseaudio-15.0-r1', PulseEffects stopped working. Program starts but it doesn't load it's sound devices or produce any effect in the sound.
Comment 1 darkstalker 2021-11-02 05:36:48 UTC
Created attachment 747975 [details]
pulseeffects log
Comment 2 darkstalker 2021-11-02 16:01:33 UTC
Created attachment 748065 [details]
pulseaudio stack trace

I noticed a silent crash on pulseaudio that happens when starting playback. File name was 'core-null-sink-s6-t1635868382', that likely points to what produced it.
Comment 3 Igor V. Kovalenko 2021-11-02 18:14:45 UTC
Installed pulseeffects-4.8.5-r1 now and cannot reproduce this issue. 

If you can reproduce this pulseaudio crash at will, could you please stop pulseaudio, start it like this: 'pulseaudio -vvvvv > /tmp/pulse-verbose.log' then reproduce the issue and attach the log here?
Comment 4 darkstalker 2021-11-02 19:44:58 UTC
Created attachment 748095 [details]
pulse verbose log

managed to reproduce the crash by opening pulseeffects while in the middle of playback
Comment 5 darkstalker 2021-11-02 19:56:16 UTC
Created attachment 748113 [details]
pulseeffects stack trace

crashing this way produces an additional core dump from pulseeffects itself
Comment 6 Igor V. Kovalenko 2021-11-02 20:23:08 UTC
Thanks, looks like last crash is due to module-null-sink was caught during format change. The code which crashed looks like there for ages, so maybe something else is changed.

I still cannot reproduce the crash, could you please share pa-info output? Maybe you do set some configuration parameter that I do not have here.
Comment 7 Igor V. Kovalenko 2021-11-02 21:27:30 UTC
Created attachment 748119 [details]
debug patch for module-null-sink crash when sample rate is changed

Could you please try reproducing issue with this debugging patch applied?
This double-checks that internal frame alignment is still correct when module-null-sink is ready to render audio samples.
Comment 8 Igor V. Kovalenko 2021-11-02 22:32:40 UTC
Please also test this proposed change https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/658 which should fix misaligned value so assertion is no longer triggered.
Comment 9 Igor V. Kovalenko 2021-11-02 22:52:01 UTC
I reproduced this crash

1. in daemon.conf set avoid-resampling=true
2. start playing audio with format different from default one, e.g.
if default is s16le use float
   mpv --audio-format=float --audio-samplerate=96000 *
3. start pulseeffects

here the crash happens instantly, with same assertion. This proposed change https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/658 fixes the issue.
Comment 10 darkstalker 2021-11-03 05:05:31 UTC
I can confirm that the `avoid-resampling = true` setting caused the issue. Removed that setting from my config file (on unpatched pulse) and everything works fine.

Also tried the patch posted on gitlab patch and it works, PulseEffects is now working fine with avoid-resampling enabled.
Comment 11 Igor V. Kovalenko 2021-11-08 21:35:58 UTC
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/658 is now merged upstream.
Comment 12 Marek Szuba archtester gentoo-dev 2021-11-16 11:19:54 UTC
Upstream have assigned to the 16.0 milestone so I guess this patch should be backported to pulseaudio-15 in Gentoo.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-16 11:52:56 UTC
(In reply to Marek Szuba from comment #12)
> Upstream have assigned to the 16.0 milestone so I guess this patch should be
> backported to pulseaudio-15 in Gentoo.

Will wait to see what Igor says first as he's an upstream developer first, but yeah, sounds reasonable.
Comment 14 Igor V. Kovalenko 2021-11-17 12:05:21 UTC
(In reply to Sam James from comment #13)
> (In reply to Marek Szuba from comment #12)
> > Upstream have assigned to the 16.0 milestone so I guess this patch should be
> > backported to pulseaudio-15 in Gentoo.
> 
> Will wait to see what Igor says first as he's an upstream developer first,
> but yeah, sounds reasonable.
I think this change is worth backporting, not sure if I understand all concerns around that though.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-26 05:15:59 UTC
(In reply to Igor V. Kovalenko from comment #14)
> (In reply to Sam James from comment #13)
> > (In reply to Marek Szuba from comment #12)
> > > Upstream have assigned to the 16.0 milestone so I guess this patch should be
> > > backported to pulseaudio-15 in Gentoo.
> > 
> > Will wait to see what Igor says first as he's an upstream developer first,
> > but yeah, sounds reasonable.
> I think this change is worth backporting, not sure if I understand all
> concerns around that though.

I think it's mostly "if it's a safe enough change, do it". And it's a bug fix, not a new feature.
Comment 16 Igor V. Kovalenko 2021-11-26 05:21:26 UTC
Yes, this change is quite simple and safe, please apply!
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 07:00:01 UTC
Obsolete given we have 16.0 now.