Repository navigation
DVI audio uses a third of the RAM, so Fruit Jam has sound on by default - #11574
mikeysklar wants to merge 8 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>
The title and message aren't very helpful. I'd really like to know how RAM use was dropped by a third. |
|
That is good feedback. Usually, I try to avoid the how as it is full of burdensome details. I had been working on Arduino Audio DVI in parallel and noticed it was 4x smaller so wanted to shrink things down on the CP side.
|
tannewt
left a comment
There was a problem hiding this comment.
I think this could be simplified a bit. Thanks for working to get it on by default!
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>
|
Also tested on a Metro RP2350 with the boot display forced on: |
tannewt
left a comment
There was a problem hiding this comment.
One switch about board. Maybe we also need a runtime attribute for audio out?
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>
Sphinx cannot link it, so the docs build failed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@tannewt Ready for another look. Removed the Fixed the broken docs reference in fd4d303. Tested on a Feather RP2350: the picodvi manual test passes and a PicoTTS demo plays through it. |
tannewt
left a comment
There was a problem hiding this comment.
One comment nit. Good otherwise. Thanks!
kk Co-authored-by: Scott Shawcroft <scott@tannewt.org>
What
DVI audio now uses 37 KB of RAM instead of 118 KB.
That leaves room to turn sound on by default on Fruit Jam, as
board.DVI_AUDIO.Video: a tone, then a short tune, through the monitor speakers
Why
tannewt asked for sound on by default in #11510.
At 118 KB it did not fit next to the 8-bit boot display.
MemoryErrorboard.DVI_AUDIONoneafterrelease_displays()CIRCUITPY_PICODVI_AUDIO = falsein settings.tomlTesting
Adafruit Fruit Jam, Linux host, monitor with speakers.
board_audio.py,audioout_formats.py,audioout_bad_values.py,audioout_release.pyAI assistance
Claude Code wrote the code and ran the tests.