# 240SX engine audio source and playback gap, r347

## Source selection is verified

The current 240SX player selection points to the installed game's two Ginsu
recordings, through `webgl-city/assets/engine-audio/car-recordings.json`:

- Acceleration: `GIN_Nissan_240SX.gin`
- Coast: `GIN_240SX_Decel.gin`

The r315 source check compared both files to the XP installation byte for byte.
The SHA-256 values in this workspace still match that check:

| Recording | SHA-256 |
| --- | --- |
| `GIN_Nissan_240SX.gin` | `4f0881943a13f09185047184a63b7eab264780c518d9c08a3f033ef5f5ab77d9` |
| `GIN_240SX_Decel.gin` | `a594eaa9bd9887d36d7d224b1c6ace0963e4677a0338fb476ed5b023106ab469` |

The manifest records the source chain as stock `CarTypeMapping` →
`CarDataMapping` → `EngineData.GinsuAccel`, with a separate deceleration Ginsu
when `Dual Ginsu` is enabled. This supports the file assignment. The existing
notes do not retain the raw mapping records or a retail gameplay capture that
shows this 240SX's live selection and playback state together.

## What the browser currently does

`viewer.js` decodes each Ginsu's EA-XAS samples, RPM positions, and grain loop
points. `GinsuEngineRenderer` selects and crossfades grains by target RPM,
scales playback rate around each grain's recorded RPM, and blends the coast
and acceleration recordings linearly using the viewer's throttle command as
the mix weight. The dashboard supplies RPM from the viewer's estimated
launch/clutch behavior and source gearbox data. The r315 browser trace showed
the AudioWorklet running and receiving RPM/load; it did not compare the sound
or control signals with retail gameplay.

The separate static Engine trace in `vehicle-physics-runtime.md` finds the
retail physics operating point at `Engine+0x14`; the evaluator multiplies it by
`9.549304` before sampling the Engine curves, consistent with rad/s to RPM.
That trace follows Engine output into drivetrain and wheel state, but does not
connect `Engine+0x14` or the driver throttle command to the retail Ginsu
playback callsite. It cannot validate that the viewer's Ginsu RPM/load inputs
match the game's audio controls.

I also checked the installed executable copy at
`/tmp/nfsu2-SPEED2-from-xp.exe` (the stripped, HOODLUM-modified 1.2 build
described in `docs/speed2-exe-build-notes.md`). Its strings include
`CARSFX_PlayerEngine`, `CARSFX_AIEngine`, `CARSFX_TrafficEngine`, and
`SFXCTL_Engine`, showing separate player, AI, traffic, and engine-control
sound components. It contains no `Ginsu`, `GinsuAccel`, or `GinsuDecel`
identifiers; the concrete car-to-recording choice is external sound data, as
the extracted mapping manifest says. The executable's static Engine evaluator
is a physics curve consumer, not the missing Ginsu mixer trace. This pass did
not recover a generic Ginsu audio update callsite or any executable constants
for its RPM/load interpolation, accel/coast gain, transition/crossfade, or
shift transients. Those remain live fields/behavior to capture, not values to
infer from the Engine physics curve or Ginsu file headers.

Therefore, the recording choice is source-backed, but audible equivalence is
not. The browser implementation does not yet establish the retail meaning or
range of the Ginsu load input, the retail RPM signal during clutch slip and
gear shifts, or whether additional engine/exhaust/transmission layers and
transients are mixed with these two Ginsu loops. No replacement sound or
unverified playback curve is justified by the current evidence.

## Next capture needed

At retail free roam, select the stock 240SX and capture one synchronized
steady-rev sweep, coast, and throttle blip. At the retail Ginsu update/submit
callsite, log the selected EngineData/GinsuAccel and GinsuDecel handles,
Dual-Ginsu flag, engine RPM, throttle/load input, selected RPM/grain positions,
and per-recording gains. Record loopback audio at the same time. Repeat for a
brief upshift if the callsite exposes an event/envelope. Then drive the browser
at the same RPM and throttle points and compare the recorded output. This
would distinguish a wrong source mapping from a correct Ginsu file rendered
with the wrong controls or an incomplete audio mix.

The XP VM has not reached gameplay, so this capture is currently unavailable.
Until it can be made, keep the verified recordings but describe browser audio
as extracted-original Ginsu playback, not as retail-equivalent engine sound.
