Hi,
Thank you very much David, Steve and Yusuf for your valuable response.
Now I am able to play the MONO file by reading the half as much and
duplicate it into another buffer. But it would be better if there is some
way to play MONO file directly without converting it to Stereo. So what
changes should I do in OSS driver so that it can support MONO file play
option. Is it possible or not? And if yes then can you suggest that how much
time will it take?
Regards,
Dhaval Lakkad
> Content-Type: text/plain; charset=US-ASCII
>
> Dhaval,
>
> I have a feeling we're discussed this before, but here it goes...
>
> Are you using the Codec Engine in your designs?
> If so, then just make a dummy audio codec that uses DMA to duplicate the
> single channel to 2 channels and write out as normal.
>
> If not, then read in half as much and duplicate it to another buffer...
>
> It should be as easy as:
>
> --- SNIP ---
>
> ConvertToStereo(short *pSrcBuffer, short *pDestBuffer, int sampleCount)
> {
> while(sampleCount)
> {
> *pDestBuffer = *pSrcBuffer;
> ++pDestBuffer;
>
> *pDestBuffer = *pSrcBuffer;
> ++pDestBuffer;
>
> ++pSrcBuffer;
> --sampleCount;
> }
> }
>
> if(isWavStereo)
> {
> read(fd,wavBuffer,chunkSize);
> }
> else
> {
> read(fd,tempBuffer,chunkSize/2);
>
> // Samples 2 bytes per sample, so chunkSize/4 samples
> ConvertToStereo(tempBuffer, wavBuffer, chunkSize/4 );
> }
>
> write(soundFd,wavBuffer,chunkSize);
>
> --- SNIP ---
>
> Any other solution would be over-engineering the problem, IMO.
>
> Don't try to make things more complex by altering drivers and such.
> Sure, you'll use an extra couple KB, but it's simple and it works.
>
> Dave
--
_____________________________________________________________________
Disclaimer: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain legally
privileged and confidential information. If the reader of this message
is not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, copying, or other use of
this message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender immediately by
replying to this message and please delete it from your computer. Any
views expressed in this message are those of the individual sender
unless otherwise stated.Company has taken enough precautions to prevent
the spread of viruses. However the company accepts no liability for any
damage caused by any virus transmitted by this email.
__________________________________________________________________________
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source