# Audio Asset Search

## Summary

A whole-target-root static scan did not find standalone gameplay audio files in ordinary formats. The scan covered target-root directories, not just `/games/pokemon_pro/assets`, and wrote reproducible results under `analysis/audio-search/`.

Confirmed scan results:

- `analysis/audio-search/summary.json` counted `7375` target-root files.
- Filename scanning found `74` audio-related paths, but these are ALSA/BlueALSA/GStreamer support files, kernel sound modules, udev rules, two speaker-panel PNGs, and the exported Godot sound-id script; they are not gameplay sound content.
- `file(1)` classification produced `284` media/audio-looking hits: `278` were video containers and `6` were false-positive Wi-Fi firmware files reported as `GTA audio index data (SDT)`.
- `ffprobe` parsed streams from `281` target-root files and found `0` files with audio streams.
- Binary magic scanning found many codec/library false positives. No confirmed standalone Ogg, WAV, MP3, FLAC, Opus, or AAC gameplay-audio file was recovered from the target rootfs.

This extends the narrower Godot/Radium media scan documented in `godot-and-radium-assets.md`. That earlier generated-asset scan found one AAC-bearing MP4 after extracting `/games/pokemon_pro/assets/godot/main.pck`: `assets/godot_raw/scenes/shared_items/gfx/bknd/Arena_Neon/Tournament_Neon_01_22_26_h265.mp4`.

Important refinement from Ghidra cross-references and the follow-up image parser: the broad scan rules out plain loose audio files and directly recognizable target-root streams. The missing sounds are now confirmed to be image-backed: section 8 of `/games/pokemon_pro/image.bin` is a Radium table of headerless 16-bit PCM chunks. See `radium-image-format.md`.

## Scope And Command

The scanner is workspace-local and does not execute target AArch64 binaries.

```sh
python3 rootfs-triage-wiki/scripts/search_audio_assets.py
```

The script scanned these target-root directories: `bin`, `boot`, `connectivity`, `data`, `dev`, `etc`, `games`, `home`, `lib`, `lib64`, `linuxrc`, `lost+found`, `media`, `media2`, `mnt`, `opt`, `proc`, `root`, `run`, `sbin`, `sys`, `tmp`, `usr`, and `var`.

Generated outputs:

- `analysis/audio-search/summary.json`
- `analysis/audio-search/filename-hits.tsv`
- `analysis/audio-search/file-type-hits.tsv`
- `analysis/audio-search/magic-hits.tsv`
- `analysis/audio-search/ffprobe-streams.tsv`
- `analysis/audio-search/audio-related-strings.json`

## Target-Root Media Probe Results

`analysis/audio-search/ffprobe-streams.tsv` contains every target-root file where `ffprobe` could parse stream metadata:

| Count | Streams |
| ---: | --- |
| `248` | `0:video:hevc` |
| `30` | `0:video:h264` |
| `2` | `0:video:png` |
| `1` | `0:video:ansi` |

Every parsed target-root stream row has `has_audio=False`.

## Filename Hits

`analysis/audio-search/filename-hits.tsv` found audio-related names such as:

- `/etc/alsa/conf.d/20-bluealsa.conf`
- `/usr/lib/libasound.so.2.0.0`
- `/usr/lib/gstreamer-1.0/libgstaudioconvert.so`
- `/usr/bin/aplay`
- `/usr/bin/bluealsa`
- `/lib/modules/6.6.28-v8/kernel/sound/usb/snd-usb-audio.ko.xz`
- `/games/pokemon_pro/assets/nuk/images/System/TestMode/spike_3_speaker_panel.png`

These are system audio stack components, tests, images, or support files, not recovered gameplay audio content.

## False Positives

`file(1)` reported six firmware files as `GTA audio index data (SDT)`:

- `/lib/firmware/brcm/brcmfmac43436-sdio.bin`
- `/lib/firmware/brcm/brcmfmac43436s-sdio.bin`
- `/lib/firmware/cypress/cyfmac43430-sdio.bin`
- `/lib64/firmware/brcm/brcmfmac43436-sdio.bin`
- `/lib64/firmware/brcm/brcmfmac43436s-sdio.bin`
- `/lib64/firmware/cypress/cyfmac43430-sdio.bin`

These paths and filenames identify them as Wi-Fi firmware. `ffprobe` did not parse audio streams from them.

Binary magic scanning also found Ogg-looking byte sequences in executable/library data. Two game-specific examples were carved and checked:

- `/games/pokemon_pro/game` at offset `52183200`
- `/games/pokemon_pro/spike3/spike_menu/game` at offset `4398800`

`file(1)` labels the carved 1 MiB samples as `Ogg data`, but `ffprobe` rejects both with `CRC mismatch`. These are not confirmed playable audio streams. Based on their location in ELF binaries and nearby strings such as `external/soloud/src/audiosource/wav/stb_vorbis.cpp`, they are likely codec/test/parser data or static constants rather than asset payloads.

