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

Webm Streams sometimes end instantly. #213

Open
macdja38 opened this issue Mar 15, 2017 · 19 comments
Open

Webm Streams sometimes end instantly. #213

macdja38 opened this issue Mar 15, 2017 · 19 comments

Comments

@macdja38
Copy link
Contributor

Tested this with abal the other day without finding a decent solution. Every now and then a webm result from youtube-dl / ytdl pops up that eris refuses to play and instantly skips. using the same https.get method eris uses I can pipe the stream into a file, then play that file though eris, but when fed directly the URL of the stream eris fires an end event instantly.

@macdja38
Copy link
Contributor Author

https://pvpcraft.ca/i/6lgu9.png which states the reason as the one emitted by this reason I've added in here https://github.com/macdja38/eris/blob/voice-error/lib/voice/VoiceConnection.js#L438

@SinisterRectus
Copy link
Contributor

Some Discordia users have reported similar occurences. Their streams stop while using youtube-dl and FFmpeg. Likewise, the audio can be fully downloaded to a file and played without issue. I'll keep an eye on this issue, but I'd sooner blame the reliability of a YouTube stream before anything else.

@abalabahaha
Copy link
Owner

abalabahaha commented Mar 28, 2017

This problem appears to be specific to webm/opus streams though (which bypass FFmpeg entirely)... and I think Mac is using his thing that resumes the stream on ECONNRESET, so that wouldn't be an issue here

@macdja38
Copy link
Contributor Author

@abalabahaha @SinisterRectus I can confirm that downloading and playing from a file fixes it... and playing the same song over and over again will reliably skip it. the skip happens with or without my stream-resume library (none of the skips pictured were caused by econnresets, and my library handles those when they pop up).

@SomeoneCares11
Copy link

i was having this problem using npm install node-gyp
solved after install node-gyp with -g npm install -g node-gyp

@abalabahaha
Copy link
Owner

Interesting... because the Webm parser does not use node-gyp in any way

@SomeoneCares11
Copy link

@abalabahaha i solved it in two bots with that command, try it.

@macdja38
Copy link
Contributor Author

@SomeoneCares11 I tried it and it didn't work.

@Brayzure
Copy link
Contributor

Are there any more instances of this behavior occurring? More than three months without any followup suggests there aren't.

@abalabahaha
Copy link
Owner

abalabahaha commented Oct 30, 2017

Yeah, but still don't have a solid repro method

@macdja38
Copy link
Contributor Author

It definitely still happens, problem is the urls it happens on seem to be temporary and it seems to depend where they are fetched from. If I download the file using something like wget then eris can play them, but without doing that trying to stream skips.

@macdja38
Copy link
Contributor Author

Also nooblance confirms he is having the same issue, though he's not testing on the latest version of eris.

@HcgRandon
Copy link
Contributor

I've definitely experienced this issue as well, sadly it seems very random.

@urPlaceOrMine
Copy link

urPlaceOrMine commented Oct 10, 2018

hi-- i don't think this is an ERIS issue. Can we see if this is a USB power management issue. (for Windows users). You need to go to device manager and turn off USB power management.
usb power management.
there is a setting for the device and the usb hub. There is also a similar setting for the network card. All three of these play a part in the success of your app. IMHO.

Even if you set the confuser (computer) to high performance try changing these settings.
--Drop me a note and let me know your experience after changing these settings.

UPoM

well sorry I missed this was sorted out

@macdja38
Copy link
Contributor Author

It's not sorted out, and I don't know if I speak for all of us but random and I def had this problem on linux not windows.

@LJNeon
Copy link
Contributor

LJNeon commented Oct 10, 2018

Wait what how do USBs play into anything.

@abalabahaha
Copy link
Owner

This is caused by a (still unknown) parser bug, and is unrelated to power or networking system settings.

@macdja38
Copy link
Contributor Author

macdja38 commented Dec 19, 2018

So… the bug may actually be that nothing ever bothers to check that it's not trying to parse text / html… on like a redirect page. Also the error handling is not great in that whole region, along with not checking for non 200 response codes from http.get, they are technically successes from the perspective of making a request, so they won't trigger the error handler and if they have a body they get piped to the audio decoder…

@linkjay
Copy link

linkjay commented Jan 16, 2019

Hello all,

There is a very large chance that this is caused by a buffer read/write issue as I documented in my PR here #451

Try modifying that file on your own in your node_modules with my commit there and see if this will still happen.

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants