jackaudio / jack2

jack2 codebase
GNU General Public License v2.0
2.2k stars 373 forks source link

Jack error message #226

Closed CreamyCookie closed 5 years ago

CreamyCookie commented 8 years ago

I'm getting the following message when I use LibGDX with lwjgl3, which uses OpenAL-Soft, which interacts with libjack:

Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock

I get this whether or not I'm playing or initializing a sound. Audio works.

The following is a comment from the OpenAL Soft developer about the issue:

Those messages come from libjack, and unfortunately OpenAL Soft can't control them. OpenAL Soft tries to initialize the JACK backend first by trying to connect to a JACK server, in case that's the user's desired output method. If the server is not running, libjack will print that and fail (letting OpenAL Soft try PulseAudio next, then ALSA, etc), but there doesn't seem to be a way to tell libjack that a failed connection isn't a problem and don't print that.

I'm on Ubuntu 16.04. Feel free to ask me, if there's anything you need to know to fix this issue.

mseeber commented 8 years ago

This is not about a failed connection, it is about creating a JACK client when no JACK server is running. The default for open-al seems to be to try to create a client but disable starting a JACK server automatically, which seems reasonable and results in this message. If you do not want to use JACK as audio backend, the right thing would be to disable it or move it to the lowest priority with the options open-al provides.

CreamyCookie commented 8 years ago

Could you add an option / flag for the OpenAL guys to hide these messages when trying to create a JACK client when no JACK server is running?

If you do not want to use JACK as audio backend, the right thing would be to disable it or move it to the lowest priority with the options open-al provides.

Thanks! I have disabled Jack in the OpenAL config for now. TBH I know basically nothing about Jack or OpenAL. I think Jack was preinstalled on Ubuntu 16.04. I got this error message pretty much out of the blue when using LibGDX (a game engine).

mseeber commented 8 years ago

Could you add an option / flag for the OpenAL guys to hide these messages when trying to create a JACK client when no JACK server is running?

I understand that the message is annoying but I don't know if this is a good idea. The reason is, that when using JACK the way it is used in the defaults the fact that no JACK server is running, the failed attempt to create a client becomes an error from a users point of view, because the settings assume, that a JACK server is running. So it does make sense to have a message in that case.

Either way, the behavior of printing to stderr instead of setting an error flag or an error message that the calling code may use could be considered.

I just saw, that qjackctl for example avoids this issue by redirection its own stdout/stderr to be displayed in a separate window.

@sletz @pauldavisthefirst Has this been designed like this on purpose? Is there actually a canonical way to check if a server is running without creating a client?

pauldavisthefirst commented 8 years ago

On Tue, Aug 9, 2016 at 6:21 AM, Markus Seeber notifications@github.com wrote:

Could you add an option / flag for the OpenAL guys to hide these messages when trying to create a JACK client when no JACK server is running?

I understand that the message is annoying but I don't know if this is a good idea. The reason is, that when using JACK the way it is used in the defaults the fact that no JACK server is running, the failed attempt to create a client becomes an error from a users point of view, because the settings assume, that a JACK server is running. So it does make sense to have a message in that case.

Either way, the behavior of printing to stderr instead of setting an error flag or an error message that the calling code may use could be considered.

I just saw, that qjackctl for example avoids this issue by redirection its own stdout/stderr to be displayed in a separate window.

@sletz https://github.com/sletz @pauldavisthefirst https://github.com/pauldavisthefirst Has this been designed like this on purpose? Is there actually a canonical way to check if a server is running without creating a client?

There is not. But Jack2 is needlessly (and in my opinion, incorrectly) verbose about it. If you do this with Jack1 (you do NOT need to recompile to try this), there will be no error message from JACK itself.

In addition, there is also jack_set_error_function() which the client can call to change the disposition of all output generated via jack_error().

mseeber commented 8 years ago

So the workaround for jack2 in openal would be to either provide their own callback or to wrap this specific code secton in something like:

jack_set_error_function(silent_jack_error_callback);
//try opening client here
jack_set_error_function(default_jack_error_callback);
pauldavisthefirst commented 8 years ago

Yes. Assuming those errors are generated via a call to jack_error(). They may not be.

On Tue, Aug 9, 2016 at 9:56 AM, Markus Seeber notifications@github.com wrote:

So the workaround for jack2 in openal would be to either provide their own callback or to wrap this specific code secton in something like:

jack_set_error_function(silent_jack_error_callback); //try opening client here jack_set_error_function(default_jack_error_callback);

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackaudio/jack2/issues/226#issuecomment-238560670, or mute the thread https://github.com/notifications/unsubscribe-auth/ADrXgwmgJml_hQxK87f7T4xwxUGEuyZhks5qeIcYgaJpZM4JfXtm .

nedko commented 8 years ago

Markus Seeber notifications@github.com writes:

[snip context]

If you do not want to use JACK as audio backend, the right thing would be to disable it or move it to the lowest priority with the options open-al provides. [snip context]

This sounds like JACK should be the last option for audio. This sucks.

pauldavisthefirst commented 8 years ago

s/JACK/JACK2/g

:) :) :)

On Tue, Aug 9, 2016 at 4:46 PM, Nedko Arnaudov notifications@github.com wrote:

Markus Seeber notifications@github.com writes:

[snip context]

If you do not want to use JACK as audio backend, the right thing would be to disable it or move it to the lowest priority with the options open-al provides. [snip context]

