Skip to content
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

AudioPlayer: Initialization of soundfile failed! (audioplayer.cpp:88) #239

Open
brandflake11 opened this issue Feb 25, 2021 · 17 comments
Open

Comments

@brandflake11
Copy link

Hello ssr team,
I have been trying to get sound out of ssr on Artix Linux, and it seems no matter what audio file I try to load into it, it doesn't load. Here is the output and command I am using to try to get audio out of ssr:
ssr-binaural ~/Music/Test_Epidemia_Opus.flac -s /usr/share/ssr/reproduction_setups/2.0.asd --hrirs=/usr/share/ssr/impulse_responses/hrirs/hrirs_fabian.wav

Jack: JackClient::SetupDriverSync driver sem in flush mode
Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_BinauralRenderer
Jack: Clock source : system clock via clock_gettime
Jack: JackLibClient::Open name = BinauralRenderer refnum = 6
       ___     
      /  ___   
  ___/  /  ___ 
    ___/  /    SSR (SoundScape Renderer) brandon202102251400
         /     
               
Website: <http://spatialaudio.net/ssr/>
Contact: <[email protected]>

Copyright © 2016 Division of Applied Acoustics, Chalmers University of Technology
Copyright © 2014 Institut für Nachrichtentechnik, Universität Rostock
Copyright © 2012 Quality & Usability Lab, Telekom Innovation Laboratories, TU Berlin

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Jack: JackClient::PortRegister ref = 6 name = BinauralRenderer:out_1 type = 32 bit float mono audio port_index = 17
Jack: JackClient::Connect src = BinauralRenderer:out_1 dst = system:playback_1
Jack: JackClient::PortRegister ref = 6 name = BinauralRenderer:out_2 type = 32 bit float mono audio port_index = 18
Jack: JackClient::Connect src = BinauralRenderer:out_2 dst = system:playback_2
Warning: Trying to open specified file as audio file. (controller.h:983)

***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************

Warning: Creating spontaneous scene from the audio file "/home/brandon/Music/test41k.wav". (controller.h:1016)

***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************


***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************


***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************

Jack: JackClient::ClientNotify ref = 7 name = ecasound-ctrl-22027 notify = 0
Jack: JackClient::AddClient name = ecasound-ctrl-22027, ref = 7 
Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_ecasound-ctrl-22027
Jack: JackClient::ClientNotify ref = 7 name = ecasound-ctrl-22027 notify = 1
Jack: JackClient::RemoveClient name = ecasound-ctrl-22027, ref = 7 

(ecasoundc_sa) Error='read() error', cmd='cs-connect' last_error='' cmd_cnt=6 last_cnt=5.

***********************************************************************
* Message from libecasoundc:
* 
* Connection to the processing engine was lost. Check that ecasound 
* is correctly installed. Also make sure that ecasound is either 
* in some directory listed in PATH, or the environment variable
* 'ECASOUND' contains the path to a working ecasound executable.
***********************************************************************

Jack: JackClient::ClientNotify ref = 7 name = ecasound notify = 0
Jack: JackClient::AddClient name = ecasound, ref = 7 
Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_ecasound
Jack: JackClient::ClientNotify ref = 7 name = ecasound notify = 1
Jack: JackClient::RemoveClient name = ecasound, ref = 7 
Error: _get_jack_sample_rate():  (audioplayer.cpp:312)
Warning: AudioPlayer: Initialization of soundfile '/home/brandon/Music/test41k.wav' failed! (audioplayer.cpp:88)
Jack: JackClient::PortRegister ref = 6 name = BinauralRenderer:in_1 type = 32 bit float mono audio port_index = 19

***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************


***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************


***********************************************************************
* Message from libecasoundc:
* 
* 'ECASOUND' environment variable not set. Using the default value 
* value 'ECASOUND=ecasound'.
***********************************************************************

Jack: JackClient::ClientNotify ref = 7 name = ecasound-ctrl-22041 notify = 0
Jack: JackClient::AddClient name = ecasound-ctrl-22041, ref = 7 
Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_ecasound-ctrl-22041
Jack: JackClient::ClientNotify ref = 7 name = ecasound-ctrl-22041 notify = 1
Jack: JackClient::RemoveClient name = ecasound-ctrl-22041, ref = 7 

(ecasoundc_sa) Error='read() error', cmd='cs-connect' last_error='' cmd_cnt=6 last_cnt=5.

***********************************************************************
* Message from libecasoundc:
* 
* Connection to the processing engine was lost. Check that ecasound 
* is correctly installed. Also make sure that ecasound is either 
* in some directory listed in PATH, or the environment variable
* 'ECASOUND' contains the path to a working ecasound executable.
***********************************************************************

Jack: JackClient::ClientNotify ref = 7 name = ecasound notify = 0
Jack: JackClient::AddClient name = ecasound, ref = 7 
Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_ecasound
Jack: JackClient::ClientNotify ref = 7 name = ecasound notify = 1
Jack: JackClient::RemoveClient name = ecasound, ref = 7 
Error: _get_jack_sample_rate():  (audioplayer.cpp:312)
Warning: AudioPlayer: Initialization of soundfile '/home/brandon/Music/test41k.wav' failed! (audioplayer.cpp:88)
Jack: JackClient::PortRegister ref = 6 name = BinauralRenderer:in_2 type = 32 bit float mono audio port_index = 20
Jack: JackClient::TransportLocate pos = 0
Jack: RequestNewPos pos = 0
Jack: JackClient::Activate
Jack: JackPosixThread::StartImp : create non RT thread
Jack: JackPosixThread::ThreadHandler : start
Jack: JackClient::kBufferSizeCallback buffer_size = 1024
Jack: JackClient::Init : period = 23219 computation = 100 constraint = 23219
Jack: JackPosixThread::AcquireRealTimeImp priority = 5
Jack: JackClient::ClientNotify ref = 6 name = BinauralRenderer notify = 2
Jack: JackClient::kActivateClient name = BinauralRenderer ref = 6 
Jack: JackClient::Connect src = BinauralRenderer:out_2 dst = system:playback_2
Jack: JackClient::ClientNotify ref = 6 name = BinauralRenderer notify = 18
Jack: JackClient::ClientNotify ref = 6 name = BinauralRenderer notify = 18
Jack: JackClient::Connect src = BinauralRenderer:out_1 dst = system:playback_1
Warning: Renderer is already processing. (controller.h:1275)
Jack: JackClient::TransportLocate pos = 0
Jack: RequestNewPos pos = 0
Jack: JackClient::ClientNotify ref = 6 name = BinauralRenderer notify = 18
Jack: JackClient::ClientNotify ref = 6 name = BinauralRenderer notify = 18
QApplication: invalid style override 'gtk' passed, ignoring it.
	Available styles: Breeze, bb10dark, bb10bright, cleanlooks, gtk2, cde, motif, plastique, Windows, Fusion
Fontconfig error: "/etc/fonts/local.conf", line 7: invalid attribute 'mode'
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
Jack: JackClient::Deactivate
Jack: JackClient::Deactivate res = 0
Jack: JackPosixThread::Kill
Jack: JackClient::Deactivate
Jack: JackClient::PortUnRegister port_index = 19
Jack: JackClient::PortUnRegister port_index = 20
Jack: JackClient::PortUnRegister port_index = 17
Jack: JackClient::PortUnRegister port_index = 18

I've tried a couple of different sound files, making sure that I'm matching sample rates, and the wave file is the right format, since the manual talks about certain issues with ecasound and the wave files. Each one was the right format (WAVE_FORMAT_PCM). I tried doing the sox conversion as well and that didn't help with this error.

I have also built and installed ecasound and ssr from source from the official Arch Linux PKGBUILDs to see if compiling on my machine would make a difference. This didn't help either.

What could I be doing wrong?

Thank you very much for your help with this!

@mgeier
Copy link
Member

mgeier commented Feb 25, 2021

Can you run ecasound on its own?

@brandflake11
Copy link
Author

brandflake11 commented Feb 25, 2021

Yes, I can run ecasound to play the file just fine using ecasound -i AUDIO_FILE_NAME.FLAC -o jack,system. I followed instructions from here thinking that the error could be related. Could it be an issue with libsndfile?

@mgeier
Copy link
Member

mgeier commented Feb 25, 2021

Sure, could be.

I guess the command that's used by the SSR is something like this:

ecasound -i sndfile,AUDIO_FILE_NAME.FLAC -o jack,system

It actually uses jack_generic, but I hope that's not relevant.

@brandflake11
Copy link
Author

I just tried that and it works fine, playing the audio file. I'm going to see if compiling libsndfile from source and then recompiling ecasound and ssr will fix this issue.

@mgeier
Copy link
Member

mgeier commented Feb 25, 2021

You could also try

export ECASOUND=/path/to/ecasound

@brandflake11
Copy link
Author

brandflake11 commented Feb 25, 2021

Just tried that, and that didn't work also. It did remove the ecasound environment variable warnings from the output though.

@brandflake11
Copy link
Author

I also tried compiling my own version of libsndfile, then ecasound, and then ssr to see if libsndfile was the problem. This also didn't result in any difference.

@mgeier
Copy link
Member

mgeier commented Feb 26, 2021

Hmmmm.

Do you have multiple versions of the libecasoundc library installed?

Maybe the ecasound program uses a different one than what's used when compiling the SSR?

TBH, I have no idea what's going wrong here.

If you don't get this to work, you can of course use any JACK-aware audio player to send signals to the SSR.

You can use something like the data/scenes/live_input.asd to use arbitrary JACK inputs in an SSR scene.

I you are adventurous, you can also try the new dynamic scene format I'm currently working on: #155.
This doesn't use Ecasound, but there might be a whole range of different problems ...

@brandflake11
Copy link
Author

It doesn't look like I have multiple versions of libecasound:
sudo find / -iname "*libecasoundc*"

./usr/bin/libecasoundc-config                                                                           
./usr/include/libecasoundc                                                                              
./usr/lib/libecasoundc.a 

I'll probably just use your live_input.asd, as jack makes piping things in easy. Thanks for pointing me to the new dynamic scene format as well, that looks really interesting.

Maybe others with this issue can figure out why this happened later, or hopefully it is just a problem with my setup of ssr.

@brandflake11
Copy link
Author

Hello again,
I am trying to load the live_input.asd file you put on your previous message, but I don't see any inputs from ssr in jack. I am loading it with this command:
ssr-binaural -s ~/Downloads/live_input.asd

Am I doing something wrong with it, or is the command not right?

@JensAhrens
Copy link
Contributor

JensAhrens commented Mar 2, 2021

The -s flag is for loading the reproduction "setup". Specify a scene in the same way you specified the audio file to be loaded: Don't use a flag, only specify the file. live_input.asd is a scene description, not a reproduction setup.

Admittedly, the fact that the specification of reproduction setups and of sound scenes uses the same format can be confusing....

@brandflake11
Copy link
Author

Thank you very much, I got my first sound from ssr! Sorry if this isn't about the issue anymore, but what is the difference between an ssr setup "-s" and config "-c" file?

@JensAhrens
Copy link
Contributor

Congrats!

-s specifies the geometry of the loudspeaker setup. You can also influence, which output channel is routed to which loudspeaker to some extent.

-c allows you to specify the default values for everything that you would otherwise specify via command line arguments so that you can avoid having to put the same command line arguments every time you start SSR. Examples are what HRTF set to load, what reproduction setup ;), and the like.

Here is an example of a config file that you would load with the -c flag.

@brandflake11
Copy link
Author

This makes much more sense. When do you need to use the -s option rather than just loading the .asd file directly?

@JensAhrens
Copy link
Contributor

JensAhrens commented Mar 2, 2021

That's for specifying the geometry of the loudspeaker setup if you don't want to use the default one.

One of the main design paradigms of SSR is the separation between the rendering setup and the sound scene. We wanted it to be possible to render the same sound scene with different rendering algorithms and setups (headphones, loudspeakers, etc.). What the description of the loudspeaker setup and the description of the sound scene have in common is that they contain a lot descriptions of geometry (position, orientation, etc.). That's why we're using the same file format for both.

In other words, the sound scene (or in the simplest case a plain audio file) is the input, which you load without a flag, and the loudspeakers are the output, which you load with the -s flag.

@brandflake11
Copy link
Author

Thank you, this also makes more sense. I guess now I just need to experiment. I still can't figure out why I can't load an audio file into ssr, but for now I'll just do live inputs!

@JensAhrens
Copy link
Contributor

Great, we're hoping you're going to enjoy it!

Let us know if you ever find the solution to this audio file problem.

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

3 participants