Skip to content

Clarification on I2S library #1450

Answered by earlephilhower
LinusHeu asked this question in Q&A
Discussion options

You must be logged in to vote

1. get bytes/Samples/words available for write int availableForWrite()

Returns the number of L/R samples that can be written without potentially blocking.
But from looking at the code it looks to me like it returns the amount of 32-bit chunks that can be written. Not necessarily the amount of samples. For example if using 8 bit per sample there would be two L+R samples in each 32-bit chunk. When using 32 bit per sample, each 32-bit chunk would only be half a L+R sample.

Yes, this is a known bug. It's a little more complicated than "multiply by 4 and then divide by 2*samplewidth" because you could read out the L but not R sample so you need to look at the leftover bits. It's a lot of h…

Replies: 1 comment 4 replies

Comment options

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

@earlephilhower
Comment options

@LinusHeu
Comment options

@earlephilhower
Comment options

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