mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -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 |
||
|---|---|---|
| .. | ||
| arm | ||
| coldfire | ||
| hosted | ||
| mips | ||