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.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <sound/asound.h> |
| 11 | 11 | |
| 12 | 12 | /** 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) | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * definition of sequencer event types |
| @@ -523,11 +523,12 @@ struct snd_seq_queue_status { · 506 unmodified lines | ||
| 523 | 523 | /* queue tempo */ |
| 524 | 524 | struct snd_seq_queue_tempo { |
| 525 | 525 | 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) */ | |
| 527 | 527 | int ppq; /* time resolution, ticks/quarter */ |
| 528 | 528 | unsigned int skew_value; /* queue skew */ |
| 529 | 529 | 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 */ | |
| 531 | 532 | }; |
| 532 | 533 | |
| 533 | 534 | |