Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Failed to open audio device (AL_INVALID_OPERATION)  (Read 5928 times)

0 Members and 1 Guest are viewing this topic.

Kuliu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Failed to open audio device (AL_INVALID_OPERATION)
« on: November 02, 2020, 10:03:57 am »
When trying to load a sound from file it successfully loads then spams the output with

(click to show/hide)

This is the simple test code I'm running
           
int main() {
    sf::SoundBuffer test { };
    if (test.loadFromFile("explosion.ogg")) {
        sf::Sound test_sound { test };
        test_sound.play();
    }
}
 

Also note I'm running on Ubuntu 20.04.1 LTS using pulseaudio
I uninstalled pulseaudio and reinstalled it but the issue continues.
This problem doesnt occur when this is built out on windows so I'm not entirely sure what the issue is.

Kuliu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Failed to open audio device (AL_INVALID_OPERATION)
« Reply #1 on: November 03, 2020, 08:47:25 am »
After further inspection the issues occurs before the sound buffer is even loaded. Just created a sf::SoundBuffer period is the issue for me.

Kuliu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Failed to open audio device (AL_INVALID_OPERATION)
« Reply #2 on: November 03, 2020, 06:32:52 pm »
I found the issue, but I need help! It turns out the problem was CLion the IDE I'm using. For whatever reason when the program is ran inside of CLion the console is filled with openal errors, but when run from the terminal it works perfectly fine. Does anyone know which setting in an IDE could cause this issue?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Failed to open audio device (AL_INVALID_OPERATION)
« Reply #3 on: November 11, 2020, 01:45:12 pm »
Mabye when you run it from within CLion it picks up a different OpenAL DLL than the one you actually provide, so you might end up with an OpenAL version that's somewhere installed on your system, but not actually compatible with SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything