mirror of
https://github.com/libretro/parallel-dc.git
synced 2026-11-07 04:25:58 -10:00
A CHD was read through one decoded hunk and a thread that decoded one hunk ahead. A game that plays CD audio while it streams data reads the two from different places a sector at a time, so each threw out the other's hunk and aimed the thread away from it, and the hunks were decoded on the emulation thread: a stutter a GDI never shows. Each stream (data tracks, audio tracks) now reads through its own libretro-common vfs_prefetch, whose thread decodes the hunks ahead on an image handle of its own, one window per hunk; sectors are lent from the windows in place, and a read command's Prefetch() sets the data stream's thread going before the first sector is asked for. The core defines HAVE_THREADS where it builds threads, so the prefetcher is not compiled to stubs. tools/chd/chd_streams_test, run from tools/chd/run.sh and now in CI, reads audio and data at once and fails when the reading thread does the decoding.
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
name: CHD reading
|
|
|
|
# tools/chd/run.sh: every frame of CHDs made with each CD codec, a GD-ROM
|
|
# image and a parent chain against the files they came from; and CD audio
|
|
# and data read at once through chd.cpp, where the read-ahead threads must
|
|
# decode the hunks and neither stream throw out the other's (ASan + UBSan,
|
|
# TSan).
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'core/imgread/**'
|
|
- 'core/deps/coreio/**'
|
|
- 'core/archive/**'
|
|
- 'core/libretro-common/formats/**'
|
|
- 'core/libretro-common/encodings/**'
|
|
- 'core/libretro-common/vfs/**'
|
|
- 'core/libretro-common/streams/**'
|
|
- 'core/libretro-common/rthreads/**'
|
|
- 'tools/chd/**'
|
|
- '.github/workflows/chd.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'core/imgread/**'
|
|
- 'core/deps/coreio/**'
|
|
- 'core/archive/**'
|
|
- 'core/libretro-common/formats/**'
|
|
- 'core/libretro-common/encodings/**'
|
|
- 'core/libretro-common/vfs/**'
|
|
- 'core/libretro-common/streams/**'
|
|
- 'core/libretro-common/rthreads/**'
|
|
- 'tools/chd/**'
|
|
- '.github/workflows/chd.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
chd:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install chdman
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends build-essential mame-tools python3
|
|
- name: CHD reads, and CD audio and data at once
|
|
run: sh tools/chd/run.sh
|