rlm@0: #LyX 1.6.4 created this file. For more info see http://www.lyx.org/ rlm@0: \lyxformat 345 rlm@0: \begin_document rlm@0: \begin_header rlm@0: \textclass article rlm@0: \use_default_options true rlm@0: \language english rlm@0: \inputencoding auto rlm@0: \font_roman default rlm@0: \font_sans default rlm@0: \font_typewriter default rlm@0: \font_default_family default rlm@0: \font_sc false rlm@0: \font_osf false rlm@0: \font_sf_scale 100 rlm@0: \font_tt_scale 100 rlm@0: rlm@0: \graphics default rlm@0: \paperfontsize default rlm@0: \use_hyperref false rlm@0: \papersize default rlm@0: \use_geometry false rlm@0: \use_amsmath 1 rlm@0: \use_esint 1 rlm@0: \cite_engine basic rlm@0: \use_bibtopic false rlm@0: \paperorientation portrait rlm@0: \secnumdepth 3 rlm@0: \tocdepth 3 rlm@0: \paragraph_separation indent rlm@0: \defskip medskip rlm@0: \quotes_language english rlm@0: \papercolumns 1 rlm@0: \papersides 1 rlm@0: \paperpagestyle default rlm@0: \tracking_changes false rlm@0: \output_changes false rlm@0: \author "" rlm@0: \end_header rlm@0: rlm@0: \begin_body rlm@0: rlm@0: \begin_layout Title rlm@0: Multi-Voice Audio Playback rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Author rlm@0: Laurel Pardue, Robert McIntyre rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Section* rlm@0: Micro-Architecture rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Subsection* rlm@0: A quick summary of our system rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Standard rlm@0: The audio data ( rlm@0: \begin_inset Quotes eld rlm@0: \end_inset rlm@0: rlm@0: samples rlm@0: \begin_inset Quotes erd rlm@0: \end_inset rlm@0: rlm@0: ) start in the memory, but are soon pulled into action by the DMA (direct rlm@0: memory access). rlm@0: The DMA sends the samples to a chain of 0 or more rlm@0: \emph on rlm@0: soft-cores rlm@0: \emph default rlm@0: , where they are transformed according to the soft-cores' algorithms. rlm@0: After running the gauntlet of soft-cores, the samples flow first to a buffering rlm@0: FIFO, and finally to a rlm@0: \emph on rlm@0: mixer rlm@0: \emph default rlm@0: , which sends the samples off to be played by speakers of stored in a file. rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Subsection* rlm@0: A more detailed look a our system rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Standard rlm@0: Our audio pipeline starts its life with whatever music we want to play already rlm@0: in memory. rlm@0: The music has multiple tracks, or rlm@0: \begin_inset Quotes eld rlm@0: \end_inset rlm@0: rlm@0: voices, rlm@0: \begin_inset Quotes erd rlm@0: \end_inset rlm@0: rlm@0: which we arrange on the memory in contiguous sequences. rlm@0: Therefore, each voice starts at its own start-address, and continues on rlm@0: for as long as it needs. rlm@0: We cap each voice with an end-of-file marker. rlm@0: We make every voice the same length to simplify timing issues, even though rlm@0: that might mean that there is a lot of wasted space in the form of dead rlm@0: areas with no sound. rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Standard rlm@0: When the processing starts, the DMA reads in each voice and sends the audio rlm@0: data ( rlm@0: \begin_inset Quotes eld rlm@0: \end_inset rlm@0: rlm@0: samples rlm@0: \begin_inset Quotes erd rlm@0: \end_inset rlm@0: rlm@0: ) off to a chain of soft-cores. rlm@0: The DMA knows to which chain the samples should be forwarded by looking rlm@0: up the samples' voice in a hash table read at startup. rlm@0: Once the samples enter the soft-core chain, the first soft-core in line rlm@0: takes the samples and performs some sort of audio operation, producing rlm@0: modified audio samples. rlm@0: These samples feed into the next soft-core which performs a different algorithm. rlm@0: As condition for functional correctness, we require the algorithm that rlm@0: each soft-core contains to be able to produce audio samples at the desired rlm@0: 44khz rate, but we allow an arbitrary setup time for the soft-core to get rlm@0: ready. rlm@0: That way, a pipelined processor can take its time and fill up its pipeline rlm@0: completely with no worries. rlm@0: Once the soft-core starts producing samples, it must produce them at a rlm@0: rate of at least 44khz forever. rlm@0: If every soft-core in the chain obeys this timing condition, then the whole rlm@0: chain will as well, so the entire chain of soft-cores can be treated as rlm@0: a single big soft-core for timing purposes. rlm@0: Our soft-cores are just Lab 5 processors preloaded with specific audio rlm@0: processing algorithms. rlm@0: \end_layout rlm@0: rlm@0: \begin_layout Standard rlm@0: Eventually, the samples make their way to the end of the chain of soft-cores. rlm@0: Every chain of soft-cores ends in a FIFO. rlm@0: For this project, we will have 12 separate voices. rlm@0: Therefore, there will be 12 soft-core chains, each with a FIFO at its end, rlm@0: one for each voice. rlm@0: Each of the 12 FIFOs leads to the mixer, which only begins operation once rlm@0: all 12 FIFOs are full. rlm@0: Because of the timing constraints we impose on our soft-cores, once every rlm@0: FIFO has at least one sample, all 12 will forever more be able to supply rlm@0: samples at 44khz. rlm@0: The mixer therefore waits until all 12 FIFOs have elements and then reads rlm@0: samples from all FIFOS at a rate of 44khz. rlm@0: The mixer combines the samples through simple addition and scaling, creating rlm@0: a single stream of sample data, which is sent back from the FPGA to the rlm@0: host computer where we play the stream and/or save it to a file. rlm@0: The mixer ensures that it outputs samples at a rate of 44khz by running rlm@0: everything through its own internal buffer FIFO clocked at 44khz. rlm@0: \end_layout rlm@0: rlm@0: \end_body rlm@0: \end_document