batocera-linux / batocera-emulationstation

MIT License
322 stars 248 forks source link

theming: global.architecture filter stop working #1334

Closed pajarorrojo closed 1 year ago

pajarorrojo commented 2 years ago

Hi @fabricecaruso, the variable "global.architecture" and the old ifArch="xx" stopped working, global.architecture return nothing (empty) and ifArch does not filter correctly.

Tested in rpi4 last beta (bcm2711 - 36-dev-7429072794 2022/10/24 19:04)

Thanks!

fabricecaruso commented 2 years ago

Probably not related to ES, but to the compilation & BATOCERA_SYSTEM_ARCH variable ( as set here https://github.com/batocera-linux/batocera.linux/blob/master/package/batocera/emulationstation/batocera-emulationstation/batocera-emulationstation.mk#L18 ) @nadenislamarre Did something change on your side with RPI4 ?

nadenislamarre commented 2 years ago

ah probably. the rpi4 is now bcm2711 arch.

fabricecaruso commented 2 years ago

So what's the new defined constant ( #define BCM2711 ? ) passed to cmake (using -D ) ?

pajarorrojo commented 1 year ago

hi, any news about this? the problem persist and some theme functions works really bad with the issue

pajarorrojo commented 1 year ago

in rpi3 the same problem occurs, and makes slow the frontend (carbon theme) because all the storyboards, animations, text shadows and more effects are filtered by the ifArch variable which doesn't work. I can't test in more boards.

Tested with bcm2837 - 36-dev-b2c342e624 2022/12/03 23:01

nadenislamarre commented 1 year ago

-DCMAKE_CXX_FLAGS=-DBCM2711

yes.

fabricecaruso commented 1 year ago

Then ???

Named 'defines' for ES are declared here : https://github.com/batocera-linux/batocera-emulationstation/blob/master/es-core/src/platform.cpp#L449

Can you provide a correspondance table before/after for all changed plaforms ?

nadenislamarre commented 1 year ago

outch. however, why do we need this in fact ?

pajarorrojo commented 1 year ago

@nadenislamarre is a variable used in theming to filter content depending on the architecture. Right now, this is not possible on any rpi device, so if many on-screen effects, animations or videos are enabled because the filter doesn't work, they can slow down the frontend on these boards.

nadenislamarre commented 1 year ago

i really dislike the fact that themes are depending on the arch. there are many many arch. it is not possible to depends on that. i suggest a temporary fix:

std::string getArchString()
{
#if WIN32
    return "pc";
#endif

#if X86
    return "pc";
#endif

#if X86_64
    return "pc";
#endif

    return "sbc";
}

but even that i really dislike. we could add (in a later version) an es_capabilities.cfg file, init by the board maintainer for each board. and in these, such capabilities check :

fabricecaruso commented 1 year ago

It's working this way since almost 2 years - Jun 6, 2021 - this commit : https://github.com/batocera-linux/batocera-emulationstation/commit/7fd221b2afa4542134a13c3531463177c9739fe4

Many themes are now using this attribute. Change that, would force everybody to update their themes ( including carbon ). So I don't know if it's a good change.

nadenislamarre commented 1 year ago

i guess it is used for rpi only in themes. thus things are bugguy for other boards.

nadenislamarre commented 1 year ago

and many boards are missing now. for me, it was usable while there was a low number of boards.

pajarorrojo commented 1 year ago

I understand what you're saying, @nadenislamarre , but it's not only used for performance purposes, that's just a part, maybe the main one and most used, but not exclusive.

2 example scenarios:

If arch=windows we are in retrobat, therefore we can adjust certain elements of the theme for the retrobat users

If arch=x86 we have gamesplash and we can filter content by subsets on this screen too, these subsets do not affect the rest of the boards because gamesplash is not compatible and it can be confusing to show meaningless theme options.

These are just two examples, but with this I want to show that being able to filter by architecture is more versatile and something really useful for programming rich and well-adapted themes. I think that as long as exists important differences in the frontend for different boards, its necessary to be able to detect architectures from the theme code.

pajarorrojo commented 1 year ago

By the way, I think it's fixed, I just tested the latest rpi4 beta tonight and it's working again. Good job mates! Thanks

pajarorrojo commented 1 year ago

Solved!

https://github.com/batocera-linux/batocera-emulationstation/commit/26d194ea5bc3fe132e998a357b85f5fc76d6a54c