Skip to content

cleanup: drop the vendored psychopy-sounddevice fallback, use PTB everywhere - #336

Merged
pellet merged 2 commits into
NeuroTechX:masterfrom
pellet:cleanup/remove-psychopy-sounddevice
Aug 29, 2026
Merged

cleanup: drop the vendored psychopy-sounddevice fallback, use PTB everywhere#336
pellet merged 2 commits into
NeuroTechX:masterfrom
pellet:cleanup/remove-psychopy-sounddevice

Conversation

@pellet

@pellet pellet commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

psychtoolbox 3.0.22.2 ships a macosx_11_0_universal2 wheel, so PTB (Psychtoolbox) runs on
Apple Silicon and the Darwin/arm64 sounddevice fallback in eegnb/experiments/__init__.py is no
longer needed. This drops it, the vendored psychopy-sounddevice copy and its git dependency;
every platform now takes the same PTB path.

The fallback had stopped working regardless. PsychoPy 2026.x resolves the backend from the
psychopy.sound.backends entry-point group, and the plugin declares its entry point under the
older psychopy.sound group — so Sound.backend stayed 'ptb' the whole time, while
plugins.loadPlugin() kept returning True.

Two follow-ons in tests/test_run_experiments.py: audio_lib defaulted to 'sounddevice', and
the sound.getDevices() assert raised AttributeError (2026.x removed it alongside
sound.setDevice) — it now goes through SpeakerDevice.getAvailableDevices(). The conda cffi
entry existed only for python-sounddevice#397; cffi still arrives via soundfile as a prebuilt
wheel on every supported platform.

psychtoolbox is listed explicitly, scoped to platform_machine == "arm64". The psychopy fork
pinned here predates upstream dropping psychtoolbox<3.0.20; platform_machine != "arm64" in
2026.2.0, so on Apple Silicon it requests no PTB at all (3.0.19.14 has no arm64 wheel) and a
transitive dependency installs nothing. The marker is the exact complement of the fork's, so
every other platform keeps resolving through the fork's own <3.0.20; an unscoped >=3.0.20
conflicts with it head-on. The line can go once the psychopy pin reaches upstream >=2026.2.0.

Worth knowing on macOS and Windows: PTB 3.0.20+ introduced paid licensing for its prebuilt
binaries on those platforms (psychtoolbox.net). Linux is unaffected.

Verified on macOS arm64: import eegnb.experiments selects psychopy.sound.backend_ptb and
constructs a Sound; the auditory-oddball config path asserts cleanly.

@pellet
pellet force-pushed the cleanup/remove-psychopy-sounddevice branch 6 times, most recently from 9441069 to 7b35b90 Compare August 29, 2026 13:10
…rywhere

Psychtoolbox 3.0.22.2 ships a universal2 macOS wheel, so PTB now works on
Apple Silicon and the Darwin/arm64 sounddevice branch is dead weight. Removes
the vendored plugin copy and its git dependency.

psychtoolbox stays explicit (>=3.0.20) because the pinned psychopy fork still
carries the old `psychtoolbox<3.0.20; platform_machine!='arm64'` constraint;
requirements.txt records why, and when it can go.
@pellet
pellet force-pushed the cleanup/remove-psychopy-sounddevice branch from 7b35b90 to 53f8824 Compare August 29, 2026 13:18
@pellet
pellet marked this pull request as ready for review August 29, 2026 23:42
@pellet
pellet merged commit 6c3a8df into NeuroTechX:master Aug 29, 2026
8 checks passed
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