Brian,

It is probably the default volume setting on the input. Since the OS requires the following info for USB Audio Class volume:

a) Minimum volume

b) Maximum volume

c) Step size of volume

d) Current or Default setting

In all cases that I have seen on IOS and macOS the HOST will ask for these variables and then set the either the Current Setting or the last setting to the device.

I would bet in this instance the Current Setting or Default Setting is probably -29dB.

Jean-Charles, you can test this quickly on a macOS computer by plugging that device in and then using the Audio Midi Setup application found in the Utilities folder and see what the settings are.

Thanks,

Gordon

On 3/18/19 3:00 PM, [email protected] wrote:
Message: 1
Date: Sun, 17 Mar 2019 14:22:45 -0700
From: Brian Willoughby<[email protected]>
To: Jean-Charles Rousset<[email protected]>
Cc: Andrew Smith<[email protected]>,[email protected]
Subject: Re: iPad Pro USB audio
Message-ID:<[email protected]>
Content-Type: text/plain; charset="utf-8"

Rather than divide by 28.18, you can multiply by 0.03548, which is (1 / 28.18). 
This can be faster, depending upon the compiler.

What you’re doing is dropping the signal level by 29 dB. This tells me there is 
a gain issue somewhere that you’re not aware of.

In my experience, input devices may or may not have a volume control associated 
with the device in CoreAudio. Of those devices that have a volume control, the 
range can vary wildly. Some hardware devices can only attenuate - they cannot 
boost the gain - so their volume ranges from negative gain to 0 dB, but no 
higher. Other hardware devices can handle significant gain, so their volume 
control ranges from negative gain to positive gain, and sometimes that is as 
high as +15 dB or +30 dB. On my MacBook Pro, the built-in microphone volume 
ranges from -12 dB to +12 dB.

My point is that you can’t set the input device volume to maximum for all 
devices. The +29 dB gain that you’re seeing is probably due to the volume 
setting for the input device. This is exposed to the user, so there might not 
be an Apple-approved way to guarantee that this isn’t set to something crazy. 
If the control maxes out at 0 dB, then you want to turn it all the way up. If 
the control goes beyond 0 dB, then it’s a really bad idea to set the control to 
the top of the range.

I’ve never written code to access the hardware input device volume control, but 
everything else in CoreAudio provides metadata for the units and range of a 
control. Thus, you should be able to see that your input device is set to +29 
dB instead of 0 dB, where it wouldn’t clip.

By the way, if you’re using an XMOS chip, then you might want to check whether 
the firmware properly implements USB Audio Device Descriptors as appropriate 
for your hardware. A mistake in the USB firmware could cause significant 
problems with CoreAudio.

Brian Willoughby

--
J. Gordon Rankin
Owner and Chief Scientist
====== Wavelength Audio, ltd ======

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to