a2qlinux 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/CHANGELOG.md +30 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/PKG-INFO +1 -1
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/_version.py +2 -2
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/bin/questlog_ctl.exe +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/bin/wpcap.dll +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/desktop.py +4 -2
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/diagnose.py +350 -15
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/launcher.py +63 -7
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/ARCHITECTURE.md +184 -29
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/RELEASE.md +5 -1
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/TROUBLESHOOTING.md +21 -5
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/USING.md +8 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_desktop.py +16 -0
- a2qlinux-0.7.2/tests/test_diagnose.py +379 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_launcher.py +89 -0
- a2qlinux-0.7.0/tests/test_diagnose.py +0 -165
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/.gitignore +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/LICENSE +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/README.md +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/__init__.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/config.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/kde_overlays.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/open_folders.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/pcap_bridge.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/setup_desktop.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/steam.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/tray.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/a2qlinux/update.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/bridge/build.sh +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/bridge/questlog_ctl.c +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/bridge/tests/bridge_client_test.c +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/bridge/tests/zorder_guard_test.c +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/bridge/wpcap_bridge.c +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/INSTALL.md +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/README.md +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/docs/UPDATING.md +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/pyproject.toml +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/__init__.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_config.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_kde_overlays.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_open_folders.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_pcap_bridge.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_replay_stream.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_setup_desktop.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_steam.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_update.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tests/test_version.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tools/__init__.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tools/pcap2questlog.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tools/replay_stream.py +0 -0
- {a2qlinux-0.7.0 → a2qlinux-0.7.2}/tools/tcp_owner_probe.c +0 -0
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
What changed for players, release by release. Technical details are in
|
|
4
4
|
`docs/ARCHITECTURE.md`.
|
|
5
5
|
|
|
6
|
+
## [0.7.2] — 2026-11-13
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- `a2qlinux --diagnose --report` also records what each part of Questlog
|
|
10
|
+
is doing at that moment. When a Questlog window turns black or is "not
|
|
11
|
+
responding", a report made while it is on screen shows what it waits for.
|
|
12
|
+
|
|
13
|
+
## [0.7.1] — 2026-11-13
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Starting **A2Qlinux** again after its status window was closed no longer
|
|
17
|
+
stops with "Questlog is already running and fed by another A2Qlinux".
|
|
18
|
+
The Questlog left behind, which got no game traffic and had no tray icon
|
|
19
|
+
to quit it from, is closed once it has saved, and started again; the
|
|
20
|
+
game keeps running.
|
|
21
|
+
- Clicking the **A2Qlinux** menu entry while A2Qlinux runs from a
|
|
22
|
+
terminal (`a2qlinux-run`) opens Questlog's window, as it does when
|
|
23
|
+
A2Qlinux was started from the menu.
|
|
24
|
+
- The problem report names the exact Proton build the game last ran with
|
|
25
|
+
(for example GE-Proton11-12), not only a version number several builds
|
|
26
|
+
share.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- `a2qlinux --diagnose` also names the graphics card and its driver, the
|
|
30
|
+
screens and their scale, and Proton, Wine or graphics settings made
|
|
31
|
+
outside the game's launch option. The problem report also carries
|
|
32
|
+
Questlog's own output from its last two starts.
|
|
33
|
+
- Questlog's output from the start before the last one is kept, so
|
|
34
|
+
starting A2Qlinux again after a problem no longer erases what shows it.
|
|
35
|
+
|
|
6
36
|
## [0.7.0] — 2026-11-13
|
|
7
37
|
|
|
8
38
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: a2qlinux
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Questlog Desktop (AION 2 damage meter) on Linux under Proton, with live game traffic.
|
|
5
5
|
Project-URL: homepage, https://github.com/raman78/A2Qlinux
|
|
6
6
|
Project-URL: repository, https://github.com/raman78/A2Qlinux
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.7.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 7,
|
|
21
|
+
__version__ = version = '0.7.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 7, 2)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
Binary file
|
|
Binary file
|
|
@@ -74,14 +74,16 @@ def launcher_pid():
|
|
|
74
74
|
"""PID of the running the launcher (a2qlinux.launcher), from its lock file; None if it cannot be told.
|
|
75
75
|
|
|
76
76
|
Checked against the process's command line, so a stale or reused PID is
|
|
77
|
-
never signalled.
|
|
77
|
+
never signalled. The launcher runs as `python -m a2qlinux.launcher` from
|
|
78
|
+
the menu entry and as `python …/a2qlinux-run` when started in a terminal.
|
|
78
79
|
"""
|
|
79
80
|
try:
|
|
80
81
|
pid = int(LOCK.read_text().strip())
|
|
81
82
|
command = Path(f"/proc/{pid}/cmdline").read_bytes().split(b"\0")
|
|
82
83
|
except (OSError, ValueError):
|
|
83
84
|
return None
|
|
84
|
-
|
|
85
|
+
ours = b"a2qlinux.launcher" in command or any(os.path.basename(arg) == b"a2qlinux-run" for arg in command)
|
|
86
|
+
return pid if ours else None
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
def ask_running_launcher(game_starting):
|
|
@@ -4,11 +4,14 @@ Read only: it changes nothing, so it is safe at any time, the game running or
|
|
|
4
4
|
not. Each check gives one line: fine, a note, or a problem with what to do.
|
|
5
5
|
|
|
6
6
|
1. A2Qlinux's version, the system (distribution, kernel, desktop and its
|
|
7
|
-
session type), the
|
|
7
|
+
session type), the graphics cards with their kernel driver and its
|
|
8
|
+
version, what OpenGL renders with, the monitors and the desktop's
|
|
9
|
+
scale, the settings file, Questlog's folder and version.
|
|
8
10
|
2. The checks a2qlinux-setup makes: programs, capture permission, the tray
|
|
9
11
|
icon, the Windows parts (the same functions, a2qlinux.setup_desktop).
|
|
10
12
|
3. Steam: a native installation, the game's prefix, the Proton that last
|
|
11
|
-
ran it,
|
|
13
|
+
ran it, Wine's DPI, Proton/Wine/DXVK/driver variables in Steam's and
|
|
14
|
+
this session's environment, our wpcap.dll in the prefix.
|
|
12
15
|
4. AION 2's Steam launch option, read from each Steam account's
|
|
13
16
|
localconfig.vdf, and whether it ever ran (steam_launch.log).
|
|
14
17
|
5. What runs now: the launcher, Questlog (fed by the bridge or not), the game.
|
|
@@ -16,8 +19,10 @@ not. Each check gives one line: fine, a note, or a problem with what to do.
|
|
|
16
19
|
7. Whether the game's prefix has a command for Questlog's Open Folder
|
|
17
20
|
buttons, read from its system.reg (no Wine is started).
|
|
18
21
|
|
|
19
|
-
With --report it also writes a report file: the diagnosis
|
|
20
|
-
|
|
22
|
+
With --report it also writes a report file: the diagnosis, a snapshot of
|
|
23
|
+
what each of Questlog's processes and threads is doing (process_snapshot),
|
|
24
|
+
and the end of launcher.log and of questlog.log and questlog.log.1
|
|
25
|
+
(Questlog's and Wine's output, this run and the one before), with the home folder, user name, Steam account numbers and
|
|
21
26
|
network addresses replaced (anonymise). It shows the report and, if the
|
|
22
27
|
user agrees, opens a new GitHub issue in the browser with the report filled
|
|
23
28
|
in; the user reviews it and submits it with their own account. Nothing is
|
|
@@ -45,6 +50,9 @@ ISSUES_NEW = "https://github.com/raman78/A2Qlinux/issues/new"
|
|
|
45
50
|
# the login page carries the whole URL along); some margin below that.
|
|
46
51
|
ISSUE_URL_LIMIT = 6000
|
|
47
52
|
REPORT_LOG_LINES = 400 # lines of launcher.log in the report file: the last few runs
|
|
53
|
+
# questlog.log in the report: whole up to HEAD + TAIL lines, else its start (graphics set-up: DXVK's
|
|
54
|
+
# device, Chromium's GPU process) and its end (what happened last), with the gap marked.
|
|
55
|
+
QUESTLOG_LOG_HEAD, QUESTLOG_LOG_TAIL = 400, 800
|
|
48
56
|
|
|
49
57
|
|
|
50
58
|
# ---------------------------------------------------------------- Steam's files
|
|
@@ -151,18 +159,239 @@ def system_lines(env=os.environ, os_info=None, kernel=None, run=subprocess.run):
|
|
|
151
159
|
(OK, f"Desktop: {desktop}{f' ({version})' if version else ''}, {session}")]
|
|
152
160
|
|
|
153
161
|
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
PCI_IDS = ("/usr/share/hwdata/pci.ids", "/usr/share/misc/pci.ids", "/usr/share/pci.ids")
|
|
163
|
+
GLXINFO_WAIT = 5 # s for glxinfo -B
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def pci_name(vendor, device, ids_files=PCI_IDS):
|
|
167
|
+
"""(vendor name, device name) from the pci.ids database; the hex ids where it has no entry."""
|
|
168
|
+
vendor, device = vendor.lower().removeprefix("0x"), device.lower().removeprefix("0x")
|
|
169
|
+
for path in ids_files:
|
|
170
|
+
try:
|
|
171
|
+
lines = Path(path).read_text(encoding="utf-8", errors="replace").splitlines()
|
|
172
|
+
except OSError:
|
|
173
|
+
continue
|
|
174
|
+
vendor_name, device_name, inside = None, None, False
|
|
175
|
+
for line in lines:
|
|
176
|
+
if not line or line.startswith("#"):
|
|
177
|
+
continue
|
|
178
|
+
if not line.startswith("\t"):
|
|
179
|
+
if inside:
|
|
180
|
+
break
|
|
181
|
+
inside = line[:4].lower() == vendor
|
|
182
|
+
if inside:
|
|
183
|
+
vendor_name = line[4:].strip()
|
|
184
|
+
elif inside and not line.startswith("\t\t") and line[1:5].lower() == device:
|
|
185
|
+
device_name = line[5:].strip()
|
|
186
|
+
break
|
|
187
|
+
if vendor_name:
|
|
188
|
+
return vendor_name, device_name or f"device {device}"
|
|
189
|
+
return f"vendor {vendor}", f"device {device}"
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def gpu_lines(sys_root="/", run=subprocess.run, ids_files=PCI_IDS, which=shutil.which):
|
|
193
|
+
"""[(level, text)]: each graphics card with its kernel driver (and NVIDIA's version), and OpenGL's renderer.
|
|
194
|
+
|
|
195
|
+
Questlog draws with Chromium on the GPU, so a window that stays black, or
|
|
196
|
+
overlays that do, are first of all a question of card and driver.
|
|
197
|
+
"""
|
|
198
|
+
root = Path(sys_root)
|
|
199
|
+
lines = []
|
|
200
|
+
for card in sorted((root / "sys/class/drm").glob("card[0-9]*")):
|
|
201
|
+
if "-" in card.name:
|
|
202
|
+
continue # a connector (card1-DP-1), not a card
|
|
203
|
+
device = card / "device"
|
|
204
|
+
try:
|
|
205
|
+
vendor_id = (device / "vendor").read_text().strip()
|
|
206
|
+
device_id = (device / "device").read_text().strip()
|
|
207
|
+
except OSError:
|
|
208
|
+
continue
|
|
209
|
+
driver = os.path.basename(os.readlink(device / "driver")) if (device / "driver").is_symlink() else "no driver"
|
|
210
|
+
vendor, model = pci_name(vendor_id, device_id, ids_files)
|
|
211
|
+
version = ""
|
|
212
|
+
if driver == "nvidia":
|
|
213
|
+
try:
|
|
214
|
+
found = re.search(r"Kernel Module.*?\s(\d+\.\d+(?:\.\d+)?)\s",
|
|
215
|
+
(root / "proc/driver/nvidia/version").read_text())
|
|
216
|
+
version = f" {found.group(1)}" if found else ""
|
|
217
|
+
except OSError:
|
|
218
|
+
pass
|
|
219
|
+
try:
|
|
220
|
+
primary = (device / "boot_vga").read_text().strip() == "1"
|
|
221
|
+
except OSError:
|
|
222
|
+
primary = False
|
|
223
|
+
lines.append((OK, f"Graphics: {vendor} {model}, driver {driver}{version}" + (" (primary)" if primary else "")))
|
|
224
|
+
if not lines:
|
|
225
|
+
lines.append((NOTE, "Graphics: no card found under /sys/class/drm"))
|
|
226
|
+
if which("glxinfo"):
|
|
227
|
+
try:
|
|
228
|
+
done = run(["glxinfo", "-B"], stdin=subprocess.DEVNULL, capture_output=True, text=True,
|
|
229
|
+
timeout=GLXINFO_WAIT)
|
|
230
|
+
found = dict(re.findall(r"^OpenGL (renderer|version) string: (.+)$", done.stdout, re.MULTILINE))
|
|
231
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
232
|
+
found = {}
|
|
233
|
+
if not found:
|
|
234
|
+
lines.append((NOTE, "OpenGL: unknown (glxinfo -B gave no renderer; no desktop session here?)"))
|
|
235
|
+
else:
|
|
236
|
+
renderer = found.get("renderer", "?")
|
|
237
|
+
software = any(name in renderer.lower() for name in ("llvmpipe", "softpipe", "swrast"))
|
|
238
|
+
lines.append((NOTE if software else OK, f"OpenGL: {renderer}, {found.get('version', '?')}"
|
|
239
|
+
+ (" - software rendering: the graphics driver is not in use" if software else "")))
|
|
240
|
+
else:
|
|
241
|
+
lines.append((NOTE, "OpenGL: unknown (glxinfo is not installed)"))
|
|
242
|
+
return lines
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
XRANDR_WAIT = 5 # s for xrandr / kscreen-doctor
|
|
246
|
+
# Environment variables that change how Proton, Wine, DXVK or the graphics driver behave.
|
|
247
|
+
ENV_PREFIXES = ("PROTON_", "DXVK_", "VKD3D_", "WINE", "__GL_", "__GLX_", "MESA_", "RADV_", "AMD_VULKAN",
|
|
248
|
+
"VK_ICD_FILENAMES", "VK_DRIVER_FILES", "VK_LOADER", "DRI_PRIME", "ENABLE_VKBASALT",
|
|
249
|
+
"MANGOHUD", "LD_PRELOAD", "SDL_VIDEODRIVER", "STEAM_COMPAT_")
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def display_lines(env=os.environ, run=subprocess.run, which=shutil.which, home=None):
|
|
253
|
+
"""[(level, text)]: the monitors as X11 programs (Wine, so Questlog) see them, and the desktop's scale.
|
|
254
|
+
|
|
255
|
+
Wine draws through X11 (XWayland in a Wayland session), so `xrandr` shows
|
|
256
|
+
the screens and positions Questlog places its overlays on. The scale is
|
|
257
|
+
the desktop's own: KDE's from kscreen-doctor, GNOME's from monitors.xml.
|
|
258
|
+
"""
|
|
259
|
+
lines = []
|
|
260
|
+
if which("xrandr") and env.get("DISPLAY"):
|
|
261
|
+
try:
|
|
262
|
+
done = run(["xrandr", "--listmonitors"], stdin=subprocess.DEVNULL, capture_output=True, text=True,
|
|
263
|
+
timeout=XRANDR_WAIT)
|
|
264
|
+
monitors = re.findall(r"^\s*\d+: [+*]*(\S+) (\d+)/\d+x(\d+)/\d+([+-]\d+[+-]\d+)", done.stdout,
|
|
265
|
+
re.MULTILINE)
|
|
266
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
267
|
+
monitors = []
|
|
268
|
+
lines.append((OK, "Monitors (as Wine sees them): "
|
|
269
|
+
+ ", ".join(f"{name} {w}x{h} at {pos}" for name, w, h, pos in monitors)) if monitors else
|
|
270
|
+
(NOTE, "Monitors: unknown (xrandr --listmonitors gave none)"))
|
|
271
|
+
elif not env.get("DISPLAY"):
|
|
272
|
+
lines.append((NOTE, "Monitors: unknown (no X11 display here; run this in the desktop session)"))
|
|
273
|
+
else:
|
|
274
|
+
lines.append((NOTE, "Monitors: unknown (xrandr is not installed)"))
|
|
275
|
+
desktop = env.get("XDG_CURRENT_DESKTOP", "").upper().split(":")
|
|
276
|
+
scales = []
|
|
277
|
+
if "KDE" in desktop and which("kscreen-doctor"):
|
|
278
|
+
try:
|
|
279
|
+
done = run(["kscreen-doctor", "-j"], stdin=subprocess.DEVNULL, capture_output=True, text=True,
|
|
280
|
+
timeout=XRANDR_WAIT)
|
|
281
|
+
import json
|
|
282
|
+
scales = [f"{o['name']} {o.get('scale', 1):g}" for o in json.loads(done.stdout).get("outputs", [])
|
|
283
|
+
if o.get("enabled")]
|
|
284
|
+
except (OSError, subprocess.TimeoutExpired, ValueError, KeyError, TypeError):
|
|
285
|
+
scales = []
|
|
286
|
+
elif "GNOME" in desktop:
|
|
287
|
+
xml = Path(home or Path.home()) / ".config" / "monitors.xml"
|
|
288
|
+
try:
|
|
289
|
+
found = re.findall(r"<scale>([\d.]+)</scale>", xml.read_text(errors="replace"))
|
|
290
|
+
scales = [f"{float(value):g}" for value in found] or ["1"]
|
|
291
|
+
except OSError:
|
|
292
|
+
scales = ["1 (no monitors.xml: never changed)"]
|
|
293
|
+
if scales:
|
|
294
|
+
lines.append((OK, "Desktop scale: " + ", ".join(scales)))
|
|
295
|
+
elif "KDE" in desktop:
|
|
296
|
+
lines.append((NOTE, "Desktop scale: unknown (kscreen-doctor is missing or gave no outputs)"))
|
|
297
|
+
elif "GNOME" not in desktop:
|
|
298
|
+
lines.append((NOTE, "Desktop scale: unknown on this desktop (read on KDE and GNOME only)"))
|
|
299
|
+
return lines
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def wine_dpi_line(prefix):
|
|
303
|
+
"""(OK, text): the DPI values set in the prefix's registry, each with its key (96 is 100 %)."""
|
|
304
|
+
found = []
|
|
305
|
+
for name, key in (("user.reg", r"[Control Panel\\Desktop]"), ("user.reg", r"[Software\\Wine\\Fonts]"),
|
|
306
|
+
("system.reg", r"[System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts]"),
|
|
307
|
+
("system.reg", r"[System\\ControlSet001\\Hardware Profiles\\Current\\Software\\Fonts]")):
|
|
308
|
+
try:
|
|
309
|
+
text = (Path(prefix) / name).read_text(encoding="utf-8", errors="replace")
|
|
310
|
+
except OSError:
|
|
311
|
+
continue
|
|
312
|
+
start = text.find("\n" + key + " ")
|
|
313
|
+
if start < 0:
|
|
314
|
+
continue
|
|
315
|
+
end = text.find("\n[", start + 1)
|
|
316
|
+
value = re.search(r'^"LogPixels"=dword:([0-9a-fA-F]+)$', text[start:end if end > 0 else None], re.MULTILINE)
|
|
317
|
+
if value:
|
|
318
|
+
shown = key.strip("[]").replace("\\\\", "\\")
|
|
319
|
+
found.append(f"{int(value.group(1), 16)} in {shown}")
|
|
320
|
+
return OK, "Wine DPI: " + ("; ".join(found) if found else "not set (Wine's default, 96)")
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def env_settings(environ):
|
|
324
|
+
"""The entries of `environ` (a dict) that change how Proton, Wine, DXVK or the driver behave, sorted."""
|
|
325
|
+
return sorted(f"{k}={v}" for k, v in environ.items() if k.startswith(ENV_PREFIXES))
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
STEAM_PROGRAMS = (b"/steam.sh", b"/steamrt64/steam", b"/ubuntu12_64/steam", b"/ubuntu12_32/steam")
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def steam_environment(proc="/proc"):
|
|
332
|
+
"""The Steam client's environment as a dict, None when Steam is not running.
|
|
333
|
+
|
|
334
|
+
steam.sh's is preferred (run as `bash …/steam.sh`): it is what the
|
|
335
|
+
session handed to Steam, before Steam's own runtime adds to it.
|
|
336
|
+
"""
|
|
337
|
+
found = {}
|
|
338
|
+
with os.scandir(proc) as entries:
|
|
339
|
+
for entry in entries:
|
|
340
|
+
if not entry.name.isdigit():
|
|
341
|
+
continue
|
|
342
|
+
try:
|
|
343
|
+
argv = Path(entry.path, "cmdline").read_bytes().split(b"\0")[:2]
|
|
344
|
+
program = next((STEAM_PROGRAMS.index(p) for p in STEAM_PROGRAMS for a in argv if a.endswith(p)), None)
|
|
345
|
+
if program is None or program in found:
|
|
346
|
+
continue
|
|
347
|
+
raw = Path(entry.path, "environ").read_bytes()
|
|
348
|
+
except OSError:
|
|
349
|
+
continue
|
|
350
|
+
found[program] = dict(item.split("=", 1) for item in raw.decode("utf-8", "replace").split("\0")
|
|
351
|
+
if "=" in item)
|
|
352
|
+
return found[min(found)] if found else None
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
def environment_lines(env=os.environ, steam_environ=False):
|
|
356
|
+
"""[(level, text)]: such variables in Steam's environment (what the game starts with) and in this session's."""
|
|
357
|
+
def listed(environ):
|
|
358
|
+
settings = env_settings(environ)
|
|
359
|
+
return ", ".join(settings) if settings else "no Proton, Wine, DXVK or driver variables"
|
|
360
|
+
steam = steam_environment() if steam_environ is False else steam_environ
|
|
361
|
+
return [(OK, "Steam's environment: " + (listed(steam) if steam is not None else "unknown (Steam is not running)")),
|
|
362
|
+
(OK, "This session's environment (Questlog's): " + listed(env))]
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def proton_line(prefix, host_root="/"):
|
|
366
|
+
"""(level, text): the Proton that last ran the prefix.
|
|
367
|
+
|
|
368
|
+
Proton rewrites config_info beside the prefix on a start whenever it
|
|
369
|
+
differs. Its first line is the prefix's format version
|
|
370
|
+
(CURRENT_PREFIX_VERSION, e.g. "11.0-100"), which many builds share; the
|
|
371
|
+
lines below are paths inside the Proton tool's folder, as the Steam
|
|
372
|
+
runtime container sees them (/run/host/... is the host's /...). The
|
|
373
|
+
build's own name is in that folder's `version` file ("<time> <name>").
|
|
374
|
+
"""
|
|
156
375
|
try:
|
|
157
376
|
lines = (Path(prefix).parent / "config_info").read_text(errors="replace").splitlines()
|
|
158
377
|
except OSError:
|
|
159
378
|
return NOTE, "Proton: unknown (no config_info next to the prefix; the game not started yet?)"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
379
|
+
prefix_version = lines[0].strip() if lines else ""
|
|
380
|
+
folder = next((line.split("/files/", 1)[0] for line in lines[1:] if "/files/" in line), "")
|
|
381
|
+
if folder.startswith("/run/host/"):
|
|
382
|
+
folder = folder[len("/run/host"):]
|
|
383
|
+
build = ""
|
|
384
|
+
if folder:
|
|
385
|
+
try:
|
|
386
|
+
build = (Path(host_root) / folder.lstrip("/") / "version").read_text(errors="replace").split()[-1]
|
|
387
|
+
except (OSError, IndexError):
|
|
388
|
+
build = ""
|
|
389
|
+
if not (build or prefix_version):
|
|
164
390
|
return NOTE, "Proton: unknown (config_info is empty)"
|
|
165
|
-
|
|
391
|
+
tool = Path(folder).name if folder else ""
|
|
392
|
+
shown = build or f"build unknown, prefix version {prefix_version}"
|
|
393
|
+
return OK, f"Proton (last run): {shown}" + (f" (folder {tool})" if tool else "")
|
|
394
|
+
|
|
166
395
|
|
|
167
396
|
def check_setup(results):
|
|
168
397
|
from . import setup_desktop as setup
|
|
@@ -197,6 +426,8 @@ def check_steam(results, appid, qdir):
|
|
|
197
426
|
prefix = launcher.game_prefix(appid, roots)
|
|
198
427
|
results.append((OK, f"Game prefix: {prefix}"))
|
|
199
428
|
results.append(proton_line(prefix))
|
|
429
|
+
results.append(wine_dpi_line(prefix))
|
|
430
|
+
results += environment_lines()
|
|
200
431
|
dll = prefix / "drive_c" / "windows" / "system32" / "Npcap" / "wpcap.dll"
|
|
201
432
|
try:
|
|
202
433
|
ours = launcher.BRIDGE_SIGNATURE in dll.read_bytes()
|
|
@@ -248,7 +479,8 @@ def check_running(results, appid):
|
|
|
248
479
|
"icon and start 'A2Qlinux' from the menu"))
|
|
249
480
|
elif not running:
|
|
250
481
|
results.append((PROBLEM, "Now: Questlog runs with the bridge, but A2Qlinux has ended (status "
|
|
251
|
-
"window closed?): it gets no game traffic.
|
|
482
|
+
"window closed?): it gets no game traffic. Start 'A2Qlinux' from the menu: "
|
|
483
|
+
"it closes this Questlog and starts it again"))
|
|
252
484
|
else:
|
|
253
485
|
results.append((OK, "Now: Questlog runs under A2Qlinux"))
|
|
254
486
|
else:
|
|
@@ -292,6 +524,8 @@ def diagnose(appid=3393110):
|
|
|
292
524
|
results = [(OK, f"A2Qlinux {shown_version()}")]
|
|
293
525
|
try:
|
|
294
526
|
results += system_lines()
|
|
527
|
+
results += gpu_lines()
|
|
528
|
+
results += display_lines()
|
|
295
529
|
except Exception as error: # as below: reported, never hiding the rest
|
|
296
530
|
results.append((PROBLEM, f"This check failed: {error!r} (please report it)"))
|
|
297
531
|
results.append((OK, f"Settings: {config.CONFIG_PATH}"))
|
|
@@ -320,7 +554,7 @@ def format_results(results):
|
|
|
320
554
|
class Anonymiser:
|
|
321
555
|
"""Replaces what identifies the user or their network, the same value always the same way.
|
|
322
556
|
|
|
323
|
-
Home folder -> ~, the user name as a path component -> <user>, Steam
|
|
557
|
+
Home folder -> ~, the user name as a path component (also in Wine's Windows paths) -> <user>, Steam
|
|
324
558
|
account folders -> userdata/<steam-id-N>, the host name -> <host>,
|
|
325
559
|
IPv4 and IPv6 addresses -> <private-N> / <public-N> / <ipv6-N> (loopback
|
|
326
560
|
and 0.0.0.0 stay, they say nothing about anyone). A consistent
|
|
@@ -370,7 +604,8 @@ class Anonymiser:
|
|
|
370
604
|
for home in {self.home, os.path.realpath(self.home)}:
|
|
371
605
|
text = text.replace(home, "~")
|
|
372
606
|
if self.user:
|
|
373
|
-
|
|
607
|
+
# Linux paths, and Wine's Windows ones (Z:\home\<user>\..., also with doubled backslashes)
|
|
608
|
+
text = re.sub(rf"(?<=[/\\]){re.escape(self.user)}(?=[/\\]|\b)", "<user>", text)
|
|
374
609
|
text = self.STEAM_ID.sub(lambda m: m.group(1) + self._name("steam-id", m.group(2)), text)
|
|
375
610
|
if self.host and len(self.host) >= 3:
|
|
376
611
|
text = re.sub(rf"\b{re.escape(self.host)}\b", "<host>", text)
|
|
@@ -387,14 +622,114 @@ def log_tail(path, lines):
|
|
|
387
622
|
return []
|
|
388
623
|
|
|
389
624
|
|
|
390
|
-
def
|
|
625
|
+
def questlog_log_excerpt(path, head=QUESTLOG_LOG_HEAD, tail=QUESTLOG_LOG_TAIL):
|
|
626
|
+
"""questlog.log's lines for the report: all of them, or its start and end with the gap marked."""
|
|
627
|
+
try:
|
|
628
|
+
lines = path.read_text(errors="replace").splitlines()
|
|
629
|
+
except OSError:
|
|
630
|
+
return []
|
|
631
|
+
if len(lines) <= head + tail:
|
|
632
|
+
return lines
|
|
633
|
+
return lines[:head] + [f"(... {len(lines) - head - tail} lines left out ...)"] + lines[-tail:]
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
PROCESS_SAMPLE = 1.0 # s between the two readings of the threads' CPU time in the report's snapshot
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
def process_role(argv):
|
|
640
|
+
"""What a process of Questlog is, from its command line: main, gpu-process, renderer, utility (…)."""
|
|
641
|
+
kind = next((a.split("=", 1)[1] for a in argv if a.startswith("--type=")), None)
|
|
642
|
+
if kind is None:
|
|
643
|
+
return "wineserver" if argv and argv[0].endswith("wineserver") else "main"
|
|
644
|
+
sub = next((a.split("=", 1)[1] for a in argv if a.startswith("--utility-sub-type=")), "")
|
|
645
|
+
return f"{kind} ({sub.split('.')[0]})" if sub else kind
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
def _thread_readings(pid, proc):
|
|
649
|
+
"""{tid: (name, state, kernel wait, CPU ticks)} of one process's threads; {} once it has gone."""
|
|
650
|
+
readings = {}
|
|
651
|
+
try:
|
|
652
|
+
tids = os.listdir(f"{proc}/{pid}/task")
|
|
653
|
+
except OSError:
|
|
654
|
+
return readings
|
|
655
|
+
for tid in tids:
|
|
656
|
+
base = f"{proc}/{pid}/task/{tid}"
|
|
657
|
+
try:
|
|
658
|
+
stat = Path(base, "stat").read_text()
|
|
659
|
+
fields = stat[stat.rindex(")") + 2:].split()
|
|
660
|
+
name = Path(base, "comm").read_text().strip()
|
|
661
|
+
wchan = Path(base, "wchan").read_text().strip()
|
|
662
|
+
except (OSError, ValueError):
|
|
663
|
+
continue
|
|
664
|
+
readings[int(tid)] = (name, fields[0], wchan if wchan not in ("", "0") else "-",
|
|
665
|
+
int(fields[11]) + int(fields[12]))
|
|
666
|
+
return readings
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
def process_snapshot(pids, proc="/proc", wait=PROCESS_SAMPLE, sleep=time.sleep, ticks=None):
|
|
670
|
+
"""The report's lines on what each of Questlog's processes and threads does right now.
|
|
671
|
+
|
|
672
|
+
Each thread: its name (Chromium names them: CrBrowserMain is the main
|
|
673
|
+
process's window thread), its state (R running, S/D waiting), where it
|
|
674
|
+
waits in the kernel, and the CPU time it used between two readings
|
|
675
|
+
`wait` s apart. A thread that answers no window shows either as busy
|
|
676
|
+
(CPU time near the whole interval) or as waiting with none. Idle threads
|
|
677
|
+
that look alike are counted on one line.
|
|
678
|
+
"""
|
|
679
|
+
from .launcher import _read
|
|
680
|
+
ticks = ticks or os.sysconf("SC_CLK_TCK")
|
|
681
|
+
first = {pid: _thread_readings(pid, proc) for pid in pids}
|
|
682
|
+
sleep(wait)
|
|
683
|
+
lines = []
|
|
684
|
+
for pid in sorted(pids):
|
|
685
|
+
argv = [a for a in _read(f"{proc}/{pid}/cmdline", 4096).split("\0") if a]
|
|
686
|
+
second = _thread_readings(pid, proc)
|
|
687
|
+
if not second:
|
|
688
|
+
lines.append(f"PID {pid}: gone during the snapshot")
|
|
689
|
+
continue
|
|
690
|
+
used = {tid: max(0, second[tid][3] - first[pid].get(tid, second[tid])[3]) * 1000 // ticks
|
|
691
|
+
for tid in second}
|
|
692
|
+
lines.append(f"PID {pid} {process_role(argv)}: {len(second)} threads, "
|
|
693
|
+
f"{sum(used.values())} ms CPU in {wait:g} s")
|
|
694
|
+
grouped = {}
|
|
695
|
+
for tid in sorted(second):
|
|
696
|
+
name, state, wchan, _ = second[tid]
|
|
697
|
+
if tid == pid or used[tid] or state not in ("S", "I"):
|
|
698
|
+
lines.append(f" {tid:>8} {name:<16} {state} {wchan:<32} {used[tid]:>5} ms")
|
|
699
|
+
else:
|
|
700
|
+
grouped[(name, state, wchan)] = grouped.get((name, state, wchan), 0) + 1
|
|
701
|
+
for (name, state, wchan), count in sorted(grouped.items()):
|
|
702
|
+
lines.append(f" {'x' + str(count):>8} {name:<16} {state} {wchan:<32} {0:>5} ms")
|
|
703
|
+
return lines
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def questlog_snapshot(appid=3393110):
|
|
707
|
+
"""process_snapshot of Questlog's processes and the Wine session's wineserver; lines."""
|
|
708
|
+
from . import launcher
|
|
709
|
+
found = launcher.game_processes(appid, ["questlog.exe", "wineserver"])
|
|
710
|
+
servers = {pid for pid in found["wineserver"]
|
|
711
|
+
if "-w" not in launcher._read(f"/proc/{pid}/cmdline", 4096).split("\0")[1:]}
|
|
712
|
+
pids = found["questlog.exe"] | servers
|
|
713
|
+
if not found["questlog.exe"]:
|
|
714
|
+
return ["(Questlog is not running)"]
|
|
715
|
+
return process_snapshot(pids)
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def build_report(results, qdir, anonymise, snapshot=questlog_snapshot):
|
|
391
719
|
logs = qdir / "proton-stream"
|
|
392
720
|
launcher_lines = log_tail(logs / "launcher.log", REPORT_LOG_LINES)
|
|
393
721
|
parts = [f"A2Qlinux report, {time.strftime('%Y-%m-%d %H:%M %Z')}", "", "## Diagnosis", "",
|
|
394
722
|
format_results(results), "", f"## launcher.log (last {REPORT_LOG_LINES} lines)", ""]
|
|
395
723
|
parts += launcher_lines or ["(no launcher.log yet)"]
|
|
724
|
+
parts += ["", f"## Questlog's processes now (threads: state, kernel wait, CPU time in {PROCESS_SAMPLE:g} s)",
|
|
725
|
+
""]
|
|
726
|
+
parts += snapshot()
|
|
396
727
|
parts += ["", "## steam_launch.log (last 10 lines)", ""]
|
|
397
728
|
parts += log_tail(logs / "steam_launch.log", 10) or ["(none)"]
|
|
729
|
+
parts += ["", "## questlog.log (Questlog's and Wine's output since A2Qlinux last started it)", ""]
|
|
730
|
+
parts += questlog_log_excerpt(logs / "questlog.log") or ["(none)"]
|
|
731
|
+
parts += ["", "## questlog.log.1 (the run before that)", ""]
|
|
732
|
+
parts += questlog_log_excerpt(logs / "questlog.log.1", head=200, tail=400) or ["(none)"]
|
|
398
733
|
return anonymise("\n".join(parts) + "\n")
|
|
399
734
|
|
|
400
735
|
|
|
@@ -575,6 +575,7 @@ def session_lock(directory):
|
|
|
575
575
|
# ----------------------------------------------------------- tray and quit
|
|
576
576
|
|
|
577
577
|
CTL = BIN / "questlog_ctl.exe"
|
|
578
|
+
ORPHAN_EXIT_FILE_WAIT = 5 # s for an ended orphan's launch to write questlog.exit (end_orphaned_questlog)
|
|
578
579
|
SAVE_WAIT = 10.5 # s after the last game data before Questlog may be ended: it saves pending data within 10 s
|
|
579
580
|
|
|
580
581
|
|
|
@@ -990,6 +991,63 @@ def end_game_steam_helper(why, pids=None):
|
|
|
990
991
|
return len(orphans) - len(left)
|
|
991
992
|
|
|
992
993
|
|
|
994
|
+
def start_questlog_log(path):
|
|
995
|
+
"""Begin this launcher run's questlog.log; the previous run's becomes questlog.log.1.
|
|
996
|
+
|
|
997
|
+
One log per launcher run (relaunches within it append). The previous one
|
|
998
|
+
is kept because a player who restarts A2Qlinux after a problem would
|
|
999
|
+
otherwise empty the log that shows it, before making a report.
|
|
1000
|
+
"""
|
|
1001
|
+
path = Path(path)
|
|
1002
|
+
try:
|
|
1003
|
+
if path.stat().st_size:
|
|
1004
|
+
os.replace(path, path.with_name(path.name + ".1"))
|
|
1005
|
+
except FileNotFoundError:
|
|
1006
|
+
pass
|
|
1007
|
+
path.write_bytes(b"")
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
def running_questlog_state(pids):
|
|
1011
|
+
"""None (no Questlog), "orphaned" (started with the bridge) or "outside" (started without A2Qlinux).
|
|
1012
|
+
|
|
1013
|
+
Asked by a launcher that holds the session lock (I1), so no other launcher
|
|
1014
|
+
runs: a Questlog carrying QUESTLOG_PROTON_BRIDGE was started by a launcher
|
|
1015
|
+
that has ended since (its status window closed), and gets no traffic.
|
|
1016
|
+
"""
|
|
1017
|
+
if not pids:
|
|
1018
|
+
return None
|
|
1019
|
+
fed = any("QUESTLOG_PROTON_BRIDGE=" in _read(f"/proc/{pid}/environ") for pid in pids)
|
|
1020
|
+
return "orphaned" if fed else "outside"
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
def end_orphaned_questlog(protontricks, log_path, wait=SAVE_WAIT):
|
|
1024
|
+
"""End a Questlog whose launcher has gone, so that this launcher can start it with its own bridge.
|
|
1025
|
+
|
|
1026
|
+
Its tray icon was hidden by that launcher and ours went with it, so the
|
|
1027
|
+
player cannot quit it. It is ended like a quit (end-session: Questlog's
|
|
1028
|
+
window only, the game is not touched), after `wait` seconds in which
|
|
1029
|
+
Questlog saves what it received before its bridge went away. A Questlog
|
|
1030
|
+
that does not answer (its window hung) is stopped by wait_for_questlog_exit.
|
|
1031
|
+
|
|
1032
|
+
Its launch (launch_questlog) writes questlog.exit once Questlog has gone;
|
|
1033
|
+
that is waited for too, since a file written after this launcher's own
|
|
1034
|
+
launch would read as the new Questlog's end.
|
|
1035
|
+
"""
|
|
1036
|
+
log("Questlog is still running from an A2Qlinux that has ended (its status window was closed?), so it "
|
|
1037
|
+
f"gets no game traffic. Closing it in {wait:.0f} s, once it has saved, and starting it again.")
|
|
1038
|
+
time.sleep(wait)
|
|
1039
|
+
if run_ctl(protontricks, "end-session", log_path) != 0:
|
|
1040
|
+
log(f"Questlog did not take the session end; its processes are stopped within {QUESTLOG_QUIT_WAIT} s.")
|
|
1041
|
+
wait_for_questlog_exit(f"it had {wait:.0f} s to save")
|
|
1042
|
+
exit_file = Path(log_path).with_name("questlog.exit")
|
|
1043
|
+
deadline = time.monotonic() + ORPHAN_EXIT_FILE_WAIT
|
|
1044
|
+
while not exit_file.exists() and time.monotonic() < deadline:
|
|
1045
|
+
time.sleep(0.2)
|
|
1046
|
+
if game_processes(APPID, ["questlog.exe"])["questlog.exe"]:
|
|
1047
|
+
raise RuntimeError("Questlog keeps running from an A2Qlinux that has ended and could not be closed. "
|
|
1048
|
+
"End its Questlog.exe processes (System Monitor), then start A2Qlinux again.")
|
|
1049
|
+
|
|
1050
|
+
|
|
993
1051
|
def move_to_fresh_session(prefix, protontricks, log_path):
|
|
994
1052
|
"""End Questlog and wait until the game's Wine session is gone. Returns True if it went.
|
|
995
1053
|
|
|
@@ -1302,12 +1360,10 @@ def main():
|
|
|
1302
1360
|
# Only the launcher holding the lock writes the file; earlier lines are kept until now.
|
|
1303
1361
|
LOG_FILE.open(state_dir / "launcher.log")
|
|
1304
1362
|
dumpcap = system_dumpcap()
|
|
1305
|
-
running = game_processes(APPID, ["questlog.exe"])["questlog.exe"]
|
|
1306
|
-
if running:
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
raise RuntimeError("Questlog is already running and fed by another A2Qlinux "
|
|
1310
|
-
"(another terminal window). Nothing to do here.")
|
|
1363
|
+
running = running_questlog_state(game_processes(APPID, ["questlog.exe"])["questlog.exe"])
|
|
1364
|
+
if running == "orphaned":
|
|
1365
|
+
end_orphaned_questlog(protontricks, state_dir / "questlog.log")
|
|
1366
|
+
elif running == "outside":
|
|
1311
1367
|
raise RuntimeError("Questlog is already running in the game prefix without the capture bridge. "
|
|
1312
1368
|
"Quit it (tray icon > Quit) and run this again.")
|
|
1313
1369
|
server = BridgeServer(log)
|
|
@@ -1325,7 +1381,7 @@ def main():
|
|
|
1325
1381
|
log("AION 2 is not running; starting Questlog now (saved fights, database, map). "
|
|
1326
1382
|
"Start the game any time - its traffic then flows to Questlog.")
|
|
1327
1383
|
log_path = state_dir / "questlog.log"
|
|
1328
|
-
log_path
|
|
1384
|
+
start_questlog_log(log_path)
|
|
1329
1385
|
tray = Tray(requests)
|
|
1330
1386
|
quit_control = QuitControl()
|
|
1331
1387
|
|