Android issue collection
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- android, rust
- Ambito
- game-dev, mobile-dev
Direzione di ricerca
The report groups several Android problems across winit, GameActivity touch handling, Bevy threading, rendering, background CPU use, timing, picking, audio, and lifecycle events. Start by choosing one symptom and tracing its linked issue or Bevy entry point; the report gives device and Android version details but no specific Bevy files or tests. Done would require a separately scoped issue with a reproducible case and a fix validated on Android.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I discovered these issues on 2 phones with bevy v0.19.* and I think all of them persist in
v0.20.*.
Devices:
- Samsung Galaxy A33 (Android 16 | Display 60Hz/90Hz)
- Samsung Galaxy S20 (Android 13 | Display 60Hz/120Hz)
Solving or patching the issues below I could reach CPU and GPU usages that are somewhat in range of
the app in Godot but I used GPUWatch from Samsung and I don't know how accurate this is.
ndk: 29.0.14206865
minSdk: 29
targetSdk: 37
GPU backend: Vulkan
winit
Android RecreationAttempt failure: https://github.com/rust-windowing/winit/issues/3325
There is a patch for this issue that I use: https://github.com/rib/winit/commit/c28e425214e82bdb86dcdf89c9488554a18e24b2
Crash when there are more than 8 touches (GameActivity)
- https://github.com/bevyengine/bevy/issues/16798
- https://github.com/rust-mobile/android-activity/issues/175
- Reopen: https://github.com/rust-mobile/android-activity/issues/253
Workaround patch: https://github.com/Johannes0021/android-activity/commit/d31a501a252a2dbb359bd7b4673128017aab7746
bevy
Allow AndroidApp handle activity recreation: https://github.com/bevyengine/bevy/pull/26015
After this fix the LogPlugin can be disabled in subsequent recreations in DefaultPlugins to
prevent error logging.
static FIRST_BUILD: AtomicBool = AtomicBool::new(true);
if !FIRST_BUILD.swap(false, Ordering::Relaxed) {
plugins = plugins.disable::<LogPlugin>();
}
multi_threaded feature:
Setting device fps to 90(A33) or 120(S20) even for simple apps the fps are unstable which ist not a nice experience.
Single-threaded it runs smooth like butter. I know that there is overhead using multiple threads and
that mobile phones are low power devices that aggressively save power, but I can't believe that my
app runs single-threaded no sweat and multi-threaded it's lagging.
I noticed that MSAA uses a lot of GPU power which makes sense but I was very confused that it is
enabled by default and I did not know why my GPU usage was so high.
Rendering on native resolution, a simple app can't hit 60fps (GPU maxed out).
The app is killed in the background because of CPU usage (~after 1h in bg). I had to disable the audio feature in
bevy, because the audio thread was still using too much CPU in the background.
Solved in a workaround replacement plugin for bevy_audio: https://github.com/Johannes0021/bevy_mod_audio
After that, I had to fix the remaining CPU usage with:
app.insert_resource(WinitSettings::game())
.add_systems(Update, update_winit_settings_on_lifecycle);
// ...
fn update_winit_settings_on_lifecycle(
mut winit_settings: ResMut<WinitSettings>,
mut lifecycle_messages: MessageReader<AppLifecycle>,
) {
for msg in lifecycle_messages.read() {
match msg {
AppLifecycle::Suspended => {
*winit_settings = WinitSettings {
unfocused_mode: bevy::winit::UpdateMode::Reactive {
wait: Duration::from_secs(1),
react_to_device_events: false,
react_to_user_events: false,
react_to_window_events: false,
},
..WinitSettings::game()
};
}
AppLifecycle::Running => *winit_settings = WinitSettings::game(),
AppLifecycle::Idle | AppLifecycle::WillSuspend | AppLifecycle::WillResume => (),
}
}
}
I also noticed that the delta time is very unstable and causes animations to stutter. If I force the
delta time to 60 fps, the animations are smooth. I think there may be a problem with the delta time
calculation. I wrote a small plugin that tries to work around this problem by smoothing the delta
time. It's a bit rough: https://github.com/Johannes0021/bevy_mod_time_smoothing.git
This greatly improves GPU performance:
DefaultPlugins.set(RenderPlugin {
render_creation: RenderCreation::Automatic(Box::new(WgpuSettings {
priority: WgpuSettingsPriority::WebGL2,
limits: WgpuLimits::downlevel_webgl2_defaults()
.using_resolution(WgpuLimits::default()),
..default()
})),
..default()
})
I think I also had issues with bevy_picking with touch input being cancelled and reported by winit but without receiving a release or drag out event.
I wrote a rough workaround by tracking the first finger pressed state and sprite picking events.
It would also be handy if bevy would expose a PointerOrder resource or else that assigns the finger an index somewhat like: https://github.com/Johannes0021/bevy_mod_input/blob/main/src/pointer_order.rs
In the past i had an issue with rodio that is still present: https://github.com/RustAudio/rodio/issues/836
Solved in a workaround replacement plugin for bevy_audio: https://github.com/Johannes0021/bevy_mod_audio
AppLifecycle: https://docs.rs/bevy/latest/bevy/window/enum.AppLifecycle.html
I think WillSuspend, WillResume, are never sent or received.
WinitSettings: https://docs.rs/bevy/latest/bevy/winit/struct.WinitSettings.html
I think the fn https://docs.rs/bevy/latest/bevy/winit/struct.WinitSettings.html#method.mobile
is misleading. It tries to pin the fps to 60. This might be okay for static apps but on Android
which forces VSync, this causes single frame drops on 60 fps and is unplayable on for example 90fps.
- Lingua principale
- Rust
- Stelle
- 49.7k
- Fork
- 5k
- Merge medio
- 3g 19h
- PR unite (30g)
- 134
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26536 ·
I maintainer di solito rispondono entro 2 giorni
-
Placeholder has no defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaC-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
bevyengine/bevy#26532 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bevyengine/bevy#26500 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
C-Feature S-Needs-Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
bevyengine/bevy#26499 ·
I maintainer di solito rispondono entro 2 giorni
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogramForse già presa @dev-matru l’ha presa 3 giorni fa. ApertaA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
bevyengine/bevy#26479 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
bug UI
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
wardian-app/Wardian#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
jlcodes99/cockpit-tools#3125 ·
I maintainer di solito rispondono entro 2 giorni
-
bug user-sprint
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Vondor/KassenSturz#967 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Incremental sync warns "no stored highest_uid" on every round for folders with no new mailApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
rustmailer/bichon#411 ·