Menu

#4 Lost or out of order messages to jack client

git_head
open
nobody
None
2023-04-20
2023-04-20
Walt
No

i have experienced hanging sounds due to the receiver not getting MIDI note-off commands. The UDP packet with the note-off message is arriving at the receiver host (shown by tcpdump) but it fails to reach the jack client correctly.

I see the error seems to be in qmidinetJackMidiDevice::process which processes events from the previous frame, i.e. one frame latency. It performs a check whether the message is before the current frame:

if (ev.event.time > m_last_frame_time)
                    break;

but this includes events that are at the start of the current frame, i.e. ev.event.time == m_last_frame_time. Consequently these events are placed at the start of the frame by a later bounds check which puts the message out-of-order.

A fix would be to correct the frame check, e.g.

if (ev.event.time >= m_last_frame_time)
                    break;

This ensures that only commands in previous frames are processed. I have tested this fix to prove its validity.

Discussion

  • Rui Nuno Capela

    Rui Nuno Capela - 2023-04-20

    good catch... your suggestion is now in [7e8e2f]

    next time propose a MR?

    thanks

     

    Related

    Commit: [7e8e2f]

  • Walt

    Walt - 2023-04-20

    "MR"?

    I couldn't figure out where (of the many web appearances) to post a patch / pull request. I have been using git for some time so tend to branch, fix, PR but wasn't sure of your contribution mechanism.

     
    • Rui Nuno Capela

      Rui Nuno Capela - 2023-04-20

      MR == Merge Request == Pull Request

      you should know by now that a git pull is a git fetch followed by a git merge, don't you?

       

      Last edit: Rui Nuno Capela 2023-04-20
  • Walt

    Walt - 2023-04-20

    Thanks Rui - which repo is the main one to request against? I guess the one here at sourceforge.

     
    • Rui Nuno Capela

      Rui Nuno Capela - 2023-04-20

      all repos are mirrored; here SF is fine but GH is kinda more popular :)

       

Log in to post a comment.