From: Takashi Iwai <tiwai@suse.de>
To: "Wischer, Timo (ADITG/ESB)" <twischer@de.adit-jv.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH - IOPLUG DRAIN 0/2]
Date: Fri, 23 Mar 2018 08:28:35 +0100 [thread overview]
Message-ID: <s5h370rb68s.wl-tiwai@suse.de> (raw)
In-Reply-To: <B0FB33DC1499054591F62C0EF1E013D7684FE430@HI2EXCH01.adit-jv.com>
On Fri, 23 Mar 2018 08:23:56 +0100,
Wischer, Timo (ADITG/ESB) wrote:
>
> > The application needs to sync manually via poll() instead.
>
> You mean the user application which opens the ALSA virtual device (aka IO plugin), right?
No, no matter which device is used.
> > It's also the behavior of the kernel driver, which ioplug follows.
>
> I know that your suggested solution is the behavior of the kernel.
> But in kernel space we have the DMA interrupt which checks the state for draining.
>
> To use the same mechanism in the IO plug each IO plug needs to have its own thread which checks state for draining.
> In case of pulse without this additional thread I have no idea how pulseaudio can be informed that draining starts
> because in nonblocking mode there is no function in the pulse IO plugin which is called to inform about the state change to draining.
In non-blocking mode, drain is never called.
> The only solution which I have in my mind is this additional thread
> state_check_thread()
> {
> while (true) {
> if (state == DRAINING)
> pa_stream_drain()
> ...
> }
> }
>
> Therefore with your proposed solution there is additional effort in each new IO plug required to support draining in nonblocking mode. (With my solution exactly the same mechanism (drain callback and poll) is used in blocking and nonblocking mode. Therefore new IO plugins will support both modes without additional efforts in the IO plugin implementation)
No, again, in non-blocking mode, the drain callback will get never
called. It's the responsibility of application to sync with poll()
instead.
Takashi
next prev parent reply other threads:[~2018-03-23 7:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 13:48 [PATCH - IOPLUG DRAIN 0/2] twischer
2018-03-22 13:48 ` [PATCH - IOPLUG DRAIN 1/1] ioplug: drain: Wait with pollwhen EAGAIN in blocking mode twischer
2018-03-22 13:48 ` [PATCH - IOPLUG DRAIN 1/1] jack: Support snd_pcm_drain() twischer
2018-03-22 14:28 ` [PATCH - IOPLUG DRAIN 0/2] Takashi Iwai
2018-03-22 14:50 ` Wischer, Timo (ADITG/ESB)
2018-03-22 14:55 ` Takashi Iwai
2018-03-22 15:17 ` Wischer, Timo (ADITG/ESB)
2018-03-22 16:22 ` Takashi Iwai
2018-03-23 7:23 ` Wischer, Timo (ADITG/ESB)
2018-03-23 7:28 ` Takashi Iwai [this message]
2018-03-23 7:43 ` Wischer, Timo (ADITG/ESB)
2018-03-23 8:01 ` Takashi Iwai
2018-03-23 8:08 ` Takashi Iwai
2018-03-23 9:03 ` Takashi Iwai
2018-03-28 8:42 ` Wischer, Timo (ADITG/ESB)
2018-03-28 16:09 ` Takashi Iwai
2018-03-29 6:39 ` Wischer, Timo (ADITG/ESB)
2018-03-29 7:25 ` Takashi Iwai
2018-03-29 7:38 ` Wischer, Timo (ADITG/ESB)
2018-03-23 8:21 ` Wischer, Timo (ADITG/ESB)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5h370rb68s.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=twischer@de.adit-jv.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.