Re: SNDRV_PCM_TRIGGER_STOP and audio still queued in the driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Wed, 19 Aug 2009 11:02:31 -0400,Jon Smirl wrote:> > On Wed, Aug 19, 2009 at 8:14 AM, Takashi Iwai<tiwai@xxxxxxx> wrote:> > At Sat, 15 Aug 2009 23:40:36 -0400,> > Jon Smirl wrote:> >>> >> On Sat, Aug 15, 2009 at 11:53 AM, Jon Smirl<jonsmirl@xxxxxxxxx> wrote:> >> > void> >> > bfio_synch_stop(void)> >> > {> >> >    int n;> >> >> >> >    if (base_handle == NULL) {> >> >        return;> >> >    }> >> >    FOR_IN_AND_OUT {> >> >        for (n = 0; n < n_handles[IO]; n++) {> >>> >> I added:> >> snd_pcm_nonblock(handles[IO][n], 0)> >> snd_pcm_drain(handles[IO][n])> >> snd_pcm_nonblock(handles[IO][n], SND_PCM_NONBLOCK )> >>> >> >            snd_pcm_close(handles[IO][n]);> >> >        }> >> >    }> >> > }> >>> >> This is not working correctly.> >> snd_pcm_nonblock(handles[IO][n], 0)> >> It does not remove O_NONBLOCK for some unknown reason.> >>> >> I added printf() to snd_pcm_hw_nonblock()> >> The fcntl is not getting an error.> >>       if (fcntl(fd, F_SETFL, flags) < 0) {> >> Flags being set are 2 (O_RDWR).> >>> >> But when I get over to snd_pcm_pre_drain_init(), I get the -EAGAIN error.> >> static int snd_pcm_pre_drain_init(struct snd_pcm_substream *substream,> >> int state)> >> {> >>       printk("snd_pcm_pre_drain_init\n");> >>       if (substream->f_flags & O_NONBLOCK)> >>               return -EAGAIN;> >>       printk("snd_pcm_pre_drain_init 1\n");> >>       substream->runtime->trigger_master = substream;> >>       return 0;> >> }> >> So I have to conclude that fcntl(fd, F_SETFL, flags) is not removing> >> the O_NONBLOCK flag.> >> > Yeah, you found a long-standing bug :)> >> > Honestly, I think the current designed behavior is just annoying.> > An ioctl may be blocked, thus there is no real merit to return -EAGAIN> > with DRAIN ioctl.> > Brutefir is a server type app, so pulseaudio should be having trouble> with this too.
Maybe not.  Otherwise we've got already many bug reports.
The difference is how to wait until all data is out.  PA would likelywait using its own timer stuff without sleeping in drain ioctl.

Takashi_______________________________________________Alsa-devel mailing listAlsa-devel@xxxxxxxxxxxxxxxxxxxx://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux