Rockbox Development > Starting Development and Compiling

one question for bps openning audio

(1/2) > >>

powerpan:
check the code, did not pass the right bits per sample parameters out to hardware, like FLAC, output 28 bit to DSP, how to know the song bps while hardware only supports 8,10,12,14,16,28,20,24,32 bits for samples?

id3 has no bps field and this parameter might be got via codec_main. anybody knows?

bluebrother:
You might want to rework your question. I have no idea what you are talking about.

powerpan:
for example, every codec will have its own sample depth

    /* Generic codec initialisation */
    ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1);

above is from flac.c in codecs dir. and the real SAMPLE_DEPTH is 16 or 24bit instead of the defined value(29bit). and, any sound card needs this to set to work properly, my questions is why Rockbox did not set this value in DSP?

or, I think it must be some place to set the sample depth, just could not find it out.

saratoga:

--- Quote from: powerpan on April 23, 2011, 09:22:45 AM ---for example, every codec will have its own sample depth

    /* Generic codec initialisation */
    ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1);

above is from flac.c in codecs dir. and the real SAMPLE_DEPTH is 16 or 24bit instead of the defined value(29bit).

--- End quote ---

ARM and Coldfire processors are 32 bit, so they also return 32 bit samples.  The DSP_SET_SAMPLE_DEPTH value is the location of the decimal point in the 32 bit fixed point number.  Its used to ensure that the gain is correct during playback, since internally different codecs use different fixed point representations. 


--- Quote from: powerpan on April 23, 2011, 09:22:45 AM ---and, any sound card needs this to set to work properly, my questions is why Rockbox did not set this value in DSP?
--- End quote ---

The DAC doesn't know or care how many bits the source material was, nor how many bits the decoder uses internally.  Internally some codecs like flac do have a header that states the bits used in the source material, but many do not (mp3, wma, vorbis, aac, etc). 

powerpan:
so, it means the program assume to use 32bit output by default. in the CPU specification for audio part, you must set the right bit rates before the DMA and the I2S FIFO could work properly, that's my question, where dose rockbox set this value to hardware? s3c2440 only has 16bit audio output, so, how the programm deal with 16 bit output ? or just right shift 16 bits to fit it?

DAC does not care how many bits but AIC in the CPU cares. don't know if my question is clear or not.

explain in another way, say saving the decoded stream to a wav file, a field is bits per sample, in main.c under libffmpeg dir, there is a simple output wav function, it needs fc->bps to write to a wav file, so, it must be a place to output the bps field to DSP  so that CPU AIC(hardward) could work properly.

Navigation

[0] Message Index

[#] Next page

Go to full version