The comment in audio_i2s.pio explaining the word format reverses the 'ws' (LRCLK) value. The PIO sends the first (most significant) 16 bits with LRCLK = 1 and the second with LRCLK = 0. For stereo samples the second 16-bit half in memory corresponds to bits 31:16 and hence is the right channel (assuming I2S where LRCLK = 0 for left).
; Autopull must be enabled, with threshold set to 32.
; Since I2S is MSB-first, shift direction should be to left.
; Hence the format of the FIFO word is:
;
; | 31 : 16 | 15 : 0 |
; | sample ws=0 | sample ws=1 |
The comment in audio_i2s.pio explaining the word format reverses the 'ws' (LRCLK) value. The PIO sends the first (most significant) 16 bits with LRCLK = 1 and the second with LRCLK = 0. For stereo samples the second 16-bit half in memory corresponds to bits 31:16 and hence is the right channel (assuming I2S where LRCLK = 0 for left).