eris icon indicating copy to clipboard operation
eris copied to clipboard

Webm Streams sometimes end instantly.

Open macdja38 opened this issue 7 years ago • 19 comments

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 avatar Mar 15 '17 21:03 macdja38

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

macdja38 avatar Mar 28 '17 04:03 macdja38

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.

SinisterRectus avatar Mar 28 '17 05:03 SinisterRectus

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

abalabahaha avatar Mar 28 '17 05:03 abalabahaha

@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).

macdja38 avatar Mar 28 '17 06:03 macdja38

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

SomeoneCares11 avatar May 16 '17 21:05 SomeoneCares11

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

abalabahaha avatar May 16 '17 21:05 abalabahaha

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

SomeoneCares11 avatar May 16 '17 21:05 SomeoneCares11

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

macdja38 avatar Jul 10 '17 02:07 macdja38

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

Brayzure avatar Oct 30 '17 05:10 Brayzure

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

abalabahaha avatar Oct 30 '17 05:10 abalabahaha

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 avatar Oct 30 '17 06:10 macdja38

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

macdja38 avatar Oct 30 '17 06:10 macdja38

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

HcgRandon avatar Jan 25 '18 16:01 HcgRandon

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

urPlaceOrMine avatar Oct 10 '18 03:10 urPlaceOrMine

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.

macdja38 avatar Oct 10 '18 21:10 macdja38

Wait what how do USBs play into anything.

LJNeon avatar Oct 10 '18 21:10 LJNeon

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

abalabahaha avatar Oct 10 '18 22:10 abalabahaha

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…

macdja38 avatar Dec 19 '18 16:12 macdja38

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 https://github.com/abalabahaha/eris/pull/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

linkjay avatar Jan 16 '19 03:01 linkjay