-
Notifications
You must be signed in to change notification settings - Fork 275
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
Output console flooded with "MidiInAlsa: message queue limit reached!!" #236
Comments
…ith a #if defined(__RTMIDI_DEBUG__) in order to prevent console flooding when message queue limit is reached, this fixes the issue I filed here: thestk#236
Sorry, I know this is old. Anyways, the message you mention should only be emitted if the queue gets full, and then there should be dropped incoming messages, so it's a bit strange that you say that the software continues to work as expected. This should only happen if I do agree that that message could be reported differenty than just printing to I had a quick look and it seems to me that the Java wrapper does not implement
|
I haven't been working on this and won't be for some time but I still think it would be useful to have some different way of handling errors like this. ALSA and JACK use callbacks for errors and provide nice convenient functions for those callbacks like this: typedef err_cb_t (void *)(void);
/// pass NULL to reset to default, which prints to stderr
int set_error_callback(err_cb_t error_cb);
/// empty callback that does nothing, pass this to `set_error_callback`
err_cb_t get_empty_callback(void); This is a little overkill I know but allows custom handling by clients if they want it. Otherwise, I think a flag to toggle stderr on or off is an absolute must because in release scenarios having the stderr flooded with RtMidi messages is undesirable. Whether that's by use of some macro (like I did in my PR #244) or better, by use of some actual flag that can be modified at runtime easily. |
I'm developing a Java library that binds RtMidi to Java using JNA, everything so far works very well except for one issue.
Steps to reproduce the problem.
Whenever I create an
RtMidiInPtr
using eitherrtmidi_in_create()
orrtmidi_in_create_default()
after I send enough messages to fill the queue (RtMidi's default is 100, but set anything over 0, 0 causes a segfault later inMidiInApi::MidiQueue::push(MidiInApi::MidiMessage const&)
), any further messages will print to the consoleMidiInAlsa: message queue limit reached!!
.Expected behavior and actual behavior.
I'm unsure if this is supposed to be a genuine error, indicating undefined behavior or just a warning, so far I have been able to do everything perfectly fine with this message printing to the console every time I send a MIDI message, so it seems to me it's more of a developer warning rather than an error, but please correct me if I'm wrong.
If I am correct I think it would be better to replace the code here:
with something similar to what's found elsewhere like this:
This matters because users of my library may be confused (as I was) about the severity of this error, but more importantly because it floods the console output when debugging.
I would make this change myself but I'm unsure about whether this is intentional behavior and I'm just missing something but also because I'm not very comfortable with C++.
Specifications like the version of the project, operating system, or hardware.
Release 4.0.0 built as a .so library
librtmidi.so
forlinux-x86-64
with ALSA and JACK installed.You can see the .so here: https://github.com/basshelal/JNARtMidi/tree/e3a761aa98a915dc1c8b98a3c6be08f94a72292d/bin/linux-x86-64
Many thanks for your efforts
😊
The text was updated successfully, but these errors were encountered: