Repository navigation
DVI audio can play 44.1 kHz and 32 kHz sound too - #11607
Open
mikeysklar wants to merge 7 commits into
Open
mikeysklar wants to merge 7 commits into
mikeysklar wants to merge 7 commits into
Conversation
Fruit Jam now sends sound through the DVI cable of its boot display, as board.DVI_AUDIO. It is set up in board init, before the VM heap takes internal RAM, and is skipped quietly if it doesn't fit. Set CIRCUITPY_PICODVI_AUDIO = false in settings.toml to turn it off. To make that fit next to the 640x480 8-bit boot display, AudioOut now sends audio from a pool of 160 encoded packets referenced by 280 slots, refilled from a 2.5 ms repeating timer, instead of encoding every line. Audio RAM drops from 118 KB to 37 KB at 640 wide. Packets are full 4-sample packets, and the ACR N is picked per pixel clock so frames repeat exactly, so idle frames need no refill. Setup fails cleanly if the refill timer can't be added, and after a long stall the refill skips whole frames instead of walking every slot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drop CIRCUITPY_BOARD_DVI_AUDIO. Boards that set DEFAULT_DVI_BUS_CLK_DP now get board.DVI_AUDIO, turned off with CIRCUITPY_PICODVI_AUDIO. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Boards with a default DVI display have no board.DISPLAY, so the audio output follows supervisor.runtime.display instead of being a board entry. It is None on ports without DVI audio, when CIRCUITPY_PICODVI_AUDIO is false, and after displayio.release_displays(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
play() takes the rate from the sample. The ACR and audio InfoFrame packets are built once per rate when audio starts, and the refill picks the set for the current rate, so DMA never reads a packet being rewritten. Channel status carries the matching IEC 60958 rate code. At 44.1 kHz the search for an exact CTS finds nothing near 20 ACR packets a frame, so it uses the usual N of 6272 and rounds CTS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mikeysklar
marked this pull request as ready for review
October 14, 2026 20:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DVI audio now plays 32, 44.1 and 48 kHz sound.
Why
Most music files are 44.1 kHz, so they no longer need resampling first.
This matches the rates the Arduino DVI-HSTX library supports.
Builds on #11574, which should merge first. Only the last commit is new here.
Tested
Feather RP2350 (8 MB PSRAM), DVI monitor with speakers, 11.0.0-alpha.1 plus #11574 and this PR.
audioout_rates.py, 1 kHz tone at each rate, twiceaudioout_bad_values.py, 22.05 and 96 kHzValueError: Invalid sample_rateboard_audio.pysupervisor.runtime.audioat 44.1, 32, then 48 kHzNot tested: Fruit Jam, Metro RP2350, other monitors.
audioout_bad_values.py's 720-wide block hitsMemoryErroron a Feather with DVI forced on; same on #11574Written with Claude Code. I reviewed the diff, built it, and ran every test above on the board.
🤖 Generated with Claude Code