This sounds like JACK should be the last option for audio. This sucks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackaudio/jack2/issues/226#issuecomment-238685727, or mute the thread https://github.com/notifications/unsubscribe-auth/ADrXg_yjUDahaNtddwEpy8-z2W2mvyXJks5qeOcqgaJpZM4JfXtm .

nedko commented 8 years ago

Markus Seeber notifications@github.com writes:

I just saw, that qjackctl for example avoids this issue by redirection its own stdout/stderr to be displayed in a separate window.

This makes perfect sense for any GUI program. The default JACK server behaviour is highly offensive to text-based UIs, especially non-command-line ones.

CreamyCookie commented 8 years ago

So the workaround for jack2 in openal would be to either provide their own callback or to wrap this specific code secton in something like:

jack_set_error_function(silent_jack_error_callback);
//try opening client here
jack_set_error_function(default_jack_error_callback);

Yes. Assuming those errors are generated via a call to jack_error(). They may not be.

Thanks! I've just checked each error message and as far as I can see they all use jack_error.

@kcat Can you hide the message with this workaround?

pauldavisthefirst commented 8 years ago

You can't hide the ones generated by the server process, however.

On Thu, Aug 11, 2016 at 10:00 AM, CreamyCookie notifications@github.com wrote:

So the workaround for jack2 in openal would be to either provide their own callback or to wrap this specific code secton in something like:

jack_set_error_function(silent_jack_error_callback); //try opening client here jack_set_error_function(default_jack_error_callback);

Yes. Assuming those errors are generated via a call to jack_error(). They may not be.

I've just checked and it seems they all use jack_error.

@kcat https://github.com/kcat Can you hide the message with this workaround?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackaudio/jack2/issues/226#issuecomment-239169136, or mute the thread https://github.com/notifications/unsubscribe-auth/ADrXg5c6aXOTygc6t3pjsRocbieHpPq-ks5qeyrhgaJpZM4JfXtm .

kcat commented 8 years ago

@kcat Can you hide the message with this workaround?

That seems to work, at least for the connection/no-server warnings. Not sure about the JackShmReadWritePtr messages, since I don't seem to be getting them. It's a bit unfortunate since it means I'm going to hide all messages from jack, including ones that may actually be an error the user would be interested in seeing, instead of just the ones saying there's no server to connect to.

Also, it doesn't seem there's an equivalent jack_get_error_function. So if the app is using jack itself and sets its own handler, OpenAL Soft will reset it back to the default after it's done trying to connect. The header declares a jack_error_callback function pointer which it says should be the current callback function, but I get an undefined symbol error when I try to load it.

pauldavisthefirst commented 8 years ago

that's another bug in jack2.

On Thu, Aug 11, 2016 at 6:01 PM, kcat notifications@github.com wrote:

@kcat https://github.com/kcat Can you hide the message with this workaround?

That seems to work, at least for the connection/no-server warnings. Not sure about the JackShmReadWritePtr messages, since I don't seem to be getting them. It's a bit unfortunate since it means I'm going to hide all messages from jack, including ones that may actually be an error the user would be interested in seeing, instead of just the ones saying there's no server to connect to.

Also, it doesn't seem there's an equivalent jack_get_error_function. So if the app is using jack itself and sets its own handler, OpenAL Soft will reset it back to the default after it's done trying to connect. The header declares a jack_error_callback function pointer which it says should be the current callback function, but I get an undefined symbol error when I try to load it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackaudio/jack2/issues/226#issuecomment-239306999, or mute the thread https://github.com/notifications/unsubscribe-auth/ADrXg3SfyfD0jYC-J2QMEOnBCgTAT2AOks5qe5vSgaJpZM4JfXtm .

7890 commented 7 years ago

For a JACK client to silently try to connect to (a running) JACK server, the best you can do is: -set option to not try to autostart jackd (this is probably a relevant source of many other issues) -set error method and be quiet in it This happens with almost no delay and the cases of failure can be handled in code by other means (if client is NULL or an error was catched etc).

HybridDog commented 7 years ago

Couldn't you simply add a function which tests if jack is available?

7890 commented 7 years ago

That's too simple. You can a) try to dlopen libjack b) try to connect to the "default" server or any other server (discovery via /dev/shm/?) and put that to a program "jack_works" or similar which returns 0 or 1

HybridDog commented 7 years ago

There's some function called SDL_AudioDriverName which returns the used audio driver example usage

7890 commented 5 years ago

Please re-open if this is still an issue.

aishwarya418112 commented 3 years ago

I get this error when I plug in an rtl-sdr for gnss sdr to the usb port...please help me solve this.

gnss-sdr --config_file=./rtl-gps.conf linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

Initializing GNSS-SDR v0.0.14.git-next-6dedcb6c3 ... Please wait. Logging will be written at "/tmp" Use gnss-sdr --log_dir=/path/to/log to change that. gr-osmosdr 0.1.4 (0.1.4) gnuradio v3.8.2.0-118-g8b2012ab built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory) attempt to connect to server failed Detached kernel driver Found Rafael Micro R820T tuner Reattached kernel driver Using device #0 Realtek RTL2838UHIDIR SN: 00000001 Detached kernel driver Found Rafael Micro R820T tuner [R82XX] PLL not locked! Segmentation fault (core dumped)