[pulseaudio-discuss] gst pulsesrc and default caps
Alexey Fisher
bug-track at fisher-privat.net
Mon Aug 16 22:25:06 PDT 2010
Am Montag, den 16.08.2010, 21:00 -0500 schrieb pl bossart:
> > It looks like it working for me. Or "resample method: (null)" mean some
> > thing other?
> >
> >
> > 1 source outputs(s) available.
> > index: 0
> > driver: <protocol-native.c>
> > flags: START_CORKED FIX_FORMAT FIX_RATE FIX_CHANNELS
> > state: RUNNING
> > source: 2
> > <alsa_input.usb-046d_0991_9671DCEE-02-U0x46d0x991.analog-mono>
> > current latency: 0,00 ms
> > requested latency: 27,56 ms
> > sample spec: s16le 1ch 16000Hz
> > channel map: mono
> > Mono
> > resample method: (null)
>
> I tried on my set-up, and I have:
> source Output #1
> Driver: protocol-native.c
> Owner Module: 9
> Client: 4
> Source: 1
> Sample Specification: s16le 2ch 48000Hz
> Channel Map: front-left,front-right
>
> Which matches what I have in /usr/etc/pulse/daemon.conf and the
> following code in source-output.c
> if (data->flags & PA_SOURCE_OUTPUT_FIX_RATE)
> data->sample_spec.rate = data->source->sample_spec.rate;
>
> Basically when you use these flags, pulsesrc will get the same sample
> rate as your input, without any src in PulseAudio. But this may not be
> what you want, you may want a different rate than what your hardware
> provides. By using this flag you remove any flexibility. The rate
> should be defined with the pulsesrc caps, not with a hard-coded flag,
> some folks want an SRC in pulseaudio.
> -Pierre
It is not easy decision.
The target is to make Cheese work on my netbook with N280 at 1.66GHz. The
part of the problem is pulseaudio, it take about 10% of cpu on
recording.
Generally i want some reasonable rate for voice recording let say
44100Hz is a bit too match but this is default rate for my pulse server,
so there should be no performance hint. If we have webcam attached with
build in micro, we will probably get some reduced source, say 16000Hz.
So why should we do more if we get less.
Haw can i implement logic like:
if we get more than 44100Hz - downscale it.
Equal or less than 44100Hz - do not change it. Get less do less.
If i hardcode some samplerate to Cheese, it will solve the problem only
for one hardware setup, all other will make pulse beasy even by
resampling from 16000 to 44100.
If i use PA_SOURCE_OUTPUT_FIX_* flags, gstreamer will do the choice
should we re sample or not.
More information about the pulseaudio-discuss
mailing list