aboutsummaryrefslogtreecommitdiffstats
path: root/frame-steamos/patches.toml
blob: ba19bada8c2519b9caaedd9a61d511520b0ea3dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# SPDX-FileCopyrightText: 2026 Tomasz Kramkowski <tomasz@kramkow.ski>
# SPDX-License-Identifier: CC0-1.0

target = "Frame SteamOS 0.5.10, SteamVR build 26774667"
template = "template.py"

[[targets]]
path = "/opt/steamvr/tools/vrlink/bin/linuxarm64/vrlink"
sha256 = "0a7ea7cfc3c52ba06debde52483709d2985d885ca45c2bb9054db9f42fca8aad"
edits = [
    # Clear submitted frame IDs after a reset so a newly received
    # frame cannot be skipped because it was submitted before reset.
    # SteamOS 0.5.9 already clears ready IDs and handles DQBUF EAGAIN.
    [0x57DEC, "13d00214"],
    [
        0x10BE38,
        "6142229162422a9100008092200081a83f0002ebc1ffff5462220091e72ffd17",
    ],
    # Fix a possible bug where a missing frame wouldn't trigger a
    # request when a newer frame arrived and the gap straddled the 16
    # bit wrapping boundary.
    [0x57F70, "a102024b213c00133f080071cb0100547316931a07000014"],
    [0x57FA0, "613e0053"],
    # Ignore packets which are for an older frame when re-assembling.
    # There are 16 slots and this could otherwise cause an old packet
    # to override a newer one.
    [0x57EBC, "f6cf0214"],
    [0x10BE94, "c00a40b96000f837a002004b60007837c03240390630fd174230fd17"],
    # Avoid two corner cases:
    # - After reset, wait for a complete recovery frame instead of
    #   simply waiting for _a_ frame to avoid trying to start decoding
    #   from a frame which depends on prior ones.
    # - Ignore frames which complete reassembly but which are older
    #   than the last submitted frame.
    [0x550B0, "80db0214"],
    [
        0x10BEB0,
        "091c41f92a8940b9ca00f8370b0840b96b010a4b0b017837fd7bbea97a24fd170a3040398a0000340a544d391f2003d54aff0f37c0035fd6",
    ],
    # To compensate for the first of the above two fixes, any frames
    # which completed out of order before a recovery frame must be
    # revisited after that frame.
    [0x57AA0, "41225a54"],
    [
        0x10BEE8,
        "800e4092400f008b000440f9010840b93f00146b81e4a5546c24fd97222ffd17",
    ],
    # If decoder submission fails, request reset without advancing the
    # last-submitted frame number as though submission succeeded.
    [0x57B18, "fcd00214"],
    [0x10BF08, "e0e3a53440cb45f9032ffd17"],
    # With FEC, audio gets sent as two blocks (A, B) followed by their
    # parity (A^B) block. If the next block arrives (C) while the
    # headset has received B but not A and is still waiting for A^B
    # then B gets discarded without playing it. This loses two blocks
    # worth of audio (10.67ms) rather than just skipping one missed
    # block (5.33ms) and flushing the second one (B). This fixes that
    # issue by just flushing B in that case.
    [0x3D9C0, "55390314"],
    [
        0x10BF14,
        "2000004b6000f836e2ff9f520000020b1f0800712cd598540bd89854620080522308c21a6384021b83d49834bbc6fc17",
    ],
    # Patch incorrect sequence gap calculation when sequence numbers
    # wrap modulo 65535 (recurring theme...)
    [0x3DBC8, "df380314"],
    [0x10BF44, "6000f836e1ff9f520000010ba7c6fc17"],
    # Don't request retransmission of frames that the headset has
    # already moved ahead of (i.e. the last-submitted frame or older).
    # Assume that a frame with a size of 4 MiB with missing metadata is
    # not actually 4 MiB to avoid requesting way too many potentially
    # missing fragments automatically. This can cause too many requests
    # which triggers an unnecessary stream reset. Requests for the
    # frame's metadata fragment continue which will contain and
    # populate the size field allowing the retransmit request code to
    # work normally from that point.
    [0x56E70, "39d40214"],
    [
        0x10BF54,
        "821e41f9448840b99f04003180000054e400044b048aa534e400783780324039a088a535951240b9bf025071f503951abf2bfd17482cfd17",
    ],
    # Don't trigger a reset if more than 512 missing fragments need to
    # be requested as a result of a time based repair. Instead stop
    # early once 20 entries are accumulated, reserving an extra 21st
    # entry so that a request for a fresh metadata fragment can always
    # be sent. This avoids an unnecessary reset and can speed up
    # recovery.
    [0x5710C, "a0d30214"],
    [
        0x10BF8C,
        "130080523f040031e18ba55484364079a0fe0f11007c0a539f00006b8200005403008012e3c30079330080523f040031552cfd17",
    ],
    [0x57160, "9cd30214"],
    [0x10BFD0, "8a3240394a01130a4a4d0011852240b9612cfd17"],
    [0x571D0, "7f020a6b6c040054"],
    [0x57230, "7f020a6b6c010054"],
    [0x57258, "7f020a6bede9ff5453050011617a1f53"],

    # Do not send a frame ACK before the frame-history queue has an
    # entry. The empty queue otherwise produces a bogus ACK 0 during
    # reconnect.
    [0x44640, "80d16354"],
    [0x10C070, "941644f9143c9cb4e00315aa5d40fc97dde1fc17"],
]

[targets.compiled]
sources = ["recovery-watchdog.c"]
imports = { fec_error_check = 0x57d38, check_stuck = 0x34008, v4l2_vtable = 0x257778 }

# Keep the existing decoder watchdog running while waiting for a recovery
# frame. This is needed to avoid a lockup caused by the above
# recovery-frame-wait patch where the recovery frame gets lost in transit.
[[targets.compiled.hooks]]
address = 0x4dfb0
length = 4
kind = "call"
target = "recovery_watchdog"