mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-16 22:05:18 -05:00
rawmidi: Add rawmidi framing API
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. Signed-off-by: David Henningsson <coding@diwic.se> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
23a191a82c
commit
95eb312fad
5 changed files with 153 additions and 2 deletions
|
|
@ -285,6 +285,7 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
rmidi->poll_fd = fd;
|
||||
rmidi->ops = &snd_rawmidi_hw_ops;
|
||||
rmidi->private_data = hw;
|
||||
rmidi->version = ver;
|
||||
hw->open++;
|
||||
*inputp = rmidi;
|
||||
}
|
||||
|
|
@ -300,6 +301,7 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
rmidi->poll_fd = fd;
|
||||
rmidi->ops = &snd_rawmidi_hw_ops;
|
||||
rmidi->private_data = hw;
|
||||
rmidi->version = ver;
|
||||
hw->open++;
|
||||
*outputp = rmidi;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue