All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: David Henningsson <coding@diwic.se>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org
Subject: Re: [PATCH v2] sound: rawmidi: Add framing mode
Date: Wed, 24 Mar 2021 21:44:30 +0900	[thread overview]
Message-ID: <20210324124430.GA3711@workstation> (raw)
In-Reply-To: <20210324054253.34642-1-coding@diwic.se>

Hi,

On Wed, Mar 24, 2021 at 06:42:53AM +0100, David Henningsson wrote:
> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
> index 535a7229e1d9..f33076755025 100644
> --- a/include/uapi/sound/asound.h
> +++ b/include/uapi/sound/asound.h
> @@ -736,12 +736,28 @@ struct snd_rawmidi_info {
>  	unsigned char reserved[64];	/* reserved for future use */
>  };
>  
> +enum {
> +	SNDRV_RAWMIDI_FRAMING_NONE = 0,
> +	SNDRV_RAWMIDI_FRAMING_TSTAMP_MONOTONIC_RAW,
> +	SNDRV_RAWMIDI_FRAMING_LAST = SNDRV_RAWMIDI_FRAMING_TSTAMP_MONOTONIC_RAW,
> +};

In C language specification, enumeration is for value of int storage. In
my opinion, int type should be used for the framing member, perhaps.

(I think you can easily understand my insistent since you're Rust
programmer.)

I note that in UAPI of Linux kernel, we have some macros to represent
system clocks; e.g. CLOCK_REALTIME, CLOCK_MONOTONIC:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/time.h#n46

We can use the series of macro, instead of defining the specific
enumerations. However I have one concern that the 'None' value cannot be
zero in the case since CLOCK_REALTIME is zero. This is a bit inconvenient
since we need initializer function in both of kernel space and user
space...

For the idea to record system timestamp when drivers call helper
function to put MIDI message bytes into intermediate buffer in
hardware/software IRQ context, I have some concerns and I'll post
another message to thread, later.


Regards

Takashi Sakamoto

  parent reply	other threads:[~2021-03-24 12:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  5:42 [PATCH v2] sound: rawmidi: Add framing mode David Henningsson
2021-03-24 10:03 ` Takashi Iwai
2021-03-24 11:18   ` David Henningsson
2021-03-24 13:29     ` Takashi Sakamoto
2021-03-24 12:44 ` Takashi Sakamoto [this message]
2021-03-24 15:57   ` David Henningsson
2021-03-26  4:46     ` Takashi Sakamoto
2021-03-26  7:55       ` Takashi Iwai
2021-03-26 16:29         ` David Henningsson
2021-03-26 16:44           ` Takashi Iwai
2021-03-27  1:51             ` Takashi Sakamoto
2021-03-28  6:39             ` David Henningsson
2021-03-28  7:40               ` Takashi Iwai
2021-03-30 19:35                 ` David Henningsson
2021-03-31  7:40                   ` Takashi Iwai
2021-04-05 12:13                     ` David Henningsson
2021-04-06 12:01                       ` Takashi Iwai
2021-04-10 11:41                         ` David Henningsson
2021-04-12 16:03                           ` Takashi Iwai
2021-03-27  3:44           ` Takashi Sakamoto
2021-03-27  3:10         ` Takashi Sakamoto

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=20210324124430.GA3711@workstation \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=coding@diwic.se \
    --cc=tiwai@suse.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.