gregoryxie / nicer-rack

MIT License
0 stars 0 forks source link

data being output from DAC in wrong order #6

Closed gregoryxie closed 2 years ago

gregoryxie commented 2 years ago

Symptom: DAC output garbled/out-of-order when receiving data from UDP. However, sending constant values over UDP create expected output and data does arrive in order (see week 1 demo video).

278470147_522080292874019_8655275807728597644_n

gregoryxie commented 2 years ago

278359750_1171937603570642_7223351610382021231_n

First couple of waves after startup when DMA buffers are empty look good, maybe we should try to completely clear the buffers once in a while? "tx_desc_auto_clear" is supposed to do this automatically but makes it so there are large breaks in the output, scope shows no data being sent during these times.

gregoryxie commented 2 years ago

Fixed, it was a couple of things - originally I was doing one transfer every I2S_EVENT_TX_DONE event, it seems you don't always get 1 event per DMA buffer empty so data in old buffers were not overwritten. Switched to doing transfers until no bytes were written in the transfer. Also was running out of data in the audio buffer (from UDP)