41 Commits

Author SHA1 Message Date
Thomas Farstrike ce603eecd0 Audio: disable MCK after playback if enabled 2026-02-28 18:18:30 +01:00
Thomas Farstrike 4f82bb9b9f stream_record_adc.py: increase attenuation 2026-02-28 18:18:05 +01:00
Thomas Farstrike 71e1ea8bd2 stream_wav.py: add hardware volume control
uses shift but doesn't seem to work
2026-02-25 14:31:57 +01:00
Thomas Farstrike 391071aee4 Move file 2026-02-25 07:55:47 +01:00
Thomas Farstrike e4c0ee2570 Add duplex test 2026-02-25 07:54:54 +01:00
Thomas Farstrike 0268b20628 stream_wav: restore tweaks
QuasiBird still runs jittery at 22050 hz 16 bit stereo.
Mono is fine, and lower sample rates are fine too.

At max volume, so no volume scaling, the frame rate is quite high
but it still jitters. The question is why...

- does the buffer underrun?
- or does it spend too much time reading from SD card?
- or is the CPU busy?

Solutions:
- offload it to a different core
- do the I2S playback asynchronous

I guess it doesn't make sense tweaking this, as audio plays fine up to 48khz stereo
if no game is being played, just normal GUI updates.
2026-02-24 23:27:53 +01:00
Thomas Farstrike 417b725473 stream_wav: reduce minimal sample rate 2026-02-24 23:20:02 +01:00
Thomas Farstrike 722ab65ebd MusicPlayer: show playing song 2026-02-24 21:44:36 +01:00
Thomas Farstrike cb7669f88a Logging 2026-02-24 21:40:24 +01:00
Thomas Farstrike f358ed65ae Fix volume setting 2026-02-24 16:47:02 +01:00
Thomas Farstrike daa7125052 Rework AudioManager 2026-02-24 16:39:26 +01:00
Jens Diemer 84d3f83966 Odroid-Go: Unmute+Mute buzzer before/after Playback (#52)
On ODROID-GO the buzzer makes noises when it is on and nothing is being played. Don't know if this
is common on ESP32 devices...
2026-02-21 07:44:45 +01:00
Thomas Farstrike 965df2545c fri3d_2026: fix audio 2026-02-20 16:09:38 +01:00
Thomas Farstrike d64afd2cc5 Fix unit test 2026-02-17 21:29:38 +01:00
Thomas Farstrike 7431537010 AudioManager: add support for adc_mic
This works for init:

AudioManager(i2s_pins=i2s_pins, adc_mic_pin=1)

And then this for recording:

AudioManager.record_wav_adc(file_path="/recording.wav",duration_ms=5000,sample_rate=16000,on_complete=lambda msg: print(f"Finished: {msg}"))
2026-02-16 16:39:52 +01:00
Thomas Farstrike 5f448f420b Fix tests 2026-02-13 20:33:19 +01:00
Thomas Farstrike 6501ab4c1c Add experimental ADC recording
Currently, the file is a bit too small and there are interruptions,
probably from the timer stopping and starting to tweak it.

I guess this should be done in C rather than pure MicroPython.
2026-02-03 20:33:25 +01:00
Thomas Farstrike 1334466538 Fix clocks 2026-02-03 07:56:52 +01:00
Thomas Farstrike 1f9eee3a9d Rename AudioFlinger to AudioManager framework 2026-01-26 13:13:54 +01:00
Thomas Farstrike 43eb8220c8 Move mpos.apps.good_stack_size() to TaskManager.good_stack_size()
Trying to get every app-facing API as part of an object.
2026-01-24 19:10:51 +01:00
Thomas Farstrike 2debeca273 Comments 2026-01-14 11:22:10 +01:00
Thomas Farstrike 22f1202c7c Simplify AudioFlinger 2026-01-14 11:15:37 +01:00
Thomas Farstrike 63f4c1c257 Cleanup AudioFlinger 2026-01-14 11:03:00 +01:00
Thomas Farstrike 76be9fd968 Simplify AudioFlinger 2026-01-14 10:39:47 +01:00
Thomas Farstrike fd548d45f1 AudioFlinger framework: simplify import, use singleton class 2026-01-13 23:48:52 +01:00