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

buffer loop exception:Reserve size (61100564) exceeds max_allocation (46976204) #1554

Open
atomheartother opened this issue Dec 6, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@atomheartother
Copy link

Software Versions

  • Jellyfin Server Version: 10.8.13
  • Roku Client Version: 1.6.6, also occurs on unstable

Describe the bug

When viewing a very long movie in 4k, the roku video client crashes after a long time ( 2h4min on the specific video I use as test). Trying to resume at this time plays the video for a second or two max before the client crashes again. Neither the server nor client print anything in the logs, it just exits.

How To Reproduce

  • Put on a long high-quality movie (I'm playing the Dark Knight in 4k with 5.1 audio, that's a 22GB file total)
  • Skip late in the file (for me, around 2h does it)
  • The client crashes, every time

Expected behavior

  • Client should keep reading

Logs

There's nothing printed in the logs at the time of the crash. I took a second and edited VideoPlayerView.bs to add some logging. This prints the following values at run time when the crash occurs:

  • m.top.errorCode: -3
  • m.top.errorMsg: "An unexpected problem (but not server timeout or HTTP error) has been detected."
  • m.top.errorStr: "buffer loop exception:Reserve size (66186340) exceeds max_allocation (46976204):extra:etype:buffer"

Connection Information

  • Is server local or remote? Remote
  • Is server connection HTTP or HTTPS? HTTPS

Some more info about the file I'm using to reproduce if that could help:

Video
Title: 4K HEVC HDR
Codec: HEVC
Profile: Main 10
Level: 153
Resolution: 3840x2160
Aspect ratio: 16:9
Interlaced: No
Framerate: 23.976025
Bitrate: 20287 kbps
Bit depth: 10 bit
Video range: HDR
Video range type: HDR10
Color space: bt2020nc
Color transfer: smpte2084
Color primaries: bt2020
Pixel format: yuv420p10le
Ref frames: 1


Audio
Title: English - DTS-HD MA - 5.1 - Default
Language: eng
Codec: DTS
Profile: DTS-HD MA
Layout: 5.1
Channels: 6 ch
Bitrate: 3814 kbps
Sample rate: 48000 Hz
Bit depth: 24 bit
Default: Yes
Forced: No
External: No

Since I really don't know much about Brightscript or roku development I'm not quite sure where to go from there but if someone wants to point me in the right direction, I'm a dev fueled by rage so I'll do anything to get to the bottom of this one.

@atomheartother atomheartother added the bug Something isn't working label Dec 6, 2023
@atomheartother
Copy link
Author

atomheartother commented Dec 6, 2023

After staring at this error message long enough, I feel like this is essentially telling me my TV literally cannot load this file into its internal buffer because it's too large, does this interpretation make sense? I should mention it's not the highest quality tv.

@1hitsong
Copy link
Member

1hitsong commented Dec 6, 2023

After staring at this error message long enough, I feel like this is essentially telling me my TV literally cannot load this file into its internal buffer because it's too large, does this interpretation make sense? I should mention it's not the highest quality tv.

That's exactly what this is. I had the exact same issue and asked the Roku devs what the error message means since it's not exactly in helpful terms.

They said this is an error thrown from deep within the Roku device that essentially means "Out of Memory."

I personally only had this on my older Roku device. Playing the same file on the 4K Roku sticks had no problems.

@atomheartother
Copy link
Author

@1hitsong I figured as much. Ah well at least I learned how to debug jellyfin on my tv. It's a shame it can't handle my power level.

While I'm at it, would you be ok with an MR adding some logging in case of playback errors? I have the code right here, I can clean it up and commit.

@cewert
Copy link
Member

cewert commented Dec 6, 2023

  1. Did you guys try playing the files using the Roku Media Player app? It's a media player made by roku and works with jellyfin over DLNA. If the file does the same thing then there's nothing we can do. If the file plays fine that would indicate we might be doing something wrong
  2. Can you guys list your device model# in case this is a device specific thing? It should be in the debug logs as well as on the web client admin dashboard if using unstable. It's a 5 digit code and should match up with one of the devices listed here: https://developer.roku.com/docs/specs/hardware.md

@atomheartother
Copy link
Author

atomheartother commented Dec 6, 2023

@cewert Isn't DLNA just for home networks? My jellyfin instance is remote I'm afraid.

@atomheartother
Copy link
Author

Found my model in the jellyfin dashboard, thanks for the tip :)

It's C000X

@cewert
Copy link
Member

cewert commented Dec 6, 2023

@atomheartother afaik yea it's local only. It also works with the roku device's USB if that's available and you can get your hands on the file.

If I remember correctly, 1hitsong has a TCL roku TV as well but I'll wait for him to report back before jumping to conclusions :)

Devices that reported this issue:

@atomheartother
Copy link
Author

I guess it's time to download this file and set up a local server. Thanks for the pointers, I will be back with results.

@1hitsong
Copy link
Member

1hitsong commented Dec 6, 2023

Video works when playing off USB thumb drive.

Video works when playing over DLNA.

Video stops mid-play with the error when playing through JF Roku client.

32S331 (32 TCL Roku TV)
Jellyfin Roku 1.6.6

@atomheartother
Copy link
Author

atomheartother commented Dec 6, 2023

Ok well I wasn't getting any sound, i think because my local server wasn't transcoding, but the file did play after the 2h mark and well into the zone where it failed via Jellyfin, using Roku Media Player over DLNA.

@cewert
Copy link
Member

cewert commented Dec 7, 2023

@atomheartother 1hitsong and I were talking and we might have figured this out. The fix in #1557 prevents the crash for him. If you get a chance can you test your file with the PR too? 🤞

@atomheartother
Copy link
Author

Nope! I just tried it with that branch and it failed still. I also printed errorStr and it's the same message.

I also tried to ignore the tv's max resolution and set MaxVideoDecodeResolution to 1920x1080, that also did not solve it unfortunately.

@atomheartother
Copy link
Author

So, I'm looking at stream & transcoding information, if this helps at all the way the stream works is that the audio is being transcoded (because the original stream is 5.1) but the video is being direct played in 4K HEVC HDR.

@1hitsong
Copy link
Member

1hitsong commented Dec 7, 2023

@atomheartother In the web client, go to the Administration Dashboard. Click on users and then your user account. Under Media playback, what do you have and not have checked?

image

@atomheartother
Copy link
Author

Here it is:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants