Skip to content

Test reorganization and bug fixes - #617

Merged
alnitak merged 118 commits into
mainfrom
test-reorg
Nov 25, 2026
Merged

alnitak merged 118 commits into
mainfrom
test-reorg

Conversation

@alnitak

@alnitak alnitak commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Description

A bug-fix release: a new, much larger test suite found many bugs, now fixed.

Added

  • set3dAutoUpdate, get3dAutoUpdate and update3dAudio: with the automatic update disabled the 3D setters only store their values, and one update3dAudio() per frame applies them to all the 3D voices. By default every setter still recomputes all the 3D voices, which is one full pass per call with many moving sources.
  • set3dDefaultAttenuation, set3dDefaultMinMaxDistance and set3dDefaultDopplerFactor: 3D settings of a sound that every voice started later from it begins with, from its first sample. The set3dSource* setters act on one voice after it has been created, so they had to be repeated after every play3d.

Behaviour changes

  • Bus equality is now identity (==/hashCode removed), and every bus becomes invalid after deinit().
  • Setters (volume, pan, speed, fades, oscillations, 3D, play*() arguments, filter parameter fades, ...) throw ArgumentError for NaN or infinite values.
  • Voice groups, createMixingBus, the 3D methods and setBufferIcyMetaInt throw SoLoudNotInitializedException before init(), like the rest of the API.
  • Filters:
    • Using a parameter of a filter that is not active throws SoLoudFilterNotFoundException; an invalid parameter index throws SoLoudInvalidParameterException.
    • A sound's filter parameter used without soundHandle throws ArgumentError (it used to change the global filter).
    • Parameter ranges now match the native ones (biquad, flanger, limiter, pitch shift, parametric EQ).
    • EQ: transparent with all bands at 1, and the bands cover the whole spectrum, so existing EQ settings sound different.
    • Custom filters expose 15 user parameters (it was 7).
    • biquadFilter is deprecated: use biquadResonantFilter.
  • Vst3Host.loadEffect only supports global and bus slots, and throws ArgumentError for a single sound's slot.
  • Ogg Opus streams with 3 to 8 channels are downmixed to stereo.
  • Linux without FFmpeg: loading AAC/M4A/AC-3 throws SoLoudAudioFormatNotSupportedCppException.
  • Web: custom sources and filters with webJsFunctionName work only with the single-threaded WASM build; loadMem/loadUrl of undecodable data throw SoLoudFileLoadFailedException, and addPullBufferDataStream throws on errors.

Fixes

  • Engine and 3D: speechText() crash on play(); set3dListenerUp; distance attenuation applied twice; inverted Doppler shift; 3D settings lost before the first sound is loaded; NaN audio with min/max distance 0; play() at the voice limit stopping a protected voice.
  • Filters: waveshaper output growing without bound, bassboost boosting high frequencies, pitch shift semitones, biquad cutoff above Nyquist.
  • Streams: lost, duplicated or glitchy audio when data arrives in small chunks (MP3, FLAC, WAV, Vorbis, Opus, AAC, AC-3); more accurate seeking; chained Ogg streams; ICY metadata; addAudioDataStream and setDataIsEnded work again from worker isolates.
  • Decoding:
    • Apple: HE-AAC plays at full rate, the last AC-3 frame is no longer dropped.
    • Android: AC-3/E-AC-3 in MP4 on devices with Dolby's decoder no longer cuts the start/end or applies the Atmos leveler.
    • Linux: crashes and wrong lengths with FFmpeg 4.4/5.x fixed; decoding from memory honors TMPDIR.
    • FLAC files without a total length load; M4A bitrate is correct.
  • Recording (mixer output): correct channel order for 6/8-channel Vorbis and FLAC; valid WAV files over 4 GB.
  • Linux devices: a failed backend switch keeps the previous backend; the device recovers when PulseAudio comes back; the VST3 editor's close button works.
  • Robustness: invalid arguments and out-of-memory no longer crash the app, and several crashes, deadlocks and data races are fixed.

Type of Change

  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • 🧹 Code refactor
  • 📝 Documentation

- speechText: no crash on play, independent sources
- set3dListenerUp sets the up vector
- 3D setters work before the first load
- countAudioSource counts waveforms
- createVoiceGroup before init fails
- Bus equality is now identity
- sample-accurate seek
- partial frames and extended ID3 headers
- audio lost with capped output
- missing frames at start
- heap over-read in parser
- thread-safe FFmpeg loading
- audio lost on small chunks
- last AC-3 frame dropped
- HE-AAC played without SBR
- COM released on another thread
- short streams not decoded
- setvbuf(_IOLBF, 0) is an invalid parameter for the Microsoft C runtime and aborts the process: make stdout unbuffered there
- write temporary files to the system temp directory instead of $TMPDIR or /tmp
- count every FFmpeg dlopen() attempt, not only those the test refuses
- pass the first binary to llvm-cov as positional, the others with -object
- actions/checkout and actions/upload-artifact v7
- dart analyze instead of the Node 20 analyzer action
- libavformat/libavcodec runtime so the Linux decoder test also decodes
- use _strdup on msvc (c4996)
- cast the voice count to unsigned int (c4267)
…t3dDefaultDopplerFactor`

3D settings stored on the sound: a voice copies them when it is created,
so they hold from its first sample and need no call on the handle after
every play3d. They also apply while the automatic 3D update is disabled.
Each play variant scanned the list of loaded sounds and built a set to find
the sound it had been given. The loaded sounds are now kept in a map by
hash, so the lookup is constant time and allocates nothing.
The dartdoc of loadFile, loadAsset and loadUrl and the loading and playback
skills said it was a no-op. The engine loads a second, independent sound
with its own memory and logs a warning.
Rebuilt with the set3dAutoUpdate, get3dAutoUpdate, update3dAudio and
set3dDefault* exports.
Both match the pubspec.lock rule in .gitignore, which made
`dart pub publish --dry-run` warn about checked-in ignored files.
@alnitak
alnitak force-pushed the test-reorg branch 2 times, most recently from 8467319 to 5ae1351 Compare November 25, 2026 17:34
@alnitak
alnitak merged commit aa90252 into main Nov 25, 2026
13 checks passed
@alnitak
alnitak deleted the test-reorg branch November 25, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant