Skip to content
Discussion options

You must be logged in to vote

I was able to get it to work. Measuring the SD card read speed I was able to get 176kb/sec which is more than enough for a 44.1kb/sec wav stream. The trick was switching to an async circular buffer and only reading in as many bytes as necessary for each DMA. I put some example code here.

The relevant part:

    let mut transaction = i2s_tx.write_dma_circular_async(tx_buffer).unwrap();
    loop {
        transaction.push_with(|dma_buf| {
            // len = length of dma_buffer in bytes
            let i32_len = file_buffer.len();
            // use the shorter of dma and file buffer lengths
            let file_len = (dma_buf.len()/4).min(i32_len);
            // file_buffer is u32 so we …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@bjoernQ
Comment options

Comment options

You must be logged in to vote
4 replies
@Dominaezzz
Comment options

@joshmarinacci
Comment options

@Dominaezzz
Comment options

@joshmarinacci
Comment options

Answer selected by joshmarinacci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants