[pulseaudio-discuss] On-the-fly changing of sinks or sources in combine- and loopback-modules? Sound-distortions at the beginning of module-loopback?

Peter Kornatowski pkorn at gmx.net
Thu Feb 25 13:16:09 PST 2010


At 19:14 22.02.2010, pl bossart wrote:
> >> >> 2. I also have a problem with sound distortions (mostly much higher
> >> >> and "quicker" voice) several seconds after loading the
> >> >> loopback-module (source is a bluetooth-headset and sink is my
> >> >> soundcard). After some seconds the distortions disappear and
> >> >> everything is fine. I found out that reducing the adjust_time
> >> >> parameter of the loopback-module (I had to add adjust_time to
> >> >> valid_modargs in the source code) also reduces the duration of the
> >> >> distortions, but even at adjust_time=1 they remain for about 2
> >> >> seconds (and pulseaudio uses much more CPU). Setting it to 0 doesn't
> >> >> work at all.
> >> >
> >> >Sounds as if there is something wrong with the device speed. which
> >> >causes PA to compensate by resampling things.
> >>
> >> So would it be possible to fix this? Do you need more info/some logs?
> >
> > Uh. this is tricky to fix. Not sure I can tell you anything that could
> > fix this quickly for you. Somebody has to sit down with the hardware
> > and really figure out what is going on, this is not really feasible
> > remotely.
>
>It could be that the initial variations of sample rate are too high,
>and that causes audio issues with the resampling. This module
>estimates the input and output sample rates, and I have seen in some
>logs that the estimates can be somewhat off initially, e.g. 53kHz
>instead of 48kHz. Can you provide a log of sample rate estimates? This
>would help validate my theory.

I attached the log you asked for. My app loads 2 looback-modules (one 
from alsa_src to combiner_snk (combines 2 or 3 bluetooth-headsets), 
and one from a bt_src to alsa_snk). In the direction alsa->bt there 
are no distortions at all, but in the direction bt->alsa for the 
first 2, 3 or 4 seconds the voice is much higher and distorted and in 
about one second it adjusts itself to good quality. As I already 
said, lowering the adjust_time value also lowers the duration of the 
distortions, at a cost of higher CPU-usage. Maybe you also need the 
output of "pacmd list-source-outputs":
index: 2
         driver: <module-loopback.c>
         flags:
         state: RUNNING
         source: 1 <alsa_src>
         current latency: 0.00 ms
         requested latency: 33.33 ms
         sample spec: s16le 1ch 8000Hz
         channel map: mono
                      Mono
         resample method: speex-float-9
         owner module: 11
         properties:
                 media.name = "Loopback to Simultaneous output to 
PROPlantronics, PROPlantronics, PROPlantronics"
                 media.icon_name = "audio-card"
                 media.role = "abstract"
index: 3
         driver: <module-loopback.c>
         flags:
         state: RUNNING
         source: 5 <BT_src>
         current latency: 0.00 ms
         requested latency: 28.00 ms
         sample spec: s16le 1ch 8000Hz
         channel map: mono
                      Mono
         resample method: (null)
         owner module: 12
         properties:
                 media.name = "Loopback to C-Media USB Headphone Set  "
                 media.icon_name = "audio-card"
                 media.role = "abstract"

>Thanks
>- Pierre

Thanks,
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loopback_start.syslog
Type: application/octet-stream
Size: 19785 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100225/fa348aa6/attachment.obj>


More information about the pulseaudio-discuss mailing list