This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Help needed regarding Audio using SDMA and McBSP

Hello All,

I am working on the BeagleBoard for playing Audio. I am writing my own driver for it. I use SDMA to transfer my audio data to McBSP2 using software triggering. The data is sent in 1k chunks because of the FIFO size limitation. I have registered interrupt on end-of-block-transfer for SDMA. When the end-of-block occurs i trigger the DMA with my next chunk of data. This causes the transmit buffer to overflow and i listen a short tone instead of the song. To avoid the overflow i put a loop on XBUFFSTAT to check if 1K free locations are available; then trigger the DMA. This has solved the problem but the approach is not good as CPU time is being wasted on the wait loop. I have tried using the XRDY and XEMPTYEOF interrupts of McBSP for triggering DMA but they occur too soon. Can anyone kindly suggest me the solution?


Thanks & Regards,
Munam

  • You shouldn't actually trigger another transfer at the end of the frame.  Instead you should just re-enable the transfer.  Better yet, utilize linking which does that for you in hardware.

  • Actually I am doing a re-enable by setting the Enable bit in the CCR register at the end-of-block transfer.

    I am unable to understand why linking is needed in this case. Why we need it when one channel can transfer all my data, why should i link two channels doing data transfer alternatively?

    If linking is used where is it specified that the next channel starts data transfer from the location where the previous channel ended? 

    Thanks

  • You can link to any channel you want including yourself, so it's not necessary to use multiple channels.  Generally you would want to use multiple channels so you can have double-buffered I/O or better.

    Linking simply re-enables the channel.  The DMA will transfer based on what's contained in the registers.

  • Hi, Hafeez,

    did you debugged your code successfully or not, because even i am trying my hands on it, but got success in the mp3 decoder and McBSP buffer only.

    What about reading the mp3 file from DS/MMC card in beagleboard buddy?

    Any ideas and suggestions are welcome, hope we will enjoy.

    Please Let me know any updates.

    With Regards,

    Nitin Mewada