Commit Graph
6 Commits
Author SHA1 Message Date
Claude ad4c1866eb Multimedia timers: interactive quality of service on macOS
Windows runs timeSetEvent's callbacks at time-critical priority. On
macOS a program not in the foreground, as on the CI runner, gets a
lower quality of service, whose timed waits the system lets run late
to save power, so a 10 ms periodic timer lost ticks and audiotest saw
fewer than five in 300 ms. The timer thread now asks for interactive
service. audiotest prints the count and the time when the check fails.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
2026-11-20 19:45:13 +00:00
Claude a9fda2ad18 audiotest: give the early-stopped recording 0.4 s buffers
On the macOS runner a thread's sleep can overshoot by much more than a
20 ms chunk, and the recording catches up in a burst that filled the
0.1 s buffer before the test first saw a position. Buffers of 0.4 s
leave room for that while still checking that a stop hands back a
part-filled one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:42:14 +00:00
Claude fb16704c8f tests: check what Windows and Wine agree on for the new APIs
iotest calls GetEnvironmentStringsA only without UNICODE, where the
SDK headers name it. wintest's symbol font check needs Wingdings on
Windows, which Wine does not have, so it is skipped there when the
font is missing. Wine's MMIO_DELETE reports success but leaves the
file, so audiotest checks that the file is gone only elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:36:23 +00:00
Claude 7f4cd19673 waveIn: keep what the read in progress brings in when stopped
waveInStop threw away the chunk being read when it stopped, so a
recording stopped soon after it started could hand back an empty
buffer, as on the macOS runner. The stop now waits for that read and
keeps it; only waveInReset discards. audiotest waits until some sound
has come in before stopping, and bounds the periodic timer's ticks by
how long its sleep really took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:32:52 +00:00
Claude 7a46a21945 port: the environment block, GetUserName, Beep and the standard folders
GetEnvironmentStrings(W) and FreeEnvironmentStrings give a copy of the
environment; GetUserName the login name; Beep plays its tone through the
sound device. SHGetFolderPath and SHGetSpecialFolderPath give the XDG
folders and the home folder on Linux (CSIDL_APPDATA is ~/.config,
CSIDL_PROFILE is the home folder) and the ~/Library folders on macOS,
creating them with CSIDL_FLAG_CREATE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:16:04 +00:00
Claude 38c7ad8734 port: waveOut and waveIn, the ACM, mmio, PlaySound and multimedia timers
Sound goes to ALSA on Linux (libasound, loaded at run time) and to audio
queues on macOS, or to a loopback device (WINPORT_AUDIO=null) that keeps
time and records what was played. waveOut and waveIn convert any format
the built-in ACM driver reads (PCM, float, A-law, mu-law, IMA ADPCM, at
any rate and channels) for the device, with callbacks, loops, pause,
positions and volume. The ACM enumerates, suggests and converts those
formats; mmio reads and writes RIFF files on disk and in memory;
PlaySound plays files, resources and images; timeSetEvent runs timers on
threads. windows.h includes mmsystem.h, as the system's does.

audiotest covers it, through the loopback device natively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-20 16:16:04 +00:00