mbox series

[0/2] alsa-lib patches for rawmidi tstamp framing

Message ID 20210816160625.17796-1-coding@diwic.se
Headers show
Series alsa-lib patches for rawmidi tstamp framing | expand

Message

David Henningsson Aug. 16, 2021, 4:06 p.m. UTC
Well, now that we're about to release a kernel with support for rawmidi tstamp framing,
how about some alsa-lib support for it as well?

David Henningsson (2):
  Add rawmidi framing API
  Add test for rawmidi framing API

 include/rawmidi.h           | 26 ++++++++++++
 include/sound/uapi/asound.h | 30 +++++++++++++-
 src/rawmidi/rawmidi.c       | 83 +++++++++++++++++++++++++++++++++++++
 src/rawmidi/rawmidi_hw.c    |  2 +
 src/rawmidi/rawmidi_local.h |  2 +
 test/rawmidi.c              | 65 ++++++++++++++++++++++++++---
 6 files changed, 200 insertions(+), 8 deletions(-)

Comments

Takashi Iwai Aug. 17, 2021, 5:35 a.m. UTC | #1
On Mon, 16 Aug 2021 18:06:23 +0200,
David Henningsson wrote:
> 
> Well, now that we're about to release a kernel with support for rawmidi tstamp framing,
> how about some alsa-lib support for it as well?

Sure, that's the missing piece.
But, could you give a bit more description to each patch?


thanks,

Takashi
David Henningsson Aug. 17, 2021, 10:07 a.m. UTC | #2
On 2021-08-17 07:35, Takashi Iwai wrote:
> On Mon, 16 Aug 2021 18:06:23 +0200,
> David Henningsson wrote:
>> Well, now that we're about to release a kernel with support for rawmidi tstamp framing,
>> how about some alsa-lib support for it as well?
> Sure, that's the missing piece.
> But, could you give a bit more description to each patch?
Do you mean commit message?

I could just write this for patch 1/2 (i e, copy the doc section added 
in the patch):

Optionally, incoming rawmidi bytes can be put inside a frame of type snd_rawmidi_framing_tstamp_t.
The main current benefit is that can enable in-kernel timestamping of incoming bytes, and that
timestamp is likely to be more precise than what userspace can offer.

Tstamp type framing requires a kernel >= 5.14 and a buffer size that is a multiple of
sizeof(snd_rawmidi_framing_tstamp_t). It is only available on input streams.

And this for patch 2/2:

Adds a "clock type" parameter to the "rawmidi" test program, that when 
used and combined with -i (and -v to be useful), activates tstamp type 
framing with the specified clock type.

I hope this description makes it possible for you to review the patch 
content as well.

Thanks,

// David
Takashi Iwai Aug. 17, 2021, 10:14 a.m. UTC | #3
On Tue, 17 Aug 2021 12:07:39 +0200,
David Henningsson wrote:
> 
> 
> On 2021-08-17 07:35, Takashi Iwai wrote:
> > On Mon, 16 Aug 2021 18:06:23 +0200,
> > David Henningsson wrote:
> >> Well, now that we're about to release a kernel with support for rawmidi tstamp framing,
> >> how about some alsa-lib support for it as well?
> > Sure, that's the missing piece.
> > But, could you give a bit more description to each patch?
> Do you mean commit message?

Yes.

> I could just write this for patch 1/2 (i e, copy the doc section added
> in the patch):
> 
> Optionally, incoming rawmidi bytes can be put inside a frame of type snd_rawmidi_framing_tstamp_t.
> The main current benefit is that can enable in-kernel timestamping of incoming bytes, and that
> timestamp is likely to be more precise than what userspace can offer.
> 
> Tstamp type framing requires a kernel >= 5.14 and a buffer size that is a multiple of
> sizeof(snd_rawmidi_framing_tstamp_t). It is only available on input streams.
> 
> And this for patch 2/2:
> 
> Adds a "clock type" parameter to the "rawmidi" test program, that when
> used and combined with -i (and -v to be useful), activates tstamp type
> framing with the specified clock type.
> 
> I hope this description makes it possible for you to review the patch
> content as well.

The texts look OK, please resubmit.


thanks,

Takashi