[alsa-devel] [PATCH - IOPLUG DRAIN 0/2]

Takashi Iwai tiwai at suse.de
Thu Mar 22 17:22:49 CET 2018


On Thu, 22 Mar 2018 16:17:10 +0100,
Wischer, Timo (ADITG/ESB) wrote:
> 
> > I don't understand.  The pulse plugin calls pa_stream_drain(), and
> > pulse_wait_operation() to wait until the drain finishes.  What does it
> > have to do with threading?
> 
> As far as I understand you patch io->data->callback->drain() will not be called in nonblocking mode.
> +       if (io->data->state == SND_PCM_STATE_DRAINING) {
> +               if (io->data->nonblock)
> +                       return -EAGAIN;
> +
> +               if (io->data->callback->drain) {
> +                       err = io->data->callback->drain(io->data);
> +                       if (err < 0)
> +                               return err;
> +               }
> +       }
> 
> Therefore how should call pa_stream_drain() in case of nonblocking mode?

The application needs to sync manually via poll() instead.
It's also the behavior of the kernel driver, which ioplug follows.


Takashi


More information about the Alsa-devel mailing list