[MPlayer-users] problem with mms stream - [AO_ALSA] Trying to reset soundcard

Raymond Yau superquad.vortex2 at gmail.com
Tue Feb 1 04:42:11 CET 2011


Приветствую, Reimar
> On Sun, Jan 24, 2010 at 02:36:50PM +0300, Goga777 wrote:
> > [AO_ALSA] Write error: Broken pipe4428928.0 (-24.-8) 96.4% 6%
> > [AO_ALSA] Trying to reset soundcard.
> > Increasing filtered audio buffer size from 65536 to 675361% 9%
> > Increasing filtered audio buffer size from 67536 to 675442% 12%
> > [AO_ALSA] Write error: Broken pipe4428928.0 (-24.-8) 24.0% 6%
> > [AO_ALSA] Trying to reset soundcard.
>
> I am not sure this is the same issue, but I had this part as well.
> Solutions:
> 1) use -ao pulse

    res = snd_pcm_writei(alsa_handler, data, num_frames);

      if (res == -EINTR) {
	/* nothing to do */
	res = 0;
      }
      else if (res == -ESTRPIPE) {	/* suspend */
	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume);
	while ((res = snd_pcm_resume(alsa_handler)) == -EAGAIN)
	  sleep(1);
      }
      if (res < 0) {
	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_WriteError, snd_strerror(res));
	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_TryingToResetSoundcard);
	if ((res = snd_pcm_prepare(alsa_handler)) < 0) {
	  mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(res));
	  return 0;
	  break;
	}
      }



This look like related to snd_pcm_prepare() of "pulse" plugin when
"Broken pipe" is returned by "pulse" plugin

pulse_prepare() disconnect from PA server by pa_stream_disconnect()

but why mplayer increasing filtered audio buffer size from 64Kbytes twice

> > Increasing filtered audio buffer size from 65536 to 675361% 9%
> > Increasing filtered audio buffer size from 67536 to 675442% 12%


http://git.alsa-project.org/?p=alsa-plugins.git;a=blob_plain;f=pulse/pcm_pulse.c


static int pulse_prepare(snd_pcm_ioplug_t * io)
{

....

	pa_threaded_mainloop_lock(pcm->p->mainloop);

	if (pcm->stream) {
		pa_stream_disconnect(pcm->stream);
		wait_stream_state(pcm, PA_STREAM_TERMINATED);
		pa_stream_unref(pcm->stream);
		pcm->stream = NULL;
	}

	err = pulse_check_connection(pcm->p);
	if (err < 0)
		goto finish;


More information about the MPlayer-users mailing list