Short: AHI driver: Pi 3/4 audio jack, PiStorm Author: hakke@gmx.de (Andreas Winkler) Uploader: hakke gmx de (Andreas Winkler) Type: driver/audio Version: 4.10 Requires: PiStorm with Pi 4 B or Pi 3 B/B+/A+, Emu68, AHI 6 Architecture: m68k-amigaos >= 3.1 Kurz: AHI-Treiber: Klinke von Pi 3/4, PiStorm Emu68 PWM is an AHI driver that plays through the 3.5mm audio jack of the Raspberry Pi 4 or Pi 3 in a PiStorm (a PiStorm32-lite, or a classic PiStorm) running Emu68: a further stereo output next to Paula and next to the HDMI output of emu68hdmi.audio. Ideal as the headphone (cue) output of a DJ program such as StormDJ, or as a second output for a second program. This is a beta version, tested on... - a Pi 4 in a PiStorm32-lite with Emu68 1.1.0 beta - a Pi 3 in a classic PiStorm - a Pi 3 B in a PiStorm32-lite with Emu68 1.0.7 (flype44's 4.8) Please report problems to hakke@gmx.de, with your Pi model, your Emu68 version and the output of PWMDiag. Features -------- - Two AHI modes, 16-bit stereo 48 kHz: normal (12 x 16 ms buffer) and low latency (3 x 16 ms), for Units 0-3 and the music unit. - About 11 bits of resolution: fine for headphones and monitoring. - Soft start and stop: no thump from the jack. - AHI's output volume (Prefs/AHI "Output volume"), with a smooth ramp, from -60 dB up to a +12 dB boost for headphones. - Optional dither for quiet passages, chosen as the unit's Output in Prefs/AHI. - DMA paced by the PWM hardware, completion by interrupt: about 62 wake-ups a second, no polling. On the Pi 3 the interrupt comes through arm-intc.library, included. - Up to four programs play through the jack at once, mixed by the driver: a game and a music player, for example. - AHI's CPU overload protection, as in paula.audio; no holes while windows are moved. - A reset guard: the jack stops cleanly before a reboot. - Installs next to emu68hdmi.audio: different mode IDs (001f0020, 001f0021), different hardware, both can be in Prefs/AHI. - PWMTest: a test tone through the jack without AHI, for troubleshooting. - PWMDiag: what the driver did, for problem reports. - Emu68PWM-Mixer by flype44: meters, oscilloscope, spectrum and goniometer of the sound leaving the jack (MUI 3.8+). - An AmigaGuide manual. Requirements ------------ - A PiStorm with a Raspberry Pi 4 Model B, or a Raspberry Pi 3 Model B, B+ or A+: the models with the 3.5mm jack. NOT the CM4, CM3, Pi 400 or Pi Zero 2 W: they have no jack, and on them GPIO 40/41 are wired to other parts of the board. Since 4.10 the driver, PWMTest and PWMDiag refuse them and touch nothing. - Emu68 with devicetree.resource in its ROM; on the Pi 4 Emu68 1.1 or newer (gic400.library 1.3+). - On the Pi 3: arm-intc.library 0.3 or newer, recommended (the DMA interrupt instead of polling). It is in the Libs drawer of this archive; source: https://github.com/flype44/arm-intc.library - AHI 6.x. No mailbox.resource is needed any more: the driver used it only to ask the firmware which DMA channels are free, a list the device tree holds already. So 4.9 also runs with Emu68 1.0.7, whose ROM has none, until Emu68 1.1 is final. Installation ------------ From the archive: Copy Emu68PWM/Devs/AHI/emu68pwm.audio DEVS:AHI/ Copy Emu68PWM/Devs/AudioModes/Emu68PWM DEVS:AudioModes/ and on a Pi 3, unless a newer one is installed: Copy Emu68PWM/Libs/arm-intc.library LIBS: Reboot and pick an Emu68 PWM mode in Prefs/AHI. See Emu68PWM.guide. Internet radio -------------- AmigaAMP plays MP3 streams over HTTP through the jack. On a Pi 3 a 128 kbit/s stream leaves about 85% of the 68k free. Best settings in AmigaAMP's Prefs: Buffers Loading 64-128 KB, Playback 1/2-1 s; Task Priorities Playback 5, so that moving windows leaves no holes. Credits ------- Many thanks to flype44 for 4.8: the DMA interrupt on the Pi 3, up to four programs at once, no holes while windows move, the reset guard and Emu68 1.0.7 support; and to arczi84 for the mixing of several programs in emu68hdmi.audio 4.18, on which that is based. Emu68PWM-Mixer by Philippe Carpentier (flype44), GPL-3.0-or-later. Built on emu68hdmi.audio 4.17 (arczi84, flype44; GPL-3.0-or-later); several programs at once after emu68hdmi.audio 4.18 (arczi84). arm-intc.library (flype44, MPL-2.0); the reset guard of emu68-common (Rondoval, MPL-2.0 or GPL-2.0+). PWM sound set-up after Circle by R. Stange (GPL-3.0-or-later). Emu68 and its resources by Michal Schulz, AHI by Martin Blom. Author: Andreas Winkler - www.taiwanrider.com (HAKKE Online Shop, Amiga and synthesizer related hardware and software). License ------- GNU General Public License, version 3 or later: see COPYING. The complete source code is in the Source drawer of this archive; please pass the archive on complete, with it. Disclaimer ---------- Emu68 PWM is provided "as is", without warranty of any kind. You use it at your own risk: the author takes no responsibility for any loss of data or for any damage to software or hardware, whatever the cause. History ------- 4.10 SAFETY FIX: refuses every board without the audio jack (CM4, CM3, Pi 400, Zero 2 W). Earlier versions accepted the CM4, the Pi 400 and the CM3 and drove GPIO 40/41, which are wired to other parts there (the boot EEPROM's SPI lines on a CM4). Thanks to flype44 for the warning. New: Emu68PWM-Mixer by flype44. 4.9 Improvements by flype44 (his test version 4.8): Pi 3: DMA interrupt through arm-intc.library (included). Up to four programs at once, mixed. No more holes while windows are moved. Reset guard: the jack stops before a reboot. No mailbox.resource needed: runs with Emu68 1.0.7. 4.7 Sound comes back after an Amiga reset (no Pi restart needed). 4.6 First public release.