## Native Sound Path Evidence

The absence of standalone audio files does not mean the game lacks sound support. Static strings in `/games/pokemon_pro/game` show a native audio path:

- `libasound.so.2`
- `ALSA`
- `AD_SOUND_MASTER_VOLUME_SETTING`
- `AD_MUSIC_ATTENUATION`
- `AD_SPEECH_ATTENUATION`
- `AD_ENABLE_SPIKE3_BOOT_SOUND`
- `PLAYING SOUND #%d`
- `SPEECH: 'SQUIRTLE'`
- `MUSIC: TEAM ROCKET`
- `MUSIC: MAINPLAY`
- `Radium::Sound`
- `void Radium::Sound::Play()`
- `external/soloud/src/audiosource/wav/stb_vorbis.cpp`

## Ghidra Xref Confirmation

Ghidra program: `/games/pokemon_pro/game`

String xrefs:

- `image.bin` at `026daf08` xrefs to `FUN_008733e0` and `FUN_00872ed0`.
- `void Radium::Sound::Play()` at `026e3508` xrefs to `FUN_009ce680`.
- `src/Sound.cpp` at `026e3528` xrefs to `FUN_009ce680`.
- `bool Radium::BinaryFile::Allocate(unsigned int)` at `026e2b40` xrefs to `FUN_009ce680` and other asset-loading functions.
- `././include/BinaryFile.h` at `026e2b70` xrefs to `FUN_009ce680` and other asset-loading functions.

Relevant decompiler evidence:

- `FUN_00872ed0(uint image_index)` returns `image.bin` by default, or a stored alternate image path for non-default image slots.
- `FUN_008733e0(uint image_index)` builds `image.bin` for index `0` or `image-sc%02d.bin` for non-zero indexes, opens it with `open64`, checks size with `fstat64`, maps it read-only with `mmap64(..., PROT_READ, MAP_SHARED, fd, 0)`, and copies header words from the mapped file into runtime image metadata.
- `FUN_009ce680`, identified by the `void Radium::Sound::Play()` assertion string, calls a BinaryFile factory (`FUN_009fdc90`), looks up an object using fields at the sound object around `param_1 + 0x118`, allocates a buffer of the returned object size, reads the object bytes into that buffer, and passes the buffer to `FUN_00a0c3a0`.
- `FUN_00a0c3a0` wraps the buffer as an in-memory audio source and calls `FUN_00a0c320`.
- `FUN_00a0c320` reads the first four bytes and dispatches only two recognized container magics: `0x5367674f` (`OggS`) to the Ogg/Vorbis path and `0x46464952` (`RIFF`) to the WAV path. Other values return error `3`.
- `FUN_00a0c230` is the Ogg/Vorbis decode setup path and references the embedded stb_vorbis implementation.
- `FUN_00a0c070` is the WAV setup path; it checks for `WAVE`, `fmt `, and `data` chunks.

Static exact byte search of the two image files still found no plain contiguous audio signatures:

| Path | `OggS` | `RIFF` | `WAVE` | `fLaC` | `OpusHead` |
| --- | ---: | ---: | ---: | ---: | ---: |
| `/games/pokemon_pro/image.bin` | `0` | `0` | `0` | `0` | `0` |
| `/games/pokemon_pro/spike3/spike_menu/image.bin` | `0` | `0` | `0` | `0` | `0` |

Conclusion refined by `radium-image-format.md`: Ghidra confirms that the native game uses the mmap-backed runtime image for sound-related ranges. Section 8 of `/games/pokemon_pro/image.bin` is a table of `2491` headerless 16-bit PCM chunks with a validated CRC32 table checksum. These chunks do not carry `OggS` or `RIFF` magic until wrapped by the parser as WAV. The parser scans the full section 5 command-stream table, resolves `12710` opcode `0x0b` references, and maps all `2491` chunks to local object IDs. All chunks are exported as previewable WAV files under `analysis/radium-image/sounds/`. A native `GodotSpikeBridge` registration table maps `25` object IDs to confirmed `SE_*` names. The Pokedex voice stream now maps `1137` objects (`409` through `1545`) to Pokemon description/name/category clips, including six duplicate description variants. Those aliases are previewable in `sound-pokedex-voice.md`, and complete best-name aliases are previewable in `sound-best-named-export.md`. The remaining work is assigning higher-level human-readable sound names and gameplay call sites for the other object IDs.

The current wiki also includes `1705` accepted local Whisper draft transcripts in `sound-asr-draft-labels.md`, produced from `2486` WAV candidates of `0.25s` and longer. These are ASR-derived preview labels, not confirmed native names.
