colloqi / piSignage

Digital Signage Player Software for Raspberry Pi, more details at
http://pisignage.com
587 stars 251 forks source link

piSignage gets incredibly laggy, then stuck on webpage #194

Open dxf opened 1 year ago

dxf commented 1 year ago

Using a Raspberry Pi 4 running piSignage 4.7.3 - every time a webpage loads (in my case, the weather example which I've put on a Github Pages instance), the ticker slows to a crawl, and the playlist doesn't move past it. I've checked htop, and CPU usage is under 60% on all cores.

For context; my webpage is set to last 10 seconds, and has been going for about 10 minutes now.

dxf commented 1 year ago

Missing context: Using self-hosted piSignage server, when navigating to the client itself it seems under the impression that it's moving through the playlist just fine (I can skip assets and it's going through the rest of the images), but nothing changes on screen.

Snippet from forever_out.log

2022-11-14T14:54:23: Spawning wget -rNnHd,--follow-tags=a,--no-parent,--no-check-certificate,-t,20,--waitretry,60,--retry-connrefused,--no-cache,-R,default,192.168.52.129:3000/sync_folders/daf/default; with PID 21778
2022-11-14T14:54:27: wget stopped with code 0 and signal null; downloadInProgressCount: 1
2022-11-14T14:54:27: Copied server files for the group default successfully.
2022-11-14T14:54:27: Stopping Lounge music
2022-11-14T14:54:27: Change playlist,deleting files: default.tmp
2022-11-14T14:54:27: the total SD card usage, total: 29G,used: 5.2G,available: 22G
2022-11-14T14:54:27: *** Changing Playlist *** to MainList
2022-11-14T14:54:28: Chrome loaded page for screen: 0 /layouts/1.html;?screen=0&token=840
2022-11-14T15:12:14: *** trying with http protocol for websocket as https to server returned status undefined
2022-11-14T15:12:14: Starting websocket client to ws://192.168.52.129:3000/websocket
2022-11-14T15:12:14: Websocket: connected to server
dxf commented 1 year ago

There's some kind of error relating to controlling the window with the webpage on it that just occurred while I was looking, unsure if this is normal behaviour but it seems to have just reloaded (i.e it's gone in a full circle around the playlist, and opened a new version of the web page.)

forever_err-2.log

Here's my error log from the Pi itself - there are some Chromium related errors there that might help.

Thanks!

colloqi commented 1 year ago

From the error log, it looks like player is not able to reach server properly

FAILED COPYING SERVER FILES: 4

Can you try server address as http://192.168.52.129:3000

dxf commented 1 year ago

Just tried that, it seems to be working fine now. Might be worth including a hint to prefix in the config window for setting server?

Not sure how I missed the copy fail in the log, though... My bad on that LOL

dxf commented 1 year ago

A couple of hours of (successful) testing later, it's now stuck on the webpage again. Still cycling round in the background. Logs:

forever_out-2.log forever_err-3.log

It's consistently spitting out warnings about Gtk and chromium, i.e Gtk-WARNING **: 10:02:51.699: Theme parsing error: gtk.css:5:116: 'height' is not a valid property name so I think that may be the issue

It's that, and a websocket timeout for DevTools, which also makes sense as a candidate:

2022-11-14T15:11:44: WebSocket connection unexpectedly closed, reason: undefined 2022-11-14T15:11:44: Retrying webcosket connect in 30000ms, 1006

AbhijithBn commented 1 year ago

Hi,

We see socket 1006 close event which is why it might be trying to reconnect and download the assets in loop. Can you please confirm if the server is up to date with the latest release from https://github.com/colloqi/pisignage-server ?

The errors regarding gtk-css can be ignored since it is due to theme selection in Pi.

Regards Abhijith

dxf commented 1 year ago

I'm on version hash: 540353, Nov 6 2022 - which is the latest version according to Docker Hub.

dxf commented 1 year ago

Server logs leading up to freezes:

2022-11-15 11:55:50 **** 2022-11-15 11:55:50 After update if you do not see your groups, please change 2022-11-15 11:55:50 change the uri variable to "mongodb://localhost/pisignage-dev" 2022-11-15 11:55:50 in config/env/development.js and restart the server 2022-11-15 11:55:50 ** 2022-11-15 11:55:50 2022-11-15 11:55:50 info: socket.io started 2022-11-15 11:55:50 Express server listening on port 3000 in production mode 2022-11-15 11:55:50 Reset isConnected for 1 players 2022-11-15 11:55:51 **** 2022-11-15 11:55:51 system check passed 2022-11-15 11:55:51 **** 2022-11-15 11:55:51 Downloading http://pisignage.com/releases/package.json 2022-11-15 11:55:51 #Done 2022-11-15 11:55:54 Downloading http://pisignage.com/releases/package-p2.json 2022-11-15 11:55:54 #Done 2022-11-15 11:56:36 disconnect: undefined-Canteen;reason: undefined 2022-11-15 12:12:24 400000003280ebe2 2022-11-15 12:12:24 corrupt log file: /home/pi/forever_out.log 2022-11-15 12:27:24 400000003280ebe2 2022-11-15 12:27:24 corrupt log file: /home/pi/forever_out.log 2022-11-15 11:55:50 (node:1) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect. 2022-11-15 11:55:50 (Use node --trace-deprecation ... to show where the warning was created) 2022-11-15 11:55:50 (node:1) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. 2022-11-15 11:55:50 (node:1) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. 2022-11-15 11:55:50 (node:1) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.



Edit: remove restart log, that was me changing a config value, everything after is untouched
AbhijithBn commented 1 year ago

Can you try uploading https://daf.lol/datetime-with-weather/datetime-with-weather.html to your server as a weblink instead of a webpage with CORS Support?

The idea is to show it in an iFrame instead of using a puppeteer.

I tested the weblink & webpage at my end and I'm able to view both correctly.

dxf commented 1 year ago

@AbhijithBn

I've added as a weblink, but the weather asset requires CORS I'm pretty sure to get the data, so no weather data sadly.

Will let you know if I cross the same bug with it getting stuck.

Cheers

dxf commented 1 year ago

After further testing, I can confirm it doesn't get stuck, but because the asset needs CORS, I need to be able to use the webpage with CORS support mode.

nb - It normally takes a couple of cycles of my 10+ slide gallery before it gets stuck.

If you'd be happy to jump on a call to debug this before I buy licences and deploy, I'd be happy to oblige.

Cheers!