• 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: (HAL) pather format matching, bug or feature?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (HAL) pather format matching, bug or feature?


  • Subject: Re: (HAL) pather format matching, bug or feature?
  • From: Michael Thornburgh <email@hidden>
  • Date: Fri, 18 Jul 2003 13:19:36 -0700

the following code, on a jaguar system with an imic as the default output device, prints

found 2 formats
trying a 0
trying a 0

and on a panther system (my bronze g3 powerbook, pb101, no firewire) with an imic attached and set as the default output device, prints

found 2 formats
trying a 0
match changed 44100.0 to 0.0
trying a 0
match changed 44100.0 to 0.0

similar results are obtained going through the stream interface, for both logical and physical format matches.

---

#include <stdio.h>
#include <stdlib.h>
#include <CoreAudio/CoreAudio.h>

main()
{
AudioDeviceID outputID;
OSStatus theStatus;
UInt32 theSize;
AudioStreamBasicDescription * descriptionArray;
UInt32 numDescriptions;
int x;

theSize = sizeof(AudioDeviceID);
theStatus = AudioHardwareGetProperty ( kAudioHardwarePropertyDefaultOutputDevice, &theSize, &outputID );
if ( noErr != theStatus )
return -1;

theStatus = AudioDeviceGetPropertyInfo ( outputID, 0, 0, kAudioDevicePropertyStreamFormats, &theSize, NULL );
if ( noErr != theStatus )
return -1;
numDescriptions = theSize / sizeof(AudioStreamBasicDescription);
descriptionArray = malloc ( theSize );
theStatus = AudioDeviceGetProperty ( outputID, 0, 0, kAudioDevicePropertyStreamFormats, &theSize, descriptionArray );
if ( noErr != theStatus )
return -1;

printf ( "found %u formats\n", numDescriptions );
for ( x = 0; x < numDescriptions; x++ )
{
if ( 0.0 == descriptionArray[x].mSampleRate )
{
printf ( "trying a 0\n" );
descriptionArray[x].mSampleRate = 44100.0;
theSize = sizeof(AudioStreamBasicDescription);
theStatus = AudioDeviceGetProperty ( outputID, 0, 0, kAudioDevicePropertyStreamFormatMatch, &theSize, &descriptionArray[x] );
if ( noErr == theStatus )
{
if ( 0.0 == descriptionArray[x].mSampleRate )
{
printf ( "match changed 44100.0 to 0.0\n" );
}
}
}
}
return 0;
}

---

-mike


On Friday, July 18, 2003, at 11:32 AM, Jeff Moore wrote:

Can you provid an example that illustrates the problem? Sounds like a bug.

On Thursday, July 17, 2003, at 8:25 PM, Michael Thornburgh wrote:

so on the panther preview, i've noticed that the kAudioDevicePropertyStreamFormatMatch and kAudioStreamPropertyPhysicalFormatMatch properties, on a USB audio device (griffin imic) that shows "0 Hz" on the output side (indicating a range of sample rates are available), will set a non-zero (and supported) sample rate to zero in the stream format and then return with noErr. this behavior is different than in jaguar, where the sample rate would be left unchanged.

is this behavior (zeroing the sample rate) on a kAudioDevicePropertyStreamFormatMatch or kAudioStreamPropertyPhysicalFormatMatch intended?

-mike
_______________________________________________
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.



--

Jeff Moore
Core Audio
Apple
_______________________________________________
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.

References: 
 >Re: (HAL) pather format matching, bug or feature? (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Hardware control surfaces (was Re: Private Parameters)
  • Next by Date: Re: Sequencing the setting of AUPresets
  • Previous by thread: Re: (HAL) pather format matching, bug or feature?
  • Next by thread: Re: (HAL) pather format matching, bug or feature?
  • Index(es):
    • Date
    • Thread