Skip to content
16 changes: 16 additions & 0 deletions docs/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,22 @@ Example: Configure the display to 640x480 black and white (1 bit per pixel):
`Adafruit Feather RP2350 <https://circuitpython.org/board/adafruit_feather_rp2350/>`_
`Adafruit Metro RP2350 <https://circuitpython.org/board/adafruit_metro_rp2350/>`_

CIRCUITPY_PICODVI_AUDIO (boolean)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Whether the display configured at board initialization also sends sound through
the DVI cable, as ``supervisor.runtime.audio``. Defaults to true. It needs a 640-wide
output: 640x480, 320x240 or 160x120. Audio uses about 37 KB of internal RAM
next to a 640x480 display. Set this to false to keep that RAM free, for
example on a monitor without speakers.

``supervisor.runtime.audio`` is a :py:class:`picodvi.AudioOut`. It becomes ``None`` when
the display is released by ``displayio.release_displays()`` or when it is
deinitialized, and stays ``None`` until the next reset.

`Adafruit Feather RP2350 <https://circuitpython.org/board/adafruit_feather_rp2350/>`_
`Adafruit Fruit Jam <https://circuitpython.org/board/adafruit_fruit_jam/>`_
`Adafruit Metro RP2350 <https://circuitpython.org/board/adafruit_metro_rp2350/>`_

CIRCUITPY_SAFEMODE_DELAY (float)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wait for the specified amount of time, in seconds, for the user to press the reset button
Expand Down
19 changes: 13 additions & 6 deletions ports/raspberrypi/bindings/picodvi/AudioOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,24 @@
//| class AudioOut:
//| """Plays audio through the DVI cable of a `Framebuffer`, on displays
//| that have speakers or an audio output. RP2350 only: elsewhere the
//| constructor raises `NotImplementedError`."""
//| constructor raises `NotImplementedError`.
//|
//| On boards with a default DVI display, ``supervisor.runtime.audio`` is an AudioOut
//| for the display configured at startup. It is ``None`` if that display
//| was not configured, its mode has no room for audio, or it was released.
//| Set ``CIRCUITPY_PICODVI_AUDIO = false`` in ``settings.toml`` to turn it
//| off."""
//|
//| def __init__(self, framebuffer: Framebuffer) -> None:
//| """Create an AudioOut that sends audio with ``framebuffer``'s video.
//|
//| The framebuffer must use a 640-pixel-wide output mode, such as
//| 640x480 or 320x240. This reserves about 120 KB (640 wide) or
//| 150 KB (320 or 160 wide) of internal RAM until `deinit`, so create
//| the AudioOut soon after the Framebuffer. A 640x480 framebuffer with
//| 8-bit color leaves too little RAM. The display receives silence
//| whenever nothing is playing.
//| 640x480 or 320x240. This reserves about 37 KB (640 wide) or
//| 50 KB (320 or 160 wide) of internal RAM until `deinit`, so create
//| the AudioOut soon after the Framebuffer. With 640x480 and 8-bit
//| color, usually only the display configured at startup has room
//| for audio. The display receives silence whenever nothing is
//| playing.
//|
//| :param Framebuffer framebuffer: The display output to add audio to
//|
Expand Down
Loading
Loading