[pulseaudio-discuss] RTP makes high tone pitch

Georg Chini georg at chini.tk
Sun Mar 26 19:22:17 UTC 2023


Hi Lars,

14.2 is pretty old, current version is 16.1 and we are shortly before 
releasing 17.0.
So if possible, I would recommend to update to a newer version, at least 
if your
problems return.

Concerning documentation - you are right, the module page has not been 
updated
for quite some time and unfortunately there is no newer documentation. 
You can
use "pacmd describe-module <module-name>" to get a list and a short 
description
of supported module arguments. The arguments mentioned on the module page
should still all work, we try not to break existing configurations, but 
meanwhile
there may be quite a few new arguments that have been added over time.

If you set the log level to 4 you should see quite a bit of output, for 
example
module-loopback should tell you every adjust_time seconds the current 
source,
sink and buffer latency. Also module-rtp-recv and module-loopback should 
both
log the current sample rate they are using. If you did not see any of 
that, something
was wrong with the logging. In 14.2, the log_interval parameter to 
module-loopback
should not be necessary.

Regards
        Georg

On 26.03.23 19:43, Lars Stollenwerk wrote:
> Hi Georg,
>
> thank you for your detailed answer! Especially the hint regarding the number
> of samples in the latency buffer was very enlightening.
>
> Now at the weekend I had time to test your suggestions. I'm using
> pulseaudio version 14.2 as part of the current raspberry pi os. The parameter
> log_interval to the module-loopback seems not to be supported; the
> corresponding call of 'pactl load-module ...' returns with non-zero return
> code. Setting log-level to 4 did not produce any relevant log lines.
>
> Nevertheless, I increased the latency step by step to 70 ms for the
> module-loopback with max_latency_msec of 100. For module-rtp-recv I set the
> latency to 100 ms. Now we are testing the intercom with these parameters.
> Right now, it works since several hours without helium-voice. I am
> optimistic...
>
> By the way, the documentation of the modules at [1] seems not to contain all
> module parameters (e. g. log_interval is not mentioned). Furthermore, it is
> not clear to me which version the documentation belongs to. Is there another
> resource with the full documentation of a given version?
>
> Many thanks and best regards
> Lars
>
> [1] https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/
>
>> Hi,
>>
>> you say below, that a few hundred milliseconds would be an acceptable
>> latency.
>> Why then do you set the values so low? Setting the loopback latency to
>> 1ms and
>> max_latency to 10ms is not a good idea and will probably not work as
>> expected.
>> The latency you specify for the loopback includes source and sink latency
>> (= source latency + sink latency + loopback buffer latency), so a
>> reasonable value
>> for you would be around 50 ms or larger when you are using an USB device.
>> The max_latency parameter is only intended to be used when the latency grows
>> too much and should not be specified unless the latency increases
>> significantly
>> over time.
>>
>> Something similar applies to module-rtp-recv. Specifying a latency of 1ms at
>> 8000 Hz means that you have just 8 audio frames of latency. So here I would
>> go for something like 100ms.
>>
>> Both, module-loopback and module-rtp-recv try to adjust to the requested
>> latency by changing the sample rate. This is probably what you hear. In
>> particular, while module-loopback stops when the sample rate is more than
>> 1% away from the base rate, there is no such limit for module-rtp-recv.
>>
>> To debug the situation I would run PA with debug logging and also add
>> the log-interval=1 parameter to module-loopback. This produces quite a
>> lot of output, but then you should be able to see what happens and can
>> adjust your parameters for optimum performance. To enable debug logging
>> and to send the output to a file you can use
>>
>> pacmd set-log-level 4
>> pacmd set-log-target file://tmp/pulse.log
>>
>> The log settings will revert to the default values when PA is restarted.
>> Hope this helps.
>>
>> Regards
>>         Georg
>>
>> On 19.03.23 16:14, Lars Stollenwerk wrote:
>>> Hi all,
>>>
>>> I am using PulseAudio to implement a kind of intercom: In our ham radio club
>>> house we want to install in every room a raspberry pi with PulseAudio running;
>>> this is what I call a 'client'. Each client is connecet to a microphone and a
>>> speaker using a USB sound card. To send and receive the audio signal over
>>> network, on each client a set of PulseAudio modules is started using 'pactl
>>> load-module ...'. The follwing modules are started:
>>>
>>> Sending path
>>> ------------
>>> Signal path: mic-source -> loopback -> null-sink -> rtp-send
>>>
>>> module-null-sink
>>>       sink_name=rtp-tx-sink
>>>       rate=8000
>>>       channels=1
>>> module-loopback
>>>       source=<mic-source>
>>>       sink=rtp-tx-sink
>>>       latency_msec=1
>>>       max_latency_msec=10
>>>       fast_adjust_threshold_msec=100
>>>       adjust_time=1
>>>       rate=8000
>>>       channels=1
>>> module-rtp-send
>>>       rate=8000
>>>       channels=1
>>>       loop=false
>>>       source=rtp-tx-sink.monitor
>>>       destination=224.0.0.47
>>>
>>> Receiving path
>>> --------------
>>> Signal path: rtp-recv -> null-sink -> loopback -> speaker-sink
>>>
>>> module-null-sink
>>>       sink_name=rtp-rx-sink
>>>       rate=8000
>>>       channels=1
>>> module-loopback
>>>       source=rtp-rx-sink.monitor
>>>       sink=<speaker-sink>
>>>       latency_msec=1
>>>       max_latency_msec=10
>>>       fast_adjust_threshold_msec=100
>>>       adjust_time=1
>>>       rate=8000
>>>       channels=1
>>> module-rtp-recv
>>>       latency_msec=1
>>>       sink=rtp-rx-sink
>>>       sap_address=224.0.0.47
>>>
>>> The null-sinks are used to mute the stream when necessary.
>>>
>>> Generally, the set-up works. However, often the pitch of the voice is much too
>>> high. I. e., the voice can be well understood but sounds more or less like a
>>> Helium voice.
>>>
>>> The values for latency are all chosen to be very small. The reason is that we
>>> can accept short drop-outs, but not a big latency (few 100 ms is the maxium
>>> acceptable).  I have tryed to increase max_latency_msec of the loopback
>>> devices to 60 ms - without success.
>>>
>>> My question to the community is: Does anyone know where the high pitch voice
>>> comes from? And how to avoid this?
>>>
>>> I am thankful for any help!
>>>
>>> Best ragards
>>> Lars
>>> --
>>>          /   ePistulae: formica at Opppf.de
>>>     O-O-@
>>>     / | \    PGP Key  : 0x6E5651C4
>>>    FORMICA   Homepage : http://www.Opppf.de/




More information about the pulseaudio-discuss mailing list