rhysmorgan134 / node-CarPlay

MIT License
131 stars 23 forks source link

Feature: optimise example video #70

Closed gozmanyoni closed 9 months ago

gozmanyoni commented 9 months ago

Optimizing example - removed unneeded transformations and methods and further simplified code. From testing on Pi 4 60FPS its usable with 40-65% cpu, before these changes CPU was 50-80%

@steelbrain @rhysmorgan134 curious if you have a similar experience on this branch?

rhysmorgan134 commented 9 months ago

I've done some testing

new changes

Screenshot 2023-10-06 at 21 01 01

current master branch

Screenshot 2023-10-06 at 21 01 05

jmuxer/electron

Screenshot 2023-10-06 at 21 10 03

Not particuarly useful as it's obviously a 1min average, but test was to go to map, choose navigate to work, let maps zoom in, then manually zoom out 5 clicks, then cancel route.

Worth noting, I am unsure how jmuxer scored so high, jmuxer @ 1080 @ 60fps feels the worst in the case of useablility but got the lowest averages, I am guessing it is just dropping frames so technically lowering the load, but causing severe lag.

I would say the new changes feel better, but I still think 1080 @ 60fps on all implementations doesn't feel "smooth". This is all with gpu mem set to 256mb on a pi4 4gb

gozmanyoni commented 9 months ago

Added more renderers - particularly interested in WebGPU (supposed to be faster than WebGL), which we need Vulkan for - planning to try and enable Vulkan on the pi following - https://qengineering.eu/install-vulkan-on-raspberry-pi.html

You can also enable fps reporting to see console logs with FPS every 5 seconds

steelbrain commented 9 months ago

Added more renderers - particularly interested in WebGPU (supposed to be faster than WebGL), which we need Vulkan for - planning to try and enable Vulkan on the pi following - https://qengineering.eu/install-vulkan-on-raspberry-pi.html

The referenced blog post seems very heavy weight just to try Vulkan, here’s something from ChatGPT https://chat.openai.com/share/bbaefbb3-9115-41c1-9cf9-0d4f3086dc53

Looks like it’s bundled in raspi repositories now?

rhysmorgan134 commented 9 months ago

Looks good to me, will give the different renderers a try when I get a chance!

gozmanyoni commented 9 months ago

@steelbrain - Was that on the mac or a pi? I didnt have a chance to get Vulkan configured and working properly on my Pi yet

steelbrain commented 9 months ago

@gozmanyoni It was on macOS, I spent a few minutes on the pi and gave up after Chromium didnt enable webgpu even after vulkan drivers were installed.

I can try again on the weekend and document what works and what doesnt

rhysmorgan134 commented 8 months ago

@gozmanyoni @steelbrain silky smooth on a pi5 even at 1080@60fps!

gozmanyoni commented 8 months ago

@rhysmorgan134 nice! Do you have a demo video?

Also - does the pi5 play well with PiMOST? No stock of these in Australia yet :-(

rhysmorgan134 commented 8 months ago

@gozmanyoni no video yet, will grab one though.

Pi5 itself seems to be working well with it, however bookworm is having issues with i2s and the simple-audio-card overlay!