Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android support #2308

Closed
Closed

Conversation

TheRawMeatball
Copy link
Member

@TheRawMeatball TheRawMeatball commented Jun 6, 2021

Improves situation on #86

Current status: Occasional panics when resuming, needs #2300.

@NathanSWard NathanSWard added the O-Android Specific to the Android mobile operating system label Jun 6, 2021
@cart
Copy link
Member

cart commented Jun 7, 2021

Switch to using stdout logging on android

Can you elaborate a bit on what motivated this decision? I'm assuming android_log-sys was causing problems? Losing "native android log levels" isn't ideal.

@TheRawMeatball
Copy link
Member Author

I'm not sure why, but it didn't work properly for me. And given that stdout is already redirected, a consistent output is more appealing to me - the command adb logcat -v raw RustStdoutStderr:D *:S gives exactly what you'd get if you were running the game on the PC.

@cart
Copy link
Member

cart commented Jun 7, 2021

I think being able to use UI to toggle logs by their level is way more valuable than exact consistency with pc console logs. The android ides I've used all support this for "native android logs". I also think theres a good chance that we will ultimately have a custom tracing backend for the bevy editor that collects a "structured log format" instead of stdout.

Obviously being able to run android apps is more important than this, but I'm still very much in favor of retaining native logging if possible.

@TheRawMeatball
Copy link
Member Author

Hmm, I experimented with it a bit more, and personally I'm still in favor of defaulting android to stdout, since right now getting a clean output from adb logcat is not super easy. We should consider that most people may not want to set up a full Android IDE, and want to just quickly debug something. I'll probably put the android logger impl behind a feature flag and default to stdout. Would that be an OK compromise?

@cart
Copy link
Member

cart commented Jun 7, 2021

since right now getting a clean output from adb logcat is not super easy

Can you elaborate a bit on this? I wouldn't call adb logcat -v raw RustStdoutStderr:D *:S particularly "easy" either. I've successfully used adb logcat with the native logger (by just scrolling to my app logs).

@TheRawMeatball
Copy link
Member Author

It's more of an I haven't been able to figure it out yet 😅. I tried a bunch of stuff for cleaning up the logs, but there was still random irrelevant logs coming in. Especially for a game, where my debugging strategy tends to be spam the console and use it as a real time display, scrolling isn't an option, and random logs coming in can make the text jittery.

@cart
Copy link
Member

cart commented Jun 7, 2021

This stackoverflow thread seems to have a number of options which are approximately as complex as adb logcat -v raw RustStdoutStderr:D *:S:

https://stackoverflow.com/questions/6854127/filter-logcat-to-get-only-the-messages-from-my-application-in-android

@TheRawMeatball
Copy link
Member Author

These still gave pings from android s vulkan layer :/.

@TheRawMeatball TheRawMeatball marked this pull request as ready for review June 11, 2021 19:03
deny.toml Outdated Show resolved Hide resolved
@cart
Copy link
Member

cart commented Jun 26, 2021

bors try

bors bot added a commit that referenced this pull request Jun 26, 2021
@cart
Copy link
Member

cart commented Jun 26, 2021

(I'm hitting shaderc complication errors on my system and I'm curious to see if bors hits them too)

Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
@cart
Copy link
Member

cart commented Jun 26, 2021

Yeah I think the issue is that we need all(target_arch="armv7", target_os="androideabi") in cargo.toml instead of all(target_arch="armv7", target_os="androidabi")

@cart
Copy link
Member

cart commented Jun 26, 2021

Hmm i guess this is a "cart's machine" problem. It is weird that shaderc is getting compiled at all? Shouldn't we be using glsl-to-spirv?

@TheRawMeatball
Copy link
Member Author

Maybe we wait until after the renderer rework and don't have to bother with shaderc at all?

@cart
Copy link
Member

cart commented Jun 26, 2021

I like this plan :)

@billyb2
Copy link
Contributor

billyb2 commented Jun 30, 2021

Just out of curiosity, when will said rework probably come? (Very excited for Android support in Bevy, and it will make it easily the best Rust game engine imho).

@cart
Copy link
Member

cart commented Jul 1, 2021

Hard to say, but ideally within the next month.

@cart cart added this to the Bevy 0.6 milestone Jul 1, 2021
@billyb2
Copy link
Contributor

billyb2 commented Jul 3, 2021

Alright, thank you!

@cart cart added the S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work label Jul 23, 2021
@mockersf mockersf removed the S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work label Jul 24, 2021
@TheRawMeatball
Copy link
Member Author

#2482 has done most of what this PR does, closing.

@TheRawMeatball TheRawMeatball deleted the android-support branch August 18, 2021 11:10
@TheRawMeatball TheRawMeatball restored the android-support branch August 18, 2021 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Android Specific to the Android mobile operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants