You are not logged in.

#1 2015-12-31 18:53:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

[SOLVED] SFML audio connect(2) call to /dev/shm/.../jack_0 failed

I'm trying to rewrite on of my major projects to move from linux-specific libs (Xlib, sndfile, cairo) to SFML in hopes that it will be portable to other platforms.  Unfortunately I'm not having much luck with SFML.  I've traced an issue to a single declaration of a sf::SoundBuffer which followed very closely to the tutorials on SFMLs website - I then reduced it to the following minimal program which creates the error on my system:

/* test.cpp */

#include <SFML/Audio.hpp>

int main() {
	sf::SoundBuffer buffer;
	return 0;
}

Compiling as follows and running produces the error:

$ gcc -o test test.cpp -lsfml-audio

$ ./test
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed

Googling this error doesn't seem to get me anywhere.  And SFML is completely new to me (as is most c++ for that matter, but I can fumble along).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#2 2015-12-31 21:12:09

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: [SOLVED] SFML audio connect(2) call to /dev/shm/.../jack_0 failed

It's been a while since I used SFML, but I can be quite sure there is nothing wrong with this code ^^

This error is pretty harmless, at least on my end. It's probably just their openal implementation checking for JACK audio support, there seems to be some more issues with that at the moment according to the github issues.

It should not hinder you any further than the message, at least that's how it is on my system.

Are you able to run something like this properly?

#include <SFML/Audio.php>

int main() {
	sf::Music music;
	if (!music.openFromFile("some_music_file"))
		return -1;

	music.play(); /* Start playing */

	sf::sleep(music.getDuration()); /* music.play() gets executed in a separate thread, so we have to explicitly wait for it to finish  */
}

Note that mp3 is not supported, you'll need wav, flac or ogg.

As a side note, you should officially also link against sfml-system if you use sfml-audio.

In short, your issue probably has nothing to do with this message. What are you trying to do?

EDIT: Might as well not clog up the CPU ^^'

Last edited by Steef435 (2015-12-31 21:29:42)

Offline

#3 2015-12-31 22:49:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] SFML audio connect(2) call to /dev/shm/.../jack_0 failed

Ah, crap, you're right - that line is just a warning.  The error is elsewhere.  There is an apparently unrelated issue - the actual project is quite large, so it's not practical to post it here, at least not until I trace the actual source of the crash.  I traced this message to the declaration and put it in a minimal example.  In the real project I do link against many other SFML bits.

Thanks.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB