Jellyfin Forum
App error and playback pausing with RPi4 & Google TV - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: App error and playback pausing with RPi4 & Google TV (/t-app-error-and-playback-pausing-with-rpi4-google-tv)



App error and playback pausing with RPi4 & Google TV - finbarberkon - 2024-08-05

Hello,

I'm having trouble with my Jellyfin setup which I recently setup for the first time.

My setup
I am running jellyfin (v10.9.8) on a Rapsberry Pi (RPi) 4 with a USB SSD directly attached for storage. The Pi has generally been connected to my network via WiFi, though I recently moved it over to Ethernet. The client is the Jellyfin app on "Chromecast with Google TV", which is connected via WiFi. I do not stream from any other devices.

The problem
When I attempt to watch TV or movies, the playback will stop as often as every 5 minutes in the worst case, but at least once per 45 minute TV episode in the best case. The playback stops and the app on the TV will show an error along the lines of "App error. Will retry". Sometimes it successfully retries, but most of the time it fails to resume after 1-2 minutes. If I attempt to back out of the player, and re-start the playback, the app is often very slow and sometimes just completely crashes (there are crash reports included in attachments below). At these times it can even be slow to ssh into the RPi.

My rudimentary debugging
These hangs often occur in close proximity to SQLite Error 5: 'database is locked' errors appearing in the jellyfin logs. These can appear immediately after the Failed executing DbCommand error like this:

[2024-08-05 18:39:46.116 +10:00] [ERR] Failed executing DbCommand ("30,088"ms) [Parameters=["@P10='?' (DbType = Int32), @p0='?' (Size = 32), @p1='?' (Size = 10), @p2='?' (Size = 7), @p3='?' (DbType = DateTime), @p4='?' (DbType = DateTime)
""UPDATE \"Devices\" SET \"AccessToken\" = @p0, \"AppName\" = @p1, \"AppVersion\" = @p2, \"DateCreated\" = @p3, \"DateLastActivity\" = @p4, \"DateModified\" = @p5, \"DeviceId\" = @p6, \"DeviceName\" = @p7, \"IsActive\" = @p8, \"UserId\" =
WHERE \"Id\" = @P10
RETURNING 1;"
[2024-08-05 18:39:46.120 +10:00] [ERR] An exception occurred in the database while saving changes for context type '"Jellyfin.Server.Implementations.JellyfinDbContext"'."
""Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
[...]

Or along with a Error processing request like this:

[2024-08-05 18:40:13.113 +10:00] [ERR] Error processing request. URL "GET" "/videos/fec2cec8-189e-ee83-2f26-9bac1e03917c/hls1/main/25.ts".
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'.
  at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
[...]

(or I'm just reading the logs)

While monitoring with htop, I can see that the RPi's CPU usage while streaming does not seem excessive. Generally, the CPU usage is <10% but sometimes ffmpeg will run for a while pinning 1 of the 4 CPU cores. I've never seen CPU usage of more than 1 core at 100% and another core at ~20-30%. Though, the fact ssh is slow to respond at these times does seem to suggest the RPi is struggling.

I've attached the entire contents of /var/log/jellyfin compressed in a zip file. This covers the last 5 or so days of use, since I first setup the server.

Questions
Could you please help me get my jellyfin server working more consistently?

If the logs suggest this is just because my RPi is not powerful enough for my use case, I am happy to upgrade. But I wouldn't want to do so if this is more a software issue.

Thank you :)


RE: App error and playback pausing with RPi4 & Google TV - TheDreadPirate - 2024-08-05

Is the SSD only hosting the media or is Jellyfin running off of it?


RE: App error and playback pausing with RPi4 & Google TV - finbarberkon - 2024-08-09

The SSD was only hosting the media, but the issue still seems to have been with the Raspberry Pi.

I did some further testing and everything pointed to the Pi being the bottleneck. So I decided to buy a more powerful computer to host the server (an Intel N100 platform mini PC as suggested in the docs). So far it seems to be working flawlessly.

The error messages were very confusing, though. They really didn't point me towards issues with the hardware. But on the new hardware they don't show up, and there's no issues with playback. So perhaps SQLite Error 5: 'database is locked' errors can be a symptom for the hardware not being sufficient to run Jellyfin.

I'm not sure what exactly the problem was, but the issue is now resolved with new hardware :)


RE: App error and playback pausing with RPi4 & Google TV - TheDreadPirate - 2024-08-09

(2024-08-09, 12:53 PM)finbarberkon Wrote: I'm not sure what exactly the problem was, but the issue is now resolved with new hardware Smiling-face

More power solves all problems.