STM32F4xx Audio Player without CS43L22 codec

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
alex0
Posts: 5
Joined: Sat Nov 16, 2013 9:18 pm

STM32F4xx Audio Player without CS43L22 codec

Post by alex0 »

Hello! :!:

I have a board with STM32F4xx and wanted to play stereo audio, starting with wav, for its simplicity.

I have seen many examples, but all are based on STM32F4-DISCOVERY board using CS43L22 codec. :oops:

I would like to use the two internal 12-bit DACs STM32F4xx.

For example play a wav file 22050 Hz stereo 8bit.
 
I am using the following drivers: https://github.com/mobyfab/ChibiOS/tree/dac-new

Has anyone worked with playing audio stereo STM32F4xx internal DACs? :?:

Thank you!
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32F4xx Audio Player without CS43L22 codec

Post by mobyfab »

Hey,

I will try to make a demo.
This should be possible using the DMA transfer callbacks.

I'll post a link when this is done.
alex0
Posts: 5
Joined: Sat Nov 16, 2013 9:18 pm

Re: STM32F4xx Audio Player without CS43L22 codec

Post by alex0 »

Great! :D

I will try to do the same with the new drivers you gave me: https://github.com/mobyfab/ChibiOS/tree/dac-3.0

Thank you!
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: STM32F4xx Audio Player without CS43L22 codec

Post by mobyfab »

alex0
Posts: 5
Joined: Sat Nov 16, 2013 9:18 pm

Re: STM32F4xx Audio Player without CS43L22 codec

Post by alex0 »

Hello!

Does anyone know how to read a file. Wav and send the data to the DAC?

I tried opening the file with f_open () and offering the units beginning to read from the file data sector.
   / *
   * Jump to industry data
   * /
   res = f_lseek (& file, 500);

Could it be done using F_READ () and sending the data to the DAC with dacStartConversion (& DACD1, & dacconvgrp, fbuff, BUFF_SIZE) function?

I'm using the repository dac-new.

Thank you!
User avatar
TexZK
Posts: 57
Joined: Sat Sep 22, 2012 7:06 pm

Re: STM32F4xx Audio Player without CS43L22 codec

Post by TexZK »

That is ok only for PCM formats. I think using a WAV File I/O library would be much better in case you're reading that from an SD card, and you might get more performant codecs for free.
Post Reply