question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on desktop (Music) Unable to allocate audio buffers

See original GitHub issue

I have no idea why it happens. I am getting “Unable to allocate audio buffers” exception. It’s throwed from OpenALMusic.play(). Unfortunately I can’t check what alGetError() returned because you are checking only if it has error or not.

When it happens: Only on desktop when I am switching between menu and game scene. Sometimes I have to switch few times, sometimes several times but it happens pretty randomly.

What I’ve found so far: -I don’t use negative volume of the music -I dispose music. The code fragment below is even more I need because I clear the manager after all but it still doesn’t help.

        Array<Music> tempMusicsListToStop = new Array<Music>();
        gameSpecialMeta.manager.getAll(Music.class, tempMusicsListToStop);  
        for(Music music : tempMusicsListToStop){
            music.stop();
            music.dispose();
        }
                    gameSpecialMeta.manager.clear();

It’s called everytime in MenuScreen constructor.

What can be wrong? Is it possible that it’s internal bug or something?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomnomcommented, Jul 12, 2016

HI I GOT IT (mb just for me) if you try to play ANY type of sound after you dispose/or switched to a new screen in any way you will find this error. just make sure no sonds are playing (even the shortest ogg) after you commanded to switch screens/ dispose.

0reactions
cebesscommented, Aug 9, 2021

I have had this happen when I added a fade out and then volume was set to less than zero. Once ensured the volume never went below zero – things worked as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Game crashes on disasters or even small fire... - TheoTown
Just bought on steam and game keeps crashing when something gets destroyed, ... (Windows 10 PC) ... GdxRuntimeException: Unable to allocate audio buffers....
Read more >
Audio problems and crashing - Microsoft Community
1. Open run box by pressing Windows Key + R and type devmgmt. · 2. Locate and expand Sound, video and game controllers...
Read more >
Avoid system overloads in Logic Pro - Apple Support
System overloads can occur when your Mac doesn't have enough processing power to play back or record audio. Use the techniques in this...
Read more >
Digital Performer Troubleshooting tips for audio problems ...
Raise the buffer size one step at a time, and see if performance improves. While you do this, it helps to watch the...
Read more >
Libgdx Audio Buffer Error - Stack Overflow
So I have being using libgdx for a while and along with that I am playing music in the game. Now the problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found