Skip to content

Bug fixes and code hardening - #180

Merged
lathoub merged 31 commits into
masterfrom
v3.5.0
Aug 19, 2026
Merged

Bug fixes and code hardening#180
lathoub merged 31 commits into
masterfrom
v3.5.0

Conversation

@lathoub

@lathoub lathoub commented Aug 19, 2026

Copy link
Copy Markdown
Owner
  • Update rtpMIDI_Parser_JournalSection.hpp
  • fix: 16-bit sequence wrap looks like packet loss
  • fix Session timeout uses 32-bit millis (must be 64bit)
  • fix for Outgoing MIDI is gated on the last UDP source
  • UDP datagrams are treated as a byte stream
  • fix Invitation parser consumes the rest of the buffer
  • ONE_PARTICIPANT + APPLEMIDI_INITIATOR did not compile
  • Outgoing SysEx continuation (wrong front()) and silent inMidiBuffer overflow
  • System-journal length underflow
  • Use real data UDP port
  • Wrap-safe send-side sequence compare
  • Gate unused journal parse and outbound RS so small sketches can drop that flash without deleting the code.
  • Document that extra F0/F7 on large SysEx is RFC 6295 segmentation, not a USB-style framing bug.
  • Match invitation reject by initiator token so a NO before control OK is not ignored.
  • Do not queue MIDI or send RTP until a participant has a real SSRC.
  • CI does not build ESP examples
  • Reject unknown-SSRC MIDI and stop the RTP parser hanging on bad commands.
  • Parse Bitrate Receive Limit on listeners so initiator RL packets do not desync the control port.

lathoub and others added 30 commits August 17, 2026 20:29
…nds.

Incoming RTP-MIDI could be delivered without a session, and a data byte with no running status or a LEN underflow could spin loop() forever.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ot desync the control port.

Co-authored-by: Cursor <cursoragent@cursor.com>
AppleMIDI and RTP-MIDI are one message per UDP datagram. The reader currently calls parsePacket() even when the buffer still holds leftover bytes, so datagram N+1 is glued onto an incomplete parse of N.

Keep same-datagram chunking (that is how large SysEx fits in a 64-byte buffer). Only stop cross-datagram concat.
Invitation parser eats the rest of the buffer (AppleMIDI_Parser.h) — stop the session name at NUL so leftover datagram bytes are not swallowed. Highest impact now that datagrams are no longer concatenated.
Next is making ONE_PARTICIPANT + APPLEMIDI_INITIATOR compile. I’ll find every participants[i] use that isn’t gated.
…Buffer overflow

Outgoing SysEx: write() no longer looks at outMidiBuffer.front(). beginTransmission records whether this message is SysEx (_writingSysEx), so a zero timestamp or an earlier Note On in the same packet does not skip the F0/F7 split.

Incoming overflow: ReceivedMidi returns if inMidiBuffer is full instead of dropping the byte with no signal. With USE_EXT_CALLBACKS, it fires BufferFullException with value 1 (outgoing full remains 0).
…nd-side sequence compare.

System journal LENGTH: if sysjourlen < 2, return UnexpectedJournalData instead of underflowing remainingBytes.

Data port: Participant now has remoteDataPort. Default is still control+1, then it is replaced with dataPort.remotePort() when the data invitation (listener) or data OK (initiator) arrives. CK, RTP, and data invites use that port.

Send-side seq wrap: receiver feedback uses RFC 3550 serial compare (int16_t delta). Wrap no longer looks like SendPacketsDropped.
Endian: endian.h no longer uses #ifdef TEST_LITTLE_ENDIAN (always true). It uses __BYTE_ORDER__ / __ORDER_*__, then AVR/ESP/Windows fallbacks.
CI: actions/checkout@v4. ESP8266 (generic) and ESP32 (esp32) examples compile after installing those cores.
…that flash without deleting the code.

Co-authored-by: Cursor <cursoragent@cursor.com>
will go into // repo
…is not ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… guessing control+1.

Co-authored-by: Cursor <cursoragent@cursor.com>
…stall the parser.

Co-authored-by: Cursor <cursoragent@cursor.com>
…t a USB-style framing bug.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ords with the library.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ughout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Updated compatibility information and installation instructions in README.
Added GitHub release badge to README and improved formatting.
@lathoub
lathoub merged commit 9eb166f into master Aug 19, 2026
2 checks passed
@lathoub
lathoub deleted the v3.5.0 branch August 19, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant