Skip to content

fix(dashboard): 🐛 Fix SteamVR launch fail for dangling ADB process - #2757

Merged
zmerp merged 2 commits into
masterfrom
kill-adb-on-launch
Jun 18, 2025
Merged

zmerp merged 2 commits into
masterfrom
kill-adb-on-launch

Conversation

@zmerp

@zmerp zmerp commented Mar 15, 2025

Copy link
Copy Markdown
Member

No description provided.

@zmerp zmerp changed the title fix(dashboard): 🐛 Fix SteamVR fail to launch for dangling ADB process fix(dashboard): 🐛 Fix SteamVR launch fail for dangling ADB process Mar 15, 2025
@zmerp
zmerp force-pushed the kill-adb-on-launch branch 4 times, most recently from 79ddef4 to 3ea68c4 Compare March 15, 2025 19:16
@zmerp

zmerp commented Mar 16, 2025 •

Copy link
Copy Markdown
Member Author

Tested by @0JXI0, ready to review

Comment thread alvr/dashboard/src/steamvr_launcher/mod.rs
Comment thread alvr/adb/src/commands.rs
Comment thread alvr/filesystem/src/lib.rs Outdated
@zmerp

zmerp commented Mar 19, 2025

Copy link
Copy Markdown
Member Author

As things stand, probably this PR shouldn't be merged. I could get some help making another PR fixing this the proper way, as suggested by @The-personified-devil

@The-personified-devil

Copy link
Copy Markdown
Collaborator

I mean I can take a look at it tmrw, but I'm not entirely sure how to ideally handle this yet

@zmerp
zmerp marked this pull request as draft March 19, 2025 14:21
@zmerp

zmerp commented Mar 19, 2025 •

Copy link
Copy Markdown
Member Author

@The-personified-devil We would need to detect if the current alive adb server is spawned from the current process or not. if it's the local ADB installation it's always spawned by the driver, if not then it's safe to let the ADB instance live because it will not block SteamVR. the crate sysinfo should be able to tell if the parent process is SteamVR (check if adb is spawned by the current process)

@The-personified-devil
The-personified-devil marked this pull request as ready for review March 19, 2025 21:28
Comment on lines +118 to +127
if let Some(path) = adb::get_adb_path(&crate::get_filesystem_layout()) {
adb::kill_server(&path).ok();
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is alright but it would unnecessarily kill a global adb server instance. Better would be to get only the local adb path and try to kill that. But better yet would be to get the current running adb processes and kill any that is child of SteamVR (vrserver). This last solution would also be resistant to edge cases where the users installs a global adb server while running SteamVR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note though, i think you can't run two adb instances as well, so you kinda have to replace one instance with another anyway

@github-actions github-actions Bot added the stale label May 20, 2025
@github-actions github-actions Bot closed this May 28, 2025
@0JXI0

0JXI0 commented May 28, 2025

Copy link
Copy Markdown

This shouldn't be closed, still very much an issue

@zmerp

zmerp commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

Whops, this slipped through

@zmerp zmerp reopened this Jun 16, 2025
@github-actions github-actions Bot removed the stale label Jun 17, 2025
@zmerp
zmerp force-pushed the kill-adb-on-launch branch from 0822988 to 6c1cd1c Compare June 18, 2025 12:37
@zmerp

zmerp commented Jun 18, 2025

Copy link
Copy Markdown
Member Author

@The-personified-devil I finally implemented the check you requested months ago. I think the PR is ready

Comment on lines +67 to +70
RichText::new(format!(
"ALVR requires running SteamVR! {}",
"Devices will not be discovered or connected"
))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? This is the exact same just more complicated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, rustmt was broken for a few lines around that bit because of the line that couldn't wrap. The reason this fix is here isolated is because i did some edits and then undid them. But yeah it's baffling that rustfmt hasn't fixed this issue yet.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this issue haunts me as well, too long line? too bad, won't format at all.

@zmerp
zmerp merged commit 745babf into master Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants