Re: [pulseaudio-discuss] problem with webrtc and pulseaudio

2017-02-19 Thread Fatima Castiglione Maldonado 发
>Ok, that suggests that the problem is not with chrome specifically. But >in your first mail you said that firefox works fine... Firefox works ok, have just tested it again to be sure. >If you record with parecord without having chrome running at the same >time, is the sound still bad? If it is,

[pulseaudio-discuss] [PATCH 21/21 v2] loopback: Add log_interval and log_interval_msec parameter

2017-02-19 Thread Georg Chini
Add a log_interval parameter to control the amount of logging. Default is no logging. Like for adjust_time, two parameters exist: log_interval specifies the interval in seconds while log_interval_msec is in ms. If the log interval is too small, logging will occur on every iteration. --- src/modul

[pulseaudio-discuss] [PATCH 19/21 v2] loopback: Add low_device_latency parameter

2017-02-19 Thread Georg Chini
For USB devices the latency jitter strongly depends on device latency. Therefore a boolean low_device_latency parameter is introduced to half the device latency. Normally 1/3 of the configured end-to-end latency is used, with the parameter this is changed to 1/6. In many situations the parameter ca

[pulseaudio-discuss] [PATCH 18/21 v2] loopback: Only use controller weight after target latency has been crossed twice

2017-02-19 Thread Georg Chini
The previous patch slows down initial convergence. Therefore do not use the controller weight until we can assume that we reached an equilibrium. Because it takes some time before the reported latency values are reliable, assume that a steady state is reached when the target latency has been crosse

[pulseaudio-discuss] [PATCH 13/21 v2] loopback: Limit controller step size to 2.01‰

2017-02-19 Thread Georg Chini
The current loopback controller can produce a rate jump of up to 1% at startup, which may be audible. To prevent large initial jumps, a second controller is introduced, which produces a rate, that is not more than 2‰ away from the last rate. Only during the startup phase, the rates produced by this

[pulseaudio-discuss] [PATCH 11/21 v2] loopback: Use new feature of pa_{source, sink}_get_latency_within_thread()

2017-02-19 Thread Georg Chini
Using the new feature of pa_{source,sink}_get_latency_within_thread() leads to improved end to end latency estimation and to correct handling of port latency offsets. --- src/modules/module-loopback.c | 105 -- 1 file changed, 81 insertions(+), 24 deletions

[pulseaudio-discuss] [PATCH 10/21 v2] source/sink: Don't let pa_{sink, source}_getLatency_within_thread() return -1 if process_msg() fails

2017-02-19 Thread Georg Chini
Returning -1 on error does not make sense for a function that may return negative values. Also no caller checks the return value anyway, so it looks like a better idea to just return the offset when the message processing fails. --- src/pulsecore/sink.c | 3 +-- src/pulsecore/source.c | 3 +--

[pulseaudio-discuss] [PATCH 17/21 v2] loopback: Add adjust_threshold_usec parameter

2017-02-19 Thread Georg Chini
In most situations, the P-controller is too sensitive and therefore exhibits rate hunting. To avoid rate hunting, the sensibility of the controller is set by the new parameter adjust_threshold_usec. The parameter value is the deviation from the target latency in usec which is needed to produce a

[pulseaudio-discuss] [PATCH 16/21 v2] loopback: Track prediction error; debug and cosmetic changes

2017-02-19 Thread Georg Chini
This patch is purely cosmetic. It changes debugging output to a be better readable and tracks the prediction error for debugging purpose only. The patch also adds Georg Chini to the authors of the module. --- src/modules/module-loopback.c | 34 +++--- 1 file changed,

[pulseaudio-discuss] [PATCH 15/21 v2] loopback: Add latency prediction and Kalman filter

2017-02-19 Thread Georg Chini
A Kalman filter is added to further reduce noise. The Kalman filter needs a latency prediction as input, so estimate the next expected latency as well. Again, theory is at https://www.freedesktop.org/software/pulseaudio/misc/rate_estimator.odt --- src/modules/module-loopback.c | 67 ++

[pulseaudio-discuss] [PATCH 14/21 v2] loopback: Optimize adaptive re-sampling

2017-02-19 Thread Georg Chini
The current code assumes that the time domains of source and sink are equal. This leads to a saw-tooth characteristics of the resulting end to end latency. This patch adds an iterative calculation of an optimum rate which accounts for the difference between the source and sink time domains, thereby

[pulseaudio-discuss] [PATCH 02/21 v2] loopback: Initialize latency at startup and during source/sink changes

2017-02-19 Thread Georg Chini
The current code does not make any attempt to initialize the end-to-end latency to a value near the desired latency. This leads to underruns at startup because the memblockq is initially empty and to very long adjustment times for long latencies because the end-to-end latency at startup is signific

[pulseaudio-discuss] [PATCH 12/21 v2] loopback: Track and use average adjust time

2017-02-19 Thread Georg Chini
The configured adjust time does not match exactly the real adjust time. Also the adjust time varies. To improve latency estimation use an average of the measured adjust times instead of the configured value in all calculations. --- src/modules/module-loopback.c | 36 ++

[pulseaudio-discuss] [PATCH 04/21 v2] loopback: Calculate and track minimum possible latency

