* Miscellaneous ioplug questions
@ 2018-08-09 18:45 Rob Duncan
2018-08-10 5:21 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Rob Duncan @ 2018-08-09 18:45 UTC (permalink / raw)
To: 'alsa-devel@alsa-project.org'
I have some questions about some ioplug implementation details:
- Is the value returned from the pointer callback supposed to be a
monotonically increasing value, or should it wrap at the buffer size?
The documentation says "get the current DMA position" which isn't
clear to me.
- Must the pointer callback return values that are an integral multiple
of the period size, or can it report partial periods?
- Should the poll FD be made writeable as soon as data is available, or
only when at least avail_min is available?
Thanks,
Rob.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Miscellaneous ioplug questions
2018-08-09 18:45 Miscellaneous ioplug questions Rob Duncan
@ 2018-08-10 5:21 ` Takashi Iwai
2018-08-14 16:25 ` Rob Duncan
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2018-08-10 5:21 UTC (permalink / raw)
To: Rob Duncan; +Cc: 'alsa-devel@alsa-project.org'
On Thu, 09 Aug 2018 20:45:51 +0200,
Rob Duncan wrote:
>
> I have some questions about some ioplug implementation details:
>
> - Is the value returned from the pointer callback supposed to be a
> monotonically increasing value, or should it wrap at the buffer size?
> The documentation says "get the current DMA position" which isn't
> clear to me.
>
> - Must the pointer callback return values that are an integral multiple
> of the period size, or can it report partial periods?
The ioplug basically emulates the hardware driver behavior, and
basically the pointer callback may return any position.
Hence the answers to the questions above are: yes, it may wrap buffer
size and yes, it may report partial periods.
> - Should the poll FD be made writeable as soon as data is available, or
> only when at least avail_min is available?
The latter. Again, ioplug emulates the hardware driver, so the poll
should behave same as the hardware driver does.
(Though, admittedly, not all plugin implementations follow this
strictly....)
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Miscellaneous ioplug questions
2018-08-10 5:21 ` Takashi Iwai
@ 2018-08-14 16:25 ` Rob Duncan
2018-08-15 9:47 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Rob Duncan @ 2018-08-14 16:25 UTC (permalink / raw)
To: Takashi Iwai; +Cc: 'alsa-devel@alsa-project.org'
Hi Takashi,
>> - Should the poll FD be made writeable as soon as data is available, or
>> only when at least avail_min is available?
>
> The latter. Again, ioplug emulates the hardware driver, so the poll
> should behave same as the hardware driver does.
> (Though, admittedly, not all plugin implementations follow this
> strictly....)
So, the poll FD must be readable while there is at least avail_min in
the buffer, and must NOT be readable if there is less than avail_min.
Is that right?
To labor the point a bit, if exactly avail_min becomes available the
poll FD must be made readable. If a single frame is now transferred, so
the buffer has (avail_min - 1) available, what must the state of the
poll FD be?
A couple more questions:
If we are configured to do blocking operations must the read and write
callbacks always transfer the full requested size, or can they do
partial transfers?
On the other hand, what if we are configured to do non-blocking
operations?
Or does the caller guarantee not to request a transfer larger than what
the ioplugin reports as available?
Thanks,
Rob.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Miscellaneous ioplug questions
2018-08-14 16:25 ` Rob Duncan
@ 2018-08-15 9:47 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-08-15 9:47 UTC (permalink / raw)
To: Rob Duncan; +Cc: 'alsa-devel@alsa-project.org'
On Tue, 14 Aug 2018 18:25:15 +0200,
Rob Duncan wrote:
>
> Hi Takashi,
>
> >> - Should the poll FD be made writeable as soon as data is available, or
> >> only when at least avail_min is available?
> >
> > The latter. Again, ioplug emulates the hardware driver, so the poll
> > should behave same as the hardware driver does.
> > (Though, admittedly, not all plugin implementations follow this
> > strictly....)
>
> So, the poll FD must be readable while there is at least avail_min in
> the buffer, and must NOT be readable if there is less than avail_min.
> Is that right?
Yes.
> To labor the point a bit, if exactly avail_min becomes available the
> poll FD must be made readable. If a single frame is now transferred, so
> the buffer has (avail_min - 1) available, what must the state of the
> poll FD be?
The driver sipmly doesn't set POLLIN|POLLRDNORM bits (or
POLLOUT|POLLWRNORM) unless avail >= avail_min.
> A couple more questions:
>
> If we are configured to do blocking operations must the read and write
> callbacks always transfer the full requested size, or can they do
> partial transfers?
In general, a partial transfer is always allowed no matter whether
blocking or non-blocking mode is.
Takashi
> On the other hand, what if we are configured to do non-blocking
> operations?
>
> Or does the caller guarantee not to request a transfer larger than what
> the ioplugin reports as available?
>
> Thanks,
>
> Rob.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-15 9:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-09 18:45 Miscellaneous ioplug questions Rob Duncan
2018-08-10 5:21 ` Takashi Iwai
2018-08-14 16:25 ` Rob Duncan
2018-08-15 9:47 ` Takashi Iwai
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.