After my first try with the DMA controller on the XMEGA was a success (after a lot of wasted time), I decided to continue and use another DMA channel for reading the audio data from the SD card...So I swapped the pins from the card's SPI interface (USART in master SPI mode) and started writing code. The trick with reading from SPI is that you have to write to SPI in the same time, because the MCU is the master and the card is the slave. So I actually configured 2 DMA channels just for reading data from the card. One writes blocks of 0xFF's and the other channel reads the answers. My idea was to start reading a sector (send commands, etc) then transfer the data block in 32 byte chunks using DMA. When the buffer had data, start transferring it to the audio decoder via another DMA channel. If the buffer is full, pause the transfer from the SD card and if the buffer is empty, pause the transfer to the audio decoder. In the end, the data transfer would've been done by the DMA controller and some interrupts.
And here I found a bug. After some segments (32 byte chunks) are read from the card, the vs1053 dma channel starts sending them to the audio decoder and the dma channel that is supposed to read data from the card doesn't read everything (1-2 bytes remain unread). This problem occurs when the VS1053 DMA channel triggers an interrupt. If I stop the VS1053 dma channel entirely, the reading from the SD card goes well, but when an interrupt is triggered by the VS DMA channel, the SD read DMA channel leaves 1-2 bytes unread or the SD write channel leaves 1-2 bytes unwritten and this blocks the reading from the card because an interrupt never gets triggered.
I didn't found a way around this issue... If anybody has any suggestions, please leave a comment below.