Compare commits

..

No commits in common. "main" and "fix/login-fail-loudly" have entirely different histories.

4 changed files with 3 additions and 40 deletions

View File

@ -291,7 +291,6 @@ Required now:
- `scrot`
- `python3`
- `curl` (confirmed present at `/usr/bin/curl`) -- only used by `ba_cron_run.sh`'s optional Discord alerting, not by any Python task/driver code
- `nvidia-settings` (confirmed present at `/usr/bin/nvidia-settings`) -- `driver.launch_game()` runs `nvidia-settings -a AllowFlipping=0` before every launch. Without it, BA froze on "Initialize Catalog..." on every unattended launch from 2026-10-26 to 10-29, and only worked while a Moonlight session was connected (Sunshine's NvFBC capture stops the driver from flipping). The setting resets on reboot, which is why it's re-applied each launch. See `driver.disable_page_flipping()`.
Required Python packages:

View File

@ -3,21 +3,7 @@ import os
DISPLAY = ":0"
XAUTHORITY = "/run/user/1000/gdm/Xauthority"
# Steam has no autostart here, so after a reboot it's the first cron run that
# starts it, and every game Steam launches inherits that environment. cron
# sets neither of these. Real incident (2026-11-06): without XDG_RUNTIME_DIR,
# the Pulse socket never got mounted into the Proton container, so Persona 3
# Reload fell back to ALSA and crashed on launch in xaudio2_9 until Steam was
# restarted from the desktop.
XDG_RUNTIME_DIR = "/run/user/1000"
DBUS_SESSION_BUS_ADDRESS = f"unix:path={XDG_RUNTIME_DIR}/bus"
ENV = {
**os.environ,
"DISPLAY": DISPLAY,
"XAUTHORITY": XAUTHORITY,
"XDG_RUNTIME_DIR": XDG_RUNTIME_DIR,
"DBUS_SESSION_BUS_ADDRESS": DBUS_SESSION_BUS_ADDRESS,
}
ENV = {**os.environ, "DISPLAY": DISPLAY, "XAUTHORITY": XAUTHORITY}
WINDOW_NAME = "BlueArchive"

View File

@ -170,34 +170,12 @@ def kill_game(force=False):
run_command(["pkill", *signal_args, "-f", config.GAME_PROCESS_NAME], check=False)
def disable_page_flipping():
# Real incident (2026-10-26 to 10-29): with the NVIDIA driver's page
# flipping on, BA's fullscreen window on nik-gpu never puts a new frame
# on screen -- it sits frozen on "Initialize Catalog..." until login.py's
# timeout kills it -- unless a Moonlight session is connected, because
# Sunshine's NvFBC capture makes the driver copy frames instead of flip.
# Confirmed by A/B: frozen on every launch with AllowFlipping=1, title
# screen with no input and home in 47s via login with AllowFlipping=0.
# It's a runtime X setting that a reboot or X restart resets to 1, so
# it's re-applied before every launch instead of set once by hand.
# A failure is reported, not raised: the launch can still work (e.g.
# during a Moonlight session), and login.py fails the run loudly if not.
result = run_command(
["nvidia-settings", "-a", "AllowFlipping=0"],
check=False, capture_output=True, text=True,
)
if result.returncode != 0:
print(f"[driver] warning: couldn't disable NVIDIA page flipping (exit {result.returncode}) -- "
f"BA may freeze on its loading screen: {result.stderr.strip()}")
def launch_game():
# The launch script (see config.GAME_LAUNCH_SCRIPT) blocks until the
# game process exits, by design (it's meant to be run as a foreground
# session launcher) -- Popen + start_new_session=True detaches it so
# this process can keep polling for the window instead of hanging for
# the whole play session.
disable_page_flipping()
subprocess.Popen(
[config.GAME_LAUNCH_SCRIPT],
env=config.ENV,

View File

@ -17,7 +17,7 @@ VENV_DIR="$HOME/.venvs/ba-auto-daily"
echo "== Checking host tools =="
missing=0
for cmd in xdotool scrot nvidia-settings; do
for cmd in xdotool scrot; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "MISSING: $cmd (install with your package manager, e.g. sudo apt install $cmd)"
missing=1
@ -27,7 +27,7 @@ if [ "$missing" = 1 ]; then
echo "Install the missing tool(s) above, then re-run this script."
exit 1
fi
echo "xdotool, scrot, nvidia-settings: OK"
echo "xdotool, scrot: OK"
if ! command -v tesseract >/dev/null 2>&1; then
echo "MISSING: tesseract (OCR engine binary -- e.g. sudo apt install tesseract-ocr)"