[alsa-devel] problem with mms stream - [AO_ALSA] Trying to reset soundcard

Raymond Yau superquad.vortex2 at gmail.com
Wed Feb 2 02:24:56 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.

      res = snd_pcm_writei(alsa_handler, data, num_frames);
...
      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;
	}
      }

The "pulse" plugin return -EPIPE "Broken pipe" at four conditions after
mplayer call snd_pcm_writei()

1) io->state == SND_PCM_STATE_XRUN
2) pcm->underrun
3) update_ptr(pcm) return err

mplayer call snd_pcm_prepare() to recover from "Broken Pipe".

but why mplayer increasing filtered audio buffer ?



static snd_pcm_sframes_t pulse_pointer(snd_pcm_ioplug_t * io)
{
...	
	if (io->state == SND_PCM_STATE_XRUN)
		return -EPIPE;



	if (pcm->underrun) {
		ret = -EPIPE;
		goto finish;
	}

	if (io->state != SND_PCM_STATE_RUNNING)
		return 0;

	pa_threaded_mainloop_lock(pcm->p->mainloop);

	ret = check_stream(pcm);
	if (ret < 0)
		goto finish;

	if (pcm->underrun) {
		ret = -EPIPE;
		goto finish;
	}

	ret = update_ptr(pcm);
	if (ret < 0) {
		ret = -EPIPE;
		goto finish;
	}

	if (pcm->underrun)
		ret = -EPIPE;
	else
		ret = snd_pcm_bytes_to_frames(io->pcm, pcm->ptr);

finish:


More information about the Alsa-devel mailing list