applet.audio.i2s_capture: implement I2S audio capture #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements an I2S capture interface, with all signals as inputs (Bit Clock, Frame Select, Data).
LED indicate state:
This applet supports auto detection for the bit rate, sample rate, and can thus calculate the expected sample size.
The closest "standard" value is then used for each of these - if the deviation is too high, a warning will be presented.
Custom sample rate and sample sizes can be specified using
--sample-rate
and--sample-size
.NOTE: When using auto detection, the first few samples will be missed.
Not all I2S interfaces use the full word size for sample data (e.g: 32-bit word, with 16-bit samples).
This applet will support this use-case, but cannot detect it automatically.
This applet only supports left-aligned sample data.
The sample rate parameter only needs to be accurate if the resulting WAV file needs to play at approx. 100% speed.
Both I2S and PCM modes are supported (I2S has the sample data shifted 1 bit clock after the frame select signal).
This applet seems to work fine for standard data rates up to 48kHz / 16-bit samples, but higher data rates will cause it to trip due to the FIFO filling up.
On a fault, the gateware returns to the
COMMAND
state, and the software presents a warning.Due to the issues presented by the higher sample rates, I'm considering adding an extra FIFO in the FPGA... but would appreciate feedback before I look into this.