History

ALSA: seq: Add tempo base unit for MIDI2 Set Tempo messages

MIDI2 Set Tempo message defines the tempo in 10ns unit for finer accuracy, while MIDI1 was defined in 1us unit. For adapting this different unit, introduce "tempo_base" field to snd_seq_queue_tempo struct so that user-space can pass the proper tempo base unit. The accepted value is limited, it must be either 0, 10 or 1000. The protocol version is bumped to 1.0.4 along with this. The access with the older protocol version ignores the tempo-base value in ioctls and always treats as 1000.

Takashi Iwai committed 2 years ago

Commit fefbbdf1 parent a892b705 files · +30 −12Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/sound/asequencer.h+4−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <sound/asound.h>
1111
1212 /** version of the sequencer */
13−#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3)
13+#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
1414
1515 /**
1616 * definition of sequencer event types
@@ -523,11 +523,12 @@ struct snd_seq_queue_status { · 506 unmodified lines
523523 /* queue tempo */
524524 struct snd_seq_queue_tempo {
525525 int queue; /* sequencer queue */
526− unsigned int tempo; /* current tempo, us/tick */
526+ unsigned int tempo; /* current tempo, us/tick (or different time-base below) */
527527 int ppq; /* time resolution, ticks/quarter */
528528 unsigned int skew_value; /* queue skew */
529529 unsigned int skew_base; /* queue skew base */
530− char reserved[24]; /* for the future */
530+ unsigned short tempo_base; /* tempo base in nsec unit; either 10 or 1000 */
531+ char reserved[22]; /* for the future */
531532 };
532533
533534