jalibu / MMM-Jast

A minimalistic stock ticker based on Yahoo's finance API for the MagicMirror² platform.
MIT License
69 stars 22 forks source link

The ticker is choppy since MM 2.26 #64

Open hesspoint opened 10 months ago

hesspoint commented 10 months ago

Platform

Pi 4

Node.js Version

v18.18.0

MagicMirror Version

2.26

Module Version

lastest version

Description

I have been running the module for a few month w/out issues. Since I updated MM to 2.26 recently the ticker does not run smoothly anymore. It starts stopping ever second or so and then jumps a bit ahead. It is very choppy and nice to look at. Before it has never done that.

Expected behavior

No response

Current behavior

No response

Possible solution

No response

Steps to reproduce

same after every restart or Pi reboot

Log

No response

config.js

module: "MMM-Jast",
            position: "bottom_bar",
            config: {
                currencyStyle: "code", // One of ["code", "symbol", "name"]
                fadeSpeedInSeconds: 120,
                lastUpdateFormat: "HH:mm",
                maxChangeAge: 1 * 24 * 60 * 60 * 1000,
                maxWidth: "100%",
                numberDecimalsPercentages: 1,
                numberDecimalsValues: 2,
                scroll: "horizontal", // One of ["none", "vertical", "horizontal"]
                showColors: true,
                showCurrency: true,
                showChangePercent: true,
                showChangeValue: false,
                showChangeValueCurrency: false,
                showHiddenStocks: false,
                showLastUpdate: false,
                showPortfolioValue: false,
                showPortfolioGrowthPercent: false,
                showPortfolioGrowth: false,
                updateIntervalInSeconds: 300,
                useGrouping: false,
                virtualHorizontalMultiplier: 2,
                stocks: [
                    { name: "Tesla", symbol: "TSLA"},
                    { name: "Amazon", symbol: "AMZN"},
                    { name: "Apple", symbol: "AAPL"},
                ]
            }

Additional info

No response

jalibu commented 10 months ago

Hi Hannes, thank you for opening this issue. I can not really explain why the rendering performance of the module could be related to the new MM version. The rendering is done by the browser (these are normal CSS transition animations).

Probably, it could be that the general resource consumption is higher due to the new MM version and therefore less is left for rendering the ticker.

I don't have this problem, by the way. We can wait and see if other affected people get in touch.

stengelchristian commented 10 months ago

I can´t say if it was better in the past but I can confirm that at least on a new (active cooled) PI5 with fresh install its irregularly choppy. BUT AV STOCK Module looks exactly the same. not sure what causes it. But I think its not really pi or mm related as the horizontal scroll is choppy in any browser just looking at the readme on github page as well on a mac or pc

jalibu commented 10 months ago

@stengelchristian what do you mean with that?

BUT AV STOCK Module looks exactly the same

jalibu commented 9 months ago

Hi @hesspoint @stengelchristian

can you please checkout the latest version and share your feedback? I made some changes in the horizontal scrolling

stengelchristian commented 9 months ago

@stengelchristian what do you mean with that?

BUT AV STOCK Module looks exactly the same

I was referring to the https://github.com/lavolp3/MMM-AVStock Module, which also has a horizontal scroll. The scrolling motion had the same choppy behavior from time to time.

I just checked out the 2.9.2 commit, and I would say that it is less choppy, occurring less frequently but I will check again tomorrow then it´s updating stock data and displaying more content.

thx for looking into it.

Edit: It is definitely a lot better

KristjanESPERANTO commented 9 months ago

If it does occur again, you could perhaps try the following:

Instead of npm run start try export ELECTRON_ENABLE_GPU=1 && npm run start to start the mirror.

With MM 2.26.0 the GPU is disabled by default. This could be the reason why the horizontal scrolling is not running so smoothly since then.

jalibu commented 9 months ago

@sdetweil do you think it's worth thinking about adding this option to enable GPU rendering as an option for your installer scripts?

sdetweil commented 9 months ago

@jalibu but it takes more than that. the drivers in /boot/config.txt need to be set correctly, as I understand it

jalibu commented 9 months ago

@sdetweil I thought you are the no-limits-scripting-magic-wonder-man 😁

sdetweil commented 9 months ago

yes I can do lots of things.. IF I know what to do. for the video drivers I do NOT KNOW. seems like black.magic to me.

some drivers impact commands to manipulate display status

I know I can change the driver config on pi 4/5 to have two independent displays , instead of one big display over both monitors..

this is not my area of expertise.. I'll take advice and testing from others.

hesspoint commented 9 months ago

If it does occur again, you could perhaps try the following:

Instead of npm run start try export ELECTRON_ENABLE_GPU=1 && npm run start to start the mirror.

With MM 2.26.0 the GPU is disabled by default. This could be the reason why the horizontal scrolling is not running so smoothly since then.

I have tried that and yes then it and it is much smoother. However it also is not entirely smooth but at least it does not do these weird jumps.

The issue is though that I start my MM via pm2. Not sure if I can somehow enable the GPU there.

Or is there a setting somewhere in the MM config where I can enable GPU?

sdetweil commented 9 months ago

@hesspoint put it in the script that pm2 launches.

if using my install script that is ~/MagicMirror/installers/mm sh

you can also find this thru the pm2 info command

pm2 status will give u the name and number of the managed apps

pm2 info name/number

look for script path

BillYovino commented 4 months ago

Pi Zero 2W running Bullseye. I tried everything I could but the scrolling was still too jerky so I reverted back to my older version running on Buster which works fine. The vertical scrolling didn't look bad but I don't like how it behaves. It scrolls up one stock at a time but when it gets to the end of the list it scrolls down through all of them rapidly. A more natural way would just to continuously scroll up or down one at a time. I tried over-clocking but that yielded strange results and didn't fix the jerky motion.

sdetweil commented 4 months ago

you may have to enable the gpu for scrolling to be smooth

in 2.27 we turned it OFF by default to prevent errors MOST users have.

in the script that launches MM add export ELECTRON_ENABLE_GPU=1

before the npm start line

note you MAY have to change the /boot/config.txt to.make it work

andrewtwist commented 1 month ago

I'm experiencing the same choppy issue.

sdetweil commented 1 month ago

@andrewtwist did you see my post immediately before yours?

andrewtwist commented 1 month ago

Yes, I did see your post. It was still choppy even with your suggestion. But, now that it has been running for a few hours it seems to be more stable than when first started.

sanj926 commented 2 weeks ago

I saw no improvement after performing the fix you mentioned within the script that launches MM. How do I change the boot/config? What do I change in there?

sanj926 commented 2 weeks ago

I saw great improvement after disabling the display of seconds on my clock module!

sdetweil commented 1 week ago

awesome. i do mot know what to change in boot to enable the gpu