From 31aac6265cde63c357a81ceb0ff3f8e9236d3153 Mon Sep 17 00:00:00 2001 From: nia <29542929+alarixnia@users.noreply.github.com> Date: Sat, 29 Jan 2022 05:59:48 +0000 Subject: [PATCH] midioss: Use unbuffered I/O to access the device node. (#6276) This fixes problems reading from MIDI devices on NetBSD - the input blocked until a certain number of notes have been read rather than returning immediately when a single note is received. --- src/core/midi/MidiOss.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/midi/MidiOss.cpp b/src/core/midi/MidiOss.cpp index 77f324442..dddcfa12e 100644 --- a/src/core/midi/MidiOss.cpp +++ b/src/core/midi/MidiOss.cpp @@ -39,8 +39,10 @@ MidiOss::MidiOss() : { // only start thread, if opening of MIDI-device is successful, // otherwise isRunning()==false indicates error - if( m_midiDev.open( QIODevice::ReadWrite ) || - m_midiDev.open( QIODevice::ReadOnly ) ) + if( m_midiDev.open( QIODevice::ReadWrite | + QIODevice::Unbuffered ) ) || + m_midiDev.open( QIODevice::ReadOnly | + QIODevice::Unbuffered ) ) { start( QThread::LowPriority ); }