Altera_Forum
Honored Contributor
13 years agoRead audio from flash- wm8731 codec
Hello,
I am trying to make a system that stores some audio samples (~11secs) to the flash of the DE1 Board and then playback them. Right now, i only would like to play correctly the audio sample I previously stored in my board. I know that there are lots of similar design around, also de1_sound etc provide useful code. The matter is, every examle makes use of the CODEC in slave mode, so with a couple of counters and ONE pll they provide the right clocks to the system. I want to use CODEC in master mode. Codec is configured via NIOS and opencores I2C, while the read/write operation from/to flash should be only "hardware". Using the sources for the flash controller in university program, i made a system where I can erase data from flash and write sequential data to the flash - and with the DE1 control panel I downloaded flash content, opened with an hex editor and I can confirm there were the right data I wrote. Now, the problem is: the data out form the flash is being stored into a dual clock fifo, both flash and write clock to fifo are clocked @50MHZ, while the read signal is locked to the aud_BCLK. A fsm should check if fifo is full in order to control the write operation from flash to fifo and refill the fifo when a bit in rduswd bus bit goes high. Now, sometimes I can get the right sound - only left channel, I am working on a single channel right now - sometimes only "white noise", sometimes there isn't any kind of reading from the flash. I don't know if and where is my error. Any hint would be appreciated.