2017-02-19 Thread Georg Chini
Calculate minimum possible latency for the current combination of source and sink. The actual calculation has been put in a separate function so it can easily be changed. To keep the values up to date, changes in the latency ranges have to be tracked. Use the calculated minimum latency to limit th

[pulseaudio-discuss] [PATCH 05/21 v2] loopback: Add hooks to track port latency offsets

2017-02-19 Thread Georg Chini
The previous patch assumed constant port latency offsets. The offsets can however be changed by the user, therefore these changes need to be tracked as well. This patch adds the necessary hooks. --- src/modules/module-loopback.c | 38 -- src/pulsecore/core.h

[pulseaudio-discuss] [PATCH 06/21 v2] loopback: Reset sink input rate when source or sink changes

2017-02-19 Thread Georg Chini
If source or sink are changed, the current sink input rate may be different from the default rate. Switch sink input rate back to default to avoid the influence of the previous combination of source and sink. --- src/modules/module-loopback.c | 18 +++--- 1 file changed, 15 insertions

[pulseaudio-discuss] [PATCH 08/21 v2] sample.c: Allow module-loopback to exceed PA_RATE_MAX

2017-02-19 Thread Georg Chini
The rate set by module loopback may exceed PA_RATE_MAX by 1%, therefore allow rates higher than PA_RATE_MAX in pa_sample_rate_valid(). --- src/pulse/sample.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pulse/sample.c b/src/pulse/sample.c index cb04254..ff77985 1006

[pulseaudio-discuss] [PATCH 20/21 v2] loopback: Add adjust_time_msec parameter to allow adjust times below 1s

2017-02-19 Thread Georg Chini
A new parameter is introduced to allow specifying smaller adjust_time values than 1s. This may be useful for a better latency control, although with alsa devices and the current smoother code no improvement could be found. This patch also changes the default adjust time to 1s, the old value of 10s

[pulseaudio-discuss] [PATCH 07/21 v2] loopback: Implement underrun protection

2017-02-19 Thread Georg Chini
The latency controller will try to adjust to the configured latency regardless of underruns. If the configured latency is set too small, it will lead to periodically occuring underruns. Therefore an underrun protection is implemented which will increase the target latency if too many underruns are

[pulseaudio-discuss] [PATCH 00/21 v2] Optimize latency handling in module-loopback

2017-02-19 Thread Georg Chini
This is version 2 of the new loopback patch series. It includes many fixes based on Tanu's review as well as two new features. The main changes compared to the original loopback module are: - Reduce latency jitter by a factor 100 from around 30 ms to 300 usec - Implement modified P-controller and

[pulseaudio-discuss] [PATCH 09/21 v2] source/sink: Allow pa_{source, sink}_get_latency_within_thread() to return negative values

2017-02-19 Thread Georg Chini
The reported latency of source or sink is based on measured initial conditions. If the conditions contain an error, the estimated latency values may become negative. This does not indicate that the latency is indeed negative but can be considered merely an offset error. The current get_latency_in_

[pulseaudio-discuss] [PATCH 03/21 v2] loopback: Do not skip audio at startup

2017-02-19 Thread Georg Chini
The code is now waiting for source and sink to start up, so the skip logic is not necessary anymore. --- src/modules/module-loopback.c | 38 ++ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/src/modules/module-loopback.c b/src/modules/module-loo

[pulseaudio-discuss] [PATCH 01/21 v2] loopback: correct comments about the thread calling a function

2017-02-19 Thread Georg Chini
The comments were wrong and confusing. --- src/modules/module-loopback.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c index 016d403..2907bbc 100644 --- a/src/modules/module-loopback.c +++ b/src/modules

Re: [pulseaudio-discuss] [PATCH] Added fixed port 5004 option for rtp sender

2017-02-19 Thread Tanu Kaskinen
On Sat, 2017-02-11 at 11:55 +0100, archli...@nicohood.de wrote: > From: NicoHood > > --- > src/paprefs.cc| 23 --- > src/paprefs.glade | 56 > ++- > 2 files changed, 67 insertions(+), 12 deletions(-) Thanks! Applied.

[pulseaudio-discuss] [PATCH paprefs] build-sys: don't reference README when lynx is disabled

2017-02-19 Thread Tanu Kaskinen
lynx is required for generating README, so building failed when lynx was disabled. --- Makefile.am | 11 --- doc/Makefile.am | 9 ++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 30b014c..6f14ab6 100644 --- a/Makefile.am +++ b/M

Re: [pulseaudio-discuss] [PATCH] module-coreaudio-device: fix improper memory handling leading to crashes.

2017-02-19 Thread Tanu Kaskinen
On Sun, 2017-02-12 at 05:39 +0100, Mihai Moldovan wrote: > Make sure that we NULL pointers after freeing them. Otherwise bad things > happen. > > Signed-off-by: Mihai Moldovan > --- > src/modules/macosx/module-coreaudio-device.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Ca

Re: [pulseaudio-discuss] problem with webrtc and pulseaudio

2017-02-19 Thread Tanu Kaskinen
On Thu, 2017-02-16 at 21:26 -0300, Fatima Castiglione Maldonado 发 wrote: > > To narrow down the problem further, you could try recording from the > > microphone at the same time when chrome is supposed to be recording > > from it. You can use this command: > > parecord --device=alsa_input.pci-_