Non-default clock.allowed-rates creates streams with quantum for 48000 Hz
Version, Distribution, Desktop Environment:
Latest git, Gentoo, KDE Plasma (session manager is Wireplumber but I also reproduced it with media-session)
Description of Problem:
With default.clock.allowed-rates = [ 44100 48000 ]
opening a 44100 Hz stream and with pw-top for device also reporting 44100 it would be expected that the two would agree on quantum (2048 in this case), however the reality is different:
41 2048 44100 111.1µs 157.5µs 0.00 0.00 3 alsa_output.pci-0000_00_1b.0.analog-stereo
51 2646 44100 36.5µs 57.0µs 0.00 0.00 3 + mpv
Alternatively the reported value could be correct, implying that pw-top is misreporting the sink sample rate as 44100 when it should be 48000 Hz. It might be worth mentioning that no audio glitches can be heard nor are there any obvious error messages reported at default log level.
How Reproducible:
The same issue can be observed in the output shared by the other person who tested this in the relevant issue #1523 (comment 1033352), so it's likely always reproducible.
Steps to Reproduce:
- Set default.clock.allowed-rates = [ 44100 48000 ] in pipewire.conf and restart the daemons
- Test with for example mpv --ao=pulse or --ao=alsa (for some reason --ao=jack runs at 48000 Hz)
- Observe pw-top
Actual Results:
There's a mismatch between the pw-top reported quantum for the stream from the app versus the quantum used for the device (which makes sense when resampler is involved since the conversion needs to be time-constant) even though the sample rate matches and would be at best inefficient.
Expected Results:
Same quantum and same sample rate. ;)
Additional Info Eg. pw-dump -N > file
(As Attachment Please):
One possible hint is this (the only hit when grepping pw-dump for 2646):
"audio.adapt.follower": "",
"factory.mode": "split",
"library.name": "audioconvert/libspa-audioconvert",
"client.id": 50,
"object.id": 51,
"node.latency": "2646/44100",
"pulse.attr.maxlength": 4194304,
"pulse.attr.tlength": 35280,
"pulse.attr.prebuf": 0,
"pulse.attr.minreq": 7056
which might want more data even though I would not expect it to be part of the graph from mpv to default device. If full pw-dump or some other additional information is required, let me know.