mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-09 23:53:28 -04:00
pcm-rk27xx.c had no recording at all. Add it for targets with HAVE_RECORDING: HDMA channel 1 moves the I2S Rx FIFO into the recording buffer - hdreq 7, fixed source, incrementing destination, 32-bit inc8 slices, the mirror of the playback channel and the setup the Samsung YP-CP3's original firmware uses. Playback keeps channel 0, so the two can run together. - HDMA_ISR holds both channels' masks and flags; playback used to write all of it, clearing whatever the other channel had. Each channel now updates only its own bits, and INT_HDMA serves each channel's count down flag. Both channels start masked and clear. - Recording cannot mask the shared interrupt, so pcm_rec_lock() defers a completed buffer to pcm_rec_unlock() instead. - In master mode the I2S Rx side runs only while recording: started with nothing reading its FIFO it upsets playback. I2S_RXCTL gets the Tx frame format, plus bit 24 as the YP-CP3's original firmware sets it. - audio-rk27xx.c routes inputs through audiohw_set_recsrc() on targets that record. Only partly tested, on a YP-CP3: playback and FM radio still work after the interrupt changes, and the recording screen's peak meter follows the microphone, so samples arrive through the DMA. Not yet tested: playing back a recorded file, recording FM, long recordings, recording while playing. A known risk: a flag set by the hardware in the few cycles of the read-modify-write of HDMA_ISR would be lost and stall that channel. Other rk27xx targets build; their playback was not retested on hardware. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Change-Id: Idc64bce8075d0fc628c29767fc33beda4fff4342 |
||
|---|---|---|
| .. | ||
| asm | ||
| common | ||
| drivers | ||
| export | ||
| include | ||
| kernel | ||
| libc | ||
| reggen | ||
| target | ||
| usbstack | ||
| arabjoin.c | ||
| arabjoin.h | ||
| ata_idle_notify.c | ||
| backlight-sw-fading.c | ||
| backlight.c | ||
| bidi.c | ||
| buflib_malloc.c | ||
| buflib_mempool.c | ||
| chunk_alloc.c | ||
| COPYING | ||
| core_alloc.c | ||
| debug.c | ||
| eeprom_settings.c | ||
| elf_loader.c | ||
| enc_base.c | ||
| events.c | ||
| firmware.make | ||
| font.c | ||
| font_cache.c | ||
| general.c | ||
| hangul.c | ||
| lc-rock.c | ||
| linuxboot.c | ||
| logf.c | ||
| lru.c | ||
| panic.c | ||
| pcm.c | ||
| pcm_mixer.c | ||
| pcm_sampr.c | ||
| pcm_sw_volume.c | ||
| powermgmt.c | ||
| profile.c | ||
| README | ||
| rolo.c | ||
| rom.lds | ||
| screendump.c | ||
| scroll_engine.c | ||
| sdmmc.c | ||
| sound.c | ||
| SOURCES | ||
| storage.c | ||
| system.c | ||
| timer.c | ||
| tuner.c | ||
| usb.c | ||
See docs/README