8000 jack-transport: possibly uninitialized `position->beats_per_minute` in `update_bpm`. · Issue #7 · zynthian/jack-smf-utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jack-transport: possibly uninitialized position->beats_per_minute in update_bpm. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asrcpq opened this issue May 11, 2025 · 0 comments

Comments

@asrcpq
Copy link
asrcpq commented May 11, 2025

Problem

Using jack-smf-player under jack-transport mode (i.e., without -t flag) causes all events in the MIDI file to be sent immediately regardless of freewheel setting.

Environment

  • OS: Alpine Linux v3.21
  • JACK server: JACK2 (jackdmp)
  • Version: master

Investigation

My understanding is that timebase callback is currently disabled in jack-smf-player.c#L576 which was supposed to provide the BBT information based on the documentation.

Therefore, the update_bpm function might be called with BBT field uninitialized. In my environment, the uninitialized value is often a tiny double, which passed the zero check and assigned to position->beats_per_minute and further used for time calculation jack-smf-player.c#L346, leading to the incorrect playback speed.

Solution

A quick solution is to check the BBT bitmask against position->valid and skip the BPM update if the information is not included, see this commit.

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

No branches or pull requests

1 participant
0