SoundScapeRenderer / ssr

Main source code repository for the SoundScape Renderer
http://spatialaudio.net/ssr/
GNU General Public License v3.0
132 stars 52 forks source link

Can't run ssr-binaural: default_hrirs.wav" has sample rate 44100 instead of 48000! #68

Open Harvie opened 7 years ago

Harvie commented 7 years ago

I'm running SSR 0.4.2 on archlinux and when i execute ssr-binaural it gives me this error:

terminate called after throwing an instance of 'std::logic_error'
  what():  Error loading HRIR file: apf::load_sndfile(): "/usr/share/ssr/default_hrirs.wav" has sample rate 44100 instead of 48000!
Aborted (core dumped)
chohner commented 7 years ago

Try re-starting your jack server at 44100 Hz.

Harvie commented 7 years ago

Yes, that works. But i want to use SSR with pulseaudio via pulseaudio-jack compatibility layer. And changing pulseaudio sample rate didn't helped.

mgeier commented 7 years ago

If you want (or have) to use 48000 Hz, you can simply re-sample the bundled HRIRs. Or you can choose any other set of HRIRs that's available in the right sampling rate.

The SSR does currently not resample any impulse responses, see also #32 and #16.

Harvie commented 7 years ago

does it really make sense to recalculate HRIRs to higher sample rate? i mean: you will not get higher quality or something... maybe it's ok to only convert sample rate of final rendered wave just before the output to soundcard.

JensAhrens commented 7 years ago

No, you do not get higher quality by upsampling, of course. People suggested upsampling so that you can readily process all your 48-kHz-files in SSR. Resampling the HRIRs is certainly less effort than resampling the output of SSR.

mgeier commented 7 years ago

You most likely all know that already, but just for the record:

The SSR can and will re-sample "normal" audio files that are used as sources in a scene (thanks to Ecasound with libsamplerate support). The limitation is that the HRIRs/BRIRs/WFS pre-filters have to match the JACK sampling rate (or vice versa).

agraef commented 3 years ago

But in any case it shouldn't then just abort with an unhandled exception, should it? Here is what I get when running ssr-binaural on Manjaro with Jack running at 48 KHz:

       ___     
      /  ___   
  ___/  /  ___ 
    ___/  /    SSR (SoundScape Renderer) builduser202007080114
         /     

Website: <http://spatialaudio.net/ssr/>
Contact: <ssr@spatialaudio.net>

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.
terminate called after throwing an instance of 'std::logic_error'
  what():  Error loading HRIR file: apf::load_sndfile(): "/usr/share/ssr/default_hrirs.wav" has sample rate 44100 instead of 48000!
Aborted (core dumped)
mgeier commented 3 years ago

You are absolutely right @agraef, letting the exception bubble up is very lazy.

The latest master version has some basic exception handling, though:

https://github.com/SoundScapeRenderer/ssr/blob/85dc4d5b6a9a6c5fb3aa0d75d9d818496286c71b/src/ssr_main.h#L56-L60

I've even added signal handling recently: #230

Unfortunately, there hasn't been a new release since ...

agraef commented 3 years ago

@mgeier No worries, it's just something I ran into, and coming here I noticed the existing bug report. I'll try the latest master then. In fact, I'm mostly interested in the Pd externals, and as these aren't included in the Arch package, I'll have to build SSR myself anyway.