• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: problem writing OS X audio driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem writing OS X audio driver


  • Subject: Re: problem writing OS X audio driver
  • From: "Stephan" <email@hidden>
  • Date: Thu, 20 Jun 2002 16:38:06 +0200
  • Organization: MIDIMAN

Hi Laurent,

I believe your endianess is wrong. PCI bus for example is little endian
while PowerPC runs big endian natively.

CFSwapInt32() will do the conversion from 0x00FFC935 to 35C9FF00.

Stephan


----- Original Message -----
From: "Laurent Humbert" <email@hidden>
To: <email@hidden>
Sent: Thursday, June 20, 2002 4:18 PM
Subject: problem writing OS X audio driver


> Hi everybody,
>
> I got close but definitely no cigar with the audio driver I am working on.
>
> For the moment I kept things very simple with 1 single input
stream/channel.
>
> Basically, everything works great, except the sound quality is really
> bad. The music is recognizable, but it sounds extremely saturated.
> The sound input level as displayed by audio recording software is
> normal though.
>
> I tried different input sources (iPod, Guitar, Mic...) but they all
> sound real bad.
>
> MyAudioEngine::convertInputSamples method looks like this:
>
> IOReturn MyAudioEngine::convertInputSamples( const void *sampleBuf,
> void *destBuf,
> UInt32
firstSampleFrame,
> UInt32
numSampleFrames,
> const
> IOAudioStreamFormat *streamFormat,
> IOAudioStream
*audioStream)
> {
> UInt32 numSamplesLeft;
> float *floatDestBuf;
> SInt32 *inputBuf;
>
> floatDestBuf = (float *) destBuf;
> inputBuf = &(((SInt32 *)sampleBuf)[firstSampleFrame *
> streamFormat->fNumChannels]);
> numSamplesLeft = numSampleFrames * streamFormat->fNumChannels;
>
> while (numSamplesLeft > 0)
> {
> // inputBuf points to a signed 24bit sample value coded on 32
> bits, like 0x00FFC935
>
> *floatDestBuf = (*inputBuf << 8) / 2147483648.0;
>
> // I have also tried converting the value to a SInt32 whilst
> preserving the signed-ess
> // and divide by 8388608.0 but the result is the same
>
> ++inputBuf;
> ++floatDestBuf;
> --numSamplesLeft;
> }
>
> return kIOReturnSuccess;
> }
>
> Has anybody got an idea as to what might be going wrong ? I've been
> trying to fix this one for days and I've run out of ideas.
>
> Thanks
>
> L
> _______________________________________________
> coreaudio-api mailing list | email@hidden
> Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: problem writing OS X audio driver
      • From: Laurent Humbert <email@hidden>
References: 
 >problem writing OS X audio driver (From: Laurent Humbert <email@hidden>)

  • Prev by Date: problem writing OS X audio driver
  • Next by Date: CLI producer code cycle starvation
  • Previous by thread: problem writing OS X audio driver
  • Next by thread: Re: problem writing OS X audio driver
  • Index(es):
    • Date
    • Thread