From: Takashi Iwai <tiwai@suse.de>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC PATCH] docs: sound: kernel-api: writing-an-alsa-driver.rst: add FIXMEs
Date: Thu, 06 Apr 2023 08:42:27 +0200 [thread overview]
Message-ID: <87sfddv7e4.wl-tiwai@suse.de> (raw)
In-Reply-To: <20230405201220.2197878-1-oswald.buddenhagen@gmx.de>
On Wed, 05 Apr 2023 22:12:20 +0200,
Oswald Buddenhagen wrote:
>
> @@ -1646,11 +1647,11 @@ Typically, you'll have a hardware descriptor as below::
>
> The “period” is a term that corresponds to a fragment in the OSS
> world. The period defines the point at which a PCM interrupt is
> generated. This point strongly depends on the hardware. Generally,
> a smaller period size will give you more interrupts, that is,
> - more controls. In the case of capture, this size defines the input
> + more controls (FIXME: huh? granularity, maybe?). In the case of capture, this size defines the input
Well, "controls" might be no good choice of the word, it was meant as
"the opportunities returned from kernel back to user-space for sending
/ receiving the defined size of data". This isn't really granularity,
strictly speaking, but it may be a better fit.
> DMA Buffer Information
> ~~~~~~~~~~~~~~~~~~~~~~
>
> +// FIXME: this is outdated; dma_private is available only through dma_buffer_p!
It's written so:
``dma_private`` is used for the ALSA DMA allocator.
And, this field can be used still freely if you implement the full
stack in the driver by itself instead of using the standard helpers.
> @@ -1709,10 +1711,11 @@ Running Status
> The running status can be referred via ``runtime->status``. This is
> a pointer to a struct snd_pcm_mmap_status record.
> For example, you can get the current
> DMA hardware pointer via ``runtime->status->hw_ptr``.
>
> +// FIXME: DMA application pointer is not explained.
A better description please ;)
> @@ -2010,10 +2013,12 @@ is called by the interrupt routine. Then the PCM middle layer updates
> the position and calculates the available space, and wakes up the
> sleeping poll threads, etc.
>
> This callback is also atomic by default.
>
> +FIXME: this does not specifiy whether this is the pre- or post-fifo position.
> +
Again, a patch to add more description please.
> @@ -2384,10 +2389,14 @@ fields.
>
> The ``name`` is the name identifier string. Since ALSA 0.9.x, the
> control name is very important, because its role is classified from
> its name. There are pre-defined standard control names. The details
> are described in the `Control Names`_ subsection.
> +// This is a questionable design, IMO. Why user-space heuristics when
> +// the driver could set the roles/capabilities? This would avoid
> +// problems like the Tone Control sliders (unlike the switch?!) being
> +// misclassified as applying also to capture.
Why this has to be discussed here and now...?
It's the thing that was *defined* over two decades ago.
> The ``index`` field holds the index number of this control. If there
> are several different controls with the same name, they can be
> distinguished by the index number. This is the case when several
> codecs exist on the card. If the index is zero, you can omit the
> @@ -2485,10 +2494,11 @@ a control constantly.
> When the control may be updated, but currently has no effect on anything,
> setting the ``INACTIVE`` flag may be appropriate. For example, PCM
> controls should be inactive while no PCM device is open.
>
> There are ``LOCK`` and ``OWNER`` flags to change the write permissions.
> +// FIXME: explain.
A patch please.
> Control Callbacks
> -----------------
>
> info callback
> @@ -3355,10 +3365,11 @@ Buffer and Memory Management
> ============================
>
> Buffer Types
> ------------
>
> +// FIXME: this appears obsolete, i only found one pair of functions.
Yes, snd_malloc_pages() and snd_free_pages() have been replaced with
the managed buffer.
> @@ -3670,10 +3681,11 @@ user (root by default), do as follows::
> entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
>
> and set the write buffer size and the callback::
>
> entry->c.text.write = my_proc_write;
> + // FIXME: something's missing here?
No, that's fine. Rather the line above it (mentioning the write
buffer size) is outdated; there is no size to be specified.
thanks,
Takashi
next prev parent reply other threads:[~2023-04-06 6:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 20:12 [RFC PATCH] docs: sound: kernel-api: writing-an-alsa-driver.rst: add FIXMEs Oswald Buddenhagen
2023-04-06 6:42 ` Takashi Iwai [this message]
2023-04-20 12:47 ` Oswald Buddenhagen
2023-04-20 12:54 ` Takashi Iwai
2023-04-20 13:44 ` Oswald Buddenhagen
2023-04-20 14:27 ` Takashi Iwai
2023-04-20 16:18 ` Oswald Buddenhagen
2023-04-21 8:55 ` Takashi Iwai
2023-04-21 9:11 ` Oswald Buddenhagen
2023-04-21 9:14 ` Jaroslav Kysela
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=87sfddv7e4.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=oswald.buddenhagen@gmx.de \
/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.