Skip to content

Commit

Permalink
Fix CPU hogging of the midi_thread()
Browse files Browse the repository at this point in the history
The midi thread was always late after 2^31-1 Samples (~13.5h at 44.1kHz), because when there's no time limit, a uint64_t sample counter was compared against a signed 32bit INT_MAX to determine lateness. Now the CPU lockup will occur only after ~3 million years (at 192kHz), and because of the overflow it will presumably fix itself after a few milliseconds.
  • Loading branch information
escitalopram committed Oct 27, 2015
1 parent 22e843f commit 400f318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux/alsa/alsa_rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum {
NANOSLEEP_RESOLUTION = 7000
};

#define NFRAMES_INF INT_MAX
#define NFRAMES_INF ULLONG_MAX

enum {
#ifndef JACK_MIDI_DEBUG
Expand Down

0 comments on commit 400f318

Please sign in to comment.