[pulseaudio-tickets] [PulseAudio] #839: Sink wrongly unloaded or not reloaded
PulseAudio
trac-noreply at tango.0pointer.de
Sat Jul 10 23:03:25 PDT 2010
#839: Sink wrongly unloaded or not reloaded
------------------------+---------------------------------------------------
Reporter: mcarans | Owner: lennart
Type: defect | Status: closed
Milestone: | Component: module-alsa-*
Resolution: elsewhere | Keywords:
------------------------+---------------------------------------------------
Comment(by tanuk):
Replying to [comment:5 mcarans]:
> Is there a proper way to implement the hack:
pa_sink_set_max_rewind(u->sink, 0)?
pa_sink_set_max_rewind(u->sink, 0) should be called only if we know that
the device doesn't support rewinding. I'm not aware of a way to discover
that.
Since you seem to be happy with recompiling pulseaudio and trying stuff,
what if you replace this section in process_rewind() in src/modules/alsa
/alsa-sink.c
{{{
if ((out_frames = snd_pcm_rewind(u->pcm_handle,
(snd_pcm_uframes_t) in_frames)) < 0) {
pa_log("snd_pcm_rewind() failed: %s", pa_alsa_strerror((int)
out_frames));
if (try_recover(u, "process_rewind", out_frames) < 0)
return -1;
out_frames = 0;
}
}}}
with this code
{{{
if ((in_frames = PA_MIN(in_frames,
snd_pcm_rewindable(u->pcm_handle))) < 0) {
pa_log("snd_pcm_rewindable() failed: %s",
pa_alsa_strerror((int) in_frames));
if (try_recover(u, "process_rewind", in_frames) < 0)
return -1;
out_frames = 0;
} else ((out_frames = snd_pcm_rewind(u->pcm_handle,
(snd_pcm_uframes_t) in_frames)) < 0) {
pa_log("snd_pcm_rewind() failed: %s", pa_alsa_strerror((int)
out_frames));
if (try_recover(u, "process_rewind", out_frames) < 0)
return -1;
out_frames = 0;
}
}}}
That is, before calling snd_pcm_rewind(), limit in_frames to be at most
whatever snd_pcm_rewindable() returns.
--
Ticket URL: <http://pulseaudio.org/ticket/839#comment:6>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list