'Twas brillig, and Lin, Mengdong at 30/05/11 16:03 did gyre and gimble:
> So my question is why there is the **unnessary** resampling step for the
> sink input stream after profile switch from A2DP to HSP? The resampling
> is only necessary for A2DP sink (from 8000HZ to 44100HZ) but shall be
> unnecessary for a “sco” sink. Does the pulseaudio still have some memory
> of previous A2DP sample spec and do a harmful resampling?
It looks like it. Perhaps we need to reset the resamplers on a stream
move... I seem to recall something about that... hold on... Hmm, can't
find any reference to this... I seem to recall that there was a patch
concerting this issue but I can't seem to find it.
I guess when moving a stream, we need to recalculate the resampler to
use. It could be that this is just shown for info as in (this is the
reampler we would use if we needed any resampling) and thus it's
harmless, but the fact you cannot hear audio would suggest there is
*something* fishy going on in there.
I will need to dig into the code to have a look at this, but on a quick
glance, I think the name of the resample method is left behind after the
move, even if a resampler is not being used, but the actual resampler is
indeed freed and reset.
This patch might fix this reporting issue (a similar patch would be
needed for source-outputs too).
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index f4f3258..b8c2db3 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1663,6 +1663,7 @@ int pa_sink_input_finish_move(pa_sink_input *i,
pa_sink *dest, pa_bool_t save) {
0,
&i->sink->silence);
}
+ i->actual_resample_method = new_resampler ?
pa_resampler_get_method(new_resampler) : PA_RESAMPLER_INVALID;
pa_sink_update_status(dest);
update_volume_due_to_moving(i, dest);
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss