Giter Site home page Giter Site logo

Comments (9)

sedmelluq avatar sedmelluq commented on July 20, 2024

It seems as if something is calling Thread#interrupt() on that thread. The library itself should only ever trigger interrupts on the threads which fill the audio buffers, so I can't think of how it could be the cause.

If you can reproduce it locally, maybe you can set a breakpoint on Thread#interrupt() to see what is calling it for that thread?

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

I can reproduce it every time, and it happens on both my Desktop(running win10 and jdk1.8_121) and my macbook pro (running Mac OS X El Capitan and jdk1.8_60)

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

Well I figured out the cause, There was multiple threads trying to call <AudioPlayer>.provide() to send the next packet to the udpSocket. But, it just fails to load tracks from soundcloud altogether now.

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

So, I figured out that tracks from Sound Cloud need some time before they can be played.

from lavaplayer.

sedmelluq avatar sedmelluq commented on July 20, 2024

Still does not resolve your core problem that at the moment you call .provide(), your thread is in the interrupted state. The code which throws the actual exception:

        if (Thread.interrupted())
            throw new InterruptedException();

While your thread is in that state, any blocking operation may throw an exception like that.

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

Ok, but while I was running through the stack trace in debug with the break point I set I noticed that if a SoundCloudAudioTrack is played as soon as AudioLoadResultHandler#trackLoaded(AudioTrack track) is called it hasn't started to load the audio and ends with LOAD_FAILED before beginning to load the audio.

I noticed this because AudioPlayer#provide() wasn't throwing the error until it had been called like 13~16 times, and each of those times it returned a terminator frame.

But if I put a youtube track in before the soundcloud track and let it play through the youtube one, it was able to load the one from soundcloud.

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

also I don't start calling AudioPlayer#provide() until after AudioEventAdapter#onTrackStart() is called, which usually happens a few seconds after I call AudioPlayer#playTrack(track)

from lavaplayer.

sedmelluq avatar sedmelluq commented on July 20, 2024

If you ever get LOAD_FAILED, get the stack trace as well. Terminator frame is only produced once per track (and is consumed by AudioPlayer internally).

Did you ever find what was interrupting that thread though?

from lavaplayer.

R3alCl0ud avatar R3alCl0ud commented on July 20, 2024

I'm pretty sure that my code was borked and was trying to call AudioPlayer#provide() several times before AudioPlayer#provide() was able to return an AudioFrame for any of the calls.

Either way I have already fixed the issue on my end, so I'm going to close this issue.

from lavaplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.