Discussion:
[pulseaudio-discuss] can rewindings in the null sink produce noises in programs recording its monitor?
wellington wallace
2018-10-06 18:29:02 UTC
Permalink
Hi! PulseEffects developer here again.

Like the title says I'd like to know if rewinds can cause crackling noises
when we are recording from a null sink monitor. In PulseEffecs I use the
plugin pulsesrc from GStreamer to record the null sink monitor and whenever
there is a change in the null sink volume or in the volume of a sink input
playing to the null sink I can here noises. Looking at Pulseaudio's logs I
can see lines with:

[null-sink] module-null-sink.c: Requested to rewind 3528 bytes.
[null-sink] sink.c: Processing rewind...
[null-sink] sink-input.c: Have to rewind 2840 bytes on render memblockq.
[null-sink] sink-input.c: Have to rewind 1420 bytes on implementor.
[null-sink] source.c: Processing rewind...
[null-sink] module-null-sink.c: Rewound 2840 bytes.
[pulseaudio] module-stream-restore.c: Storing volume/mute/device for stream
sink-input-by-media-role:music.
[pulseaudio] protocol-native.c: Client spotify changes volume of sink input
Spotify.

whenever the application volume is changed. At the same time they are shown
I can hear cracklings. So it seems related. I noticed that forcing pulsesrc
to use lower latencies help but do not fix the problem. Changing volumes
with pulsesrc latency-time parameter set to 1000 us produces less noises
than when it is set to 10000 us.

I tried my best to see if there is anything I can do on my side to remove
this noise I found nothing. Is that how things are or is there anything
that can be done to remove this noises?

Best regards,

Wellington
--
Prof.° Wellington Wallace Miguel Melo

CEFET/RJ Uned Nova Iguaçu
Tanu Kaskinen
2018-10-09 08:27:36 UTC
Permalink
Post by wellington wallace
Hi! PulseEffects developer here again.
Like the title says I'd like to know if rewinds can cause crackling noises
when we are recording from a null sink monitor.
Yes it can:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/304
Post by wellington wallace
In PulseEffecs I use the
plugin pulsesrc from GStreamer to record the null sink monitor and whenever
there is a change in the null sink volume or in the volume of a sink input
playing to the null sink I can here noises. Looking at Pulseaudio's logs I
[null-sink] module-null-sink.c: Requested to rewind 3528 bytes.
[null-sink] sink.c: Processing rewind...
[null-sink] sink-input.c: Have to rewind 2840 bytes on render memblockq.
[null-sink] sink-input.c: Have to rewind 1420 bytes on implementor.
[null-sink] source.c: Processing rewind...
[null-sink] module-null-sink.c: Rewound 2840 bytes.
[pulseaudio] module-stream-restore.c: Storing volume/mute/device for stream
sink-input-by-media-role:music.
[pulseaudio] protocol-native.c: Client spotify changes volume of sink input
Spotify.
whenever the application volume is changed. At the same time they are shown
I can hear cracklings. So it seems related. I noticed that forcing pulsesrc
to use lower latencies help but do not fix the problem. Changing volumes
with pulsesrc latency-time parameter set to 1000 us produces less noises
than when it is set to 10000 us.
I tried my best to see if there is anything I can do on my side to remove
this noise I found nothing. Is that how things are or is there anything
that can be done to remove this noises?
This is how things are. It would be great if someone would have a hard
look at the monitor source rewinding code and see what goes wrong
there.
--
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk
Arun Raghavan
2018-10-11 13:15:34 UTC
Permalink
Post by Tanu Kaskinen
Post by wellington wallace
Hi! PulseEffects developer here again.
Like the title says I'd like to know if rewinds can cause crackling noises
when we are recording from a null sink monitor.
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/304
Post by wellington wallace
In PulseEffecs I use the
plugin pulsesrc from GStreamer to record the null sink monitor and whenever
there is a change in the null sink volume or in the volume of a sink input
playing to the null sink I can here noises. Looking at Pulseaudio's logs I
[null-sink] module-null-sink.c: Requested to rewind 3528 bytes.
[null-sink] sink.c: Processing rewind...
[null-sink] sink-input.c: Have to rewind 2840 bytes on render memblockq.
[null-sink] sink-input.c: Have to rewind 1420 bytes on implementor.
[null-sink] source.c: Processing rewind...
[null-sink] module-null-sink.c: Rewound 2840 bytes.
[pulseaudio] module-stream-restore.c: Storing volume/mute/device for stream
sink-input-by-media-role:music.
[pulseaudio] protocol-native.c: Client spotify changes volume of sink input
Spotify.
whenever the application volume is changed. At the same time they are shown
I can hear cracklings. So it seems related. I noticed that forcing pulsesrc
to use lower latencies help but do not fix the problem. Changing volumes
with pulsesrc latency-time parameter set to 1000 us produces less noises
than when it is set to 10000 us.
I tried my best to see if there is anything I can do on my side to remove
this noise I found nothing. Is that how things are or is there anything
that can be done to remove this noises?
This is how things are. It would be great if someone would have a hard
look at the monitor source rewinding code and see what goes wrong
there.
I'd love it if someone beat me to it, but I think we need some unit testing for this.

In general, I've been trying to add some high-level utilities to allow us to write such tests easily, and we need to extend this to do a lot more:

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/tree/master/src/tests/lo-test-util.h
https://gitlab.freedesktop.org/arun/pulseaudio/blob/reconfigure/src/tests/test-util.h

Cheers,
Arun

wellington wallace
2018-10-11 01:59:33 UTC
Permalink
* Hi! PulseEffects developer here again.
*> >* Like the title says I'd like to know if rewinds can cause crackling noises
*>* when we are recording from a null sink monitor.
*
Yes it can: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/304
* In PulseEffecs I use the
*>* plugin pulsesrc from GStreamer to record the null sink monitor and whenever
*>* there is a change in the null sink volume or in the volume of a sink input
*>* playing to the null sink I can here noises. Looking at Pulseaudio's logs I
*> >* [null-sink] module-null-sink.c: Requested to rewind 3528 bytes.
*>* [null-sink] sink.c: Processing rewind...
*>* [null-sink] sink-input.c: Have to rewind 2840 bytes on render memblockq.
*>* [null-sink] sink-input.c: Have to rewind 1420 bytes on implementor.
*>* [null-sink] source.c: Processing rewind...
*>* [null-sink] module-null-sink.c: Rewound 2840 bytes.
*>* [pulseaudio] module-stream-restore.c: Storing volume/mute/device for stream
*>* sink-input-by-media-role:music.
*>* [pulseaudio] protocol-native.c: Client spotify changes volume of sink input
*>* Spotify.
*> >* whenever the application volume is changed. At the same time they are shown
*>* I can hear cracklings. So it seems related. I noticed that forcing pulsesrc
*>* to use lower latencies help but do not fix the problem. Changing volumes
*>* with pulsesrc latency-time parameter set to 1000 us produces less noises
*>* than when it is set to 10000 us.
*> >* I tried my best to see if there is anything I can do on my side to remove
*>* this noise I found nothing. Is that how things are or is there anything
*>* that can be done to remove this noises?
*
This is how things are. It would be great if someone would have a hard
look at the monitor source rewinding code and see what goes wrong
there.
Ok. Thank you for your answer Tanuk. For some reason it never got to my
email. I only noticed it because I have just opened the mailing list.
Strange.

Although a little annoying in my opinion this is not the end of the world.
The null sink reconfigure feature will be much more useful.

Best regards,

Wellington
--
Prof.° Wellington Wallace Miguel Melo

CEFET/RJ Uned Nova Iguaçu
Loading...