Re: Purpose of kAudioDevicePropertyChannelNumberNameCFString
Re: Purpose of kAudioDevicePropertyChannelNumberNameCFString
- Subject: Re: Purpose of kAudioDevicePropertyChannelNumberNameCFString
- From: Jeff Moore <email@hidden>
- Date: Mon, 8 Jan 2007 12:08:04 -0800
On Jan 8, 2007, at 10:10 AM, email@hidden wrote:
Hello Chris (and Jeff),
Thanks for your very informative reply.
I tried the same experiment that you've documented below, and indeed
the channel number names are displayed correctly by the ioreg
command. However, I just cannot get to them via the API! I've tried
both the CFString and cstring variants on the property.
By the way, the documentation in AudioHardware.h is very misleading
when it comes to the property descriptions. For example it says
that both kAudioDevicePropertyChannelNumberName and
kAudioDevicePropertyChannelNumberNameCFString are CFStrings!
Feel free to file documentation bugs. I try hard, but I'm much better
at writing the actual code than the documentation =)
Anyway, the same sequence of calls that correctly returns the
Channel Names and Channel Category Names does not correctly return
the Channel Number Name.
Code fragment below (I am using CAAudioHardwareDevice.cpp, by the
way). Sorry about the poor formatting!
CFString ChannelNumberName;
UInt32 theSize = sizeof(CFStringRef);
char *cstrName = new char[100];
Boolean strBool;
if ( theDevice->HasProperty ( chan, kAudioDeviceSectionOutput,
kAudioDevicePropertyChannelNumberNameCFString ) )
{
theDevice->GetPropertyData( chan, kAudioDeviceSectionOutput,
kAudioDevicePropertyChannelNumberNameCFString, theSize,
&ChannelNumberName );
strBool = CFStringGetCString( ChannelNumberName, cstrName, 99,
kCFStringEncodingASCII );
printf( "Channel number name: %s\n", chan, cstrName );
CFRelease( ChannelNumberName );
}
Doesn't seem like there's anything wrong with this code.
Any suggestions?
If you haven't already done so, please file a bug for us to look at.
The last time somebody brought up a problem in this area, we found a
problem in the HAL itself.
Chris Thomas wrote:
These names are statically allocated. For both drivers in question,
you should be able to check them in Terminal by invoking ioreg with
the IOAudioEngine subclass name:
$ ioreg -n com_m_audio_FWEngine2
[...]
+-o com_m_audio_FWEngine2 [...]
| | "IOAudioEngineChannelCategoryNames" = {"InputChannel2"="Input
Analog","OutputChannel1"="Output Analog","OutputChannel4"="Output
Analog","InputChannel3"="Input S/P$
| | "IOAudioEngineChannelNames" = {"InputChannel2"="Input Analog
2","OutputChannel1"="Output Analog 1","OutputChannel4"="Output
Analog 4","InputChannel3"="Input S/PDI$
| | "IOAudioEngineChannelNumberNames" =
{"InputChannel2
"=
"2
","OutputChannel1
"=
"1","OutputChannel4"="4","InputChannel3"="1","OutputChannel2"="2",
[...]
Chris
On Dec 21, 2006, at 3:37 PM, Jeff Moore wrote:
I suppose it could be any of the three bits of code could have a
bug, but my first suspicion would fall on the driver.
On Dec 21, 2006, at 12:29 PM, email@hidden wrote:
Yes, your example shows what I was expecting to see based on the
comments in the include file. However, what I am observing with
my 2 examples is that the Number name is the same as the category
name. So, for example if the Category name is "Analog outputs",
each channel's number name is also "Analog outputs" with no
difference for each channel. It is possible that there is a bug
in my program, the device driver(s) for the (2) devices, or in
the CA API.
Jeff Moore wrote:
The number name is used in conjunction with the category name to
allow you to label a bank of things. For example, here's a bank
of sliders labled with the category and each slider labeled with
the number (pardon my ascii art):
----- Category ----
| | |
| | |
+ + +
| | |
| | |
Number Number Number
On Dec 21, 2006, at 7:27 AM, email@hidden wrote:
In my simple host program I've started to query the Name
properties for my output devices. I have 2 Firewire devices,
Digidesign MBox 2 Pro and M-Audio FireWire Audiophile. On both
of these devices, the ChannelName, ChannelNumberName and
ChannelCategoryName properties are available in the Output
section. However, ChannelNumberName and ChannelCategoryName
seem to be always returning identical strings (to each other),
for every channel. The properties are not available on the
Built-in audio.
I was expecting a string such as "1" or "One" for the
ChannelNumberName on Channel 1. What is the expected
behavior? HALLab does not seem to display these properties.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden