Commit Graph

18 Commits

Author SHA1 Message Date
Jeff Epler 774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
Dan Halbert 2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
Scott Shawcroft 9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00
Jeff Epler 749bb99863
bump pico-sdk to 1.3.0 2022-02-02 17:15:33 -06:00
Dan Halbert 5fe4c3bec9 fix mistaken use of PWM channel for slice 2021-12-05 21:16:46 -05:00
Jeff Epler bef07961ab raspberrypi: audiopwmout: subtle for #5092
I noticed that the loop over 65535 possible denominators took a long time,
causing up to 100ms wait for a sound sample to start playing!

This algorithm, adapted from an algorithm shown in Python's fractions.py,
is guaranteed to find the best denominator in a small number of steps
(I think log2-many steps but I'm not sure). In practice, it means the time
between samples playing is just 10ms, and some of that is recreating the
sine wave sample in Python each time.

It often finds the same solution as the old code, but sometimes it finds
one a bit better since it compares the ratios using float point instead
of integer arithmetic.
2021-08-24 16:33:20 -05:00
Jeff Epler 77b0c76a37 raspberrypi: audiopwmout: simple fix for #5092 2021-08-24 15:54:06 -05:00
Dan Halbert 35aac3d26b display SPI now 10MHz; set PWM duty cycle to zero at stop to quiet output 2021-08-11 10:48:53 -04:00
Dan Halbert 24e61a7da8 Track more carefully which audio buffers to fill, based on interrupt channels 2021-08-10 22:00:09 -04:00
Dan Halbert 2451c788f4 valid channels in audio_dma_stop; cleaner supervisor_ticks mgmt in keypad 2021-08-09 09:47:13 -04:00
Dan Halbert bd6826496c Fix various RP2040 audio dma things: (see detailed commit message)
1. Check for correct error values from dma_claim_unused_channel.
2. Introduce a .stereo flag for simplicity.
3. Clarify PWM carrier frequency choice.
4. Start introducing quiescent audio value. Still need to ramp up/down.
5. Redo audio stop logic a bit.
6. Fix (unrelated) displayio dependency things.

There is still an interference problem between other DMA users and audio. Still debugging this.
2021-07-08 08:14:49 -04:00
Dan Halbert 33bbb8b1f4 RP2040 PWMAudioOut: Release DMA channels after play has finished. 2021-07-01 17:36:29 -04:00
root 8761e4bfd7 Initialize pacing timer 2021-05-30 12:12:38 -05:00
root a2b220370e Fix formatting issue 2021-05-29 12:26:41 -05:00
root 760e8c77bd Changes to correct repeat playing on a channel 2021-05-29 11:55:10 -05:00
root 24e641a834 Fix for Issue #4266 2021-05-25 16:06:00 -05:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Scott Shawcroft 191b143e7b
Add PWM based audio playback
See
https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out
to get started.

Fixes #4037
2021-02-09 15:38:33 -08:00