Re: Enable system volume when driver doesn't
Re: Enable system volume when driver doesn't
- Subject: Re: Enable system volume when driver doesn't
- From: Jeff Moore <email@hidden>
- Date: Mon, 17 Mar 2008 15:58:01 -0700
I think you've pretty much covered the ways to implement this sort of
feature. You can do a user-land driver, a kernel driver, or you can
play with the dyld interposing mechanisms. I can't really think of any
other way to do what you are asking about. IMHO even if we had perfect
documentation on all of this stuff, you would still talking about a
very difficult and time consuming task. That's just the nature of the
beast in this case.
At least you have the sample code and this list to help you. The
HPBase code in our SDK is what I use to implement the HAL's internals,
so it is a wealth of info about how things work all by itself.
Good luck.
On Mar 17, 2008, at 3:45 PM, Mikael Hakman wrote:
It has drifted away from OP indeed. The question was how to
implement OS X master volume control for audio interfaces that do
not enable this out-of-the-box. One way, which I proposed myself, is
to implement a "virtual device driver" that will use a real device
driver and expose a volume control to OS X. As pointed out by Jeff,
this could be done in application space by implementing HAL user-
land driver plug-in. Also as pointed out by Jeff and verified by me
this is not a trivial task partly due to incomplete documentation
currently available. Another way, which according to Jeff is even
more complex, would be to do it in kernel space.
Then, instead of creative communication on this topic providing
ideas for smarter and simpler implementations of such a volume
control, this topic drifted into mastering discussion of why this
shouldn't be done, in particular not in mastering studio environments.
My target isn't mastering or recording studio environment, I don't
use DAW, and my question is related to standard OS X applications. I
stated this very clearly in OP. Furthermore, I'm not here to read
opinions such as "if you don't use DAW, if you don't work in
mastering studio then you are not a professional" or such as "if you
use Front Row then you are not professional". Notwithstanding
unprofessional attitude shown by such statements, there are orders
of magnitude more professional audio users working with or employing
this technology in other areas.
C'mon guys, show me how to do it in an easy and simple way (if you
can) instead of promising me the heaven but only if I don't sin.
/Mikael
On March 15, 2008 8:00, Brian Willoughby wrote:
This topic has drifted away from CoreAudio, but I still think it is
important to examine real-world uses for CoreAudio: what is
appropriate, and what is not appropriate.
It's great that Apple provides cool features like Front Row, and
I'm sure they want to make this work as widely as possible. But
do not confuse this with professional quality. If you are
concerned about the negligible shortcomings of D/A and A/D chains,
then you need to also be concerned about the shortcomings of
digital volume. Just because you hear about all-digital studios
does not mean that they're using digital volume the same way you
want to, and if they are, they're suffering from the very
shortcoming that engineers here are describing. I do not agree
with you that Apple is missing out on something here. Read on for
specific responses...
On Mar 12, 2008, at 10:18, Mikael Hakman wrote:
On March 12, 2008 1:37 AM, Jeff Moore wrote:
On Mar 11, 2008, at 4:58 PM, Mikael Hakman wrote:
Yeah, but digital volume control will do things like magnify
the noise floor and other signal destroying effects (at
least form a mastering point of view). This is especially
important for input signals. So, no I wouldn't agree with
you that the digital computer business means we need a
digital volume control. It just isn't apropos for lots of
apps.
First of all, in a DAW (remember what D stands for?) you have to
use digital level adjustment. There is no other way.
But you forget that the processing done by the DAW is pre-
mastering. After a piece of music has been mastered, you do NOT
want to alter it's volume digitally. Unless you do not care about
quality at all. If you do alter the volume of a finished audio
piece, it should only be done in the analog realm. As an example
of the ultimate quality experience, the best movies are mastered
in THX, and the playback system is calibrated to a reference
playback volume. In other words, you should not alter the volume
at all for those entertainment setups.
Second, as I described previously, the only alternative in my
project (and in all digital-through paths) is inserting a D/A-
volume control-A/D sub chain in the middle. However good that sub
chain may be, it won't be better than the naked wire that would
be used otherwise.
This is only true if you're using powered monitors with digital
inputs, which are not as ideal as having separate power amps with
a good analog preamp. What you really need is a remote-
controlled analog volume on a surround preamp, then stay analog
from there to the amps and speakers. No need for digital volume
anywhere, at least not on mastered audio. If you build the system
wrong from the start, then you might convince yourself that you
need a fix where one is not truly necessary.
Are you trying to build a system that is both a studio for
professionals to create audio productions as well as a listening
room for non-professionals to enjoy finished media presentations?
If so, I think you have severely conflicted requirements.
Yes, by digitally attenuating the volume you decrease dynamic
range and increase quantization distortion. But let's analyze
what happens if you use that analogue sub chain as compared to
digital. Say that you want to attenuate 8 bits (-48 dB). Using 24
bits audio you have left 144 - 48 = 96 dB dynamic range after
digital attenuation. If you use analogue volume control you will
take your 144 dB (= FS), attenuate it by 256 and then you will do
the A/D on the attenuated signal which will give you the same 96
dB range because the analogue signal input to A/D is now 256
times lower than FS. In both cases you lose the same due to
attenuation, but in the analogue case you also loose due to D/A
and A/D conversion, and maybe also due to analogue imperfections
(no analogue circuit is perfectly linear). Therefore I cannot
agree on that analogue religion.
You've only proven that you should not be doing a D/A and A/D
chain. With a proper audiophile surround system, the volume
attenuation will only happen at the master analog control, with no
more digital conversions subsequent to that. In the proper case,
existing quantization noise is lowered with the desired content,
thus maintaining the signal-to-noise ratio.
I've spent time in a lot of studios over the years. Many of
which have examples of the gear you list. I have never heard any
of the engineers wish for a digital volume control. They just
reach over to their console and turn down the monitor volumes
(in the, yes, analog domain). In fact, that's exactly what I do
in my own studio.
Nonsense! Modern recoding and broadcasting studios are digital
through including consoles, mixers, everything. Smaller studios
are still partly analogue.
The examples you give are either people who are working with
unmastered audio, and/or people who have analog master volume
controls. Every studio ends with analog, even in an all-digital
studio, unless nobody is listening. Modern studios are not
designed for non-professionals to operate, so your requirement
that this be easy is contradictory.
There is a trend towards powered monitors with digital inputs, but
I do not believe this is audiophile quality in the best
situations. Just because it is all digital does not mean it is
better. Any studio with digital monitors is going to be inferior
in quality unless they have analog attenuators in the speakers
which are controlled from a central location (and I believe there
are some designs which do this, and you should investigate them -
see Meridian).
From your answer I understand that I didn't manage to explain
why do we need functional OS X master volume control. It is
_not_ the slider control, nobody here cares about that. It is
the remote IR control that the system volume control reacts to.
It's all the same thing really.
It's not the same thing. Run Front Row, then press + on remote
while on menu - it moves you to next item on the menu. Start
playing a track. Press + now - it increases the volume if you are
using an audio interface that enables OS X master volume control.
There are analog surround preamps with remote volume control.
This seems like what you need.
One other thing: what you are proposing _will_ bleed
performance from the system. You are talking about adding non-
trivial signal processing which means adding more buffers (and
therefore memory pressure) to the system in addition to the
extra CPU time you'll spend doing the work. For example, doing
fully dezippered software volume for a 32x32 channel interface
is some serious math. It will have the net effect of reducing
the overall track count that a DAW app can achieve which is
probably the last thing a studio rat is going to want to have
happen. And the extra memory usage just takes away from what
the DAW app can use for it's own purposes.
First of all I don't need 32x32 channels. I need 8 channels out.
I'm not saying that this master control should be always on or
even on by default when using pro-gear. But it should be possible
to turn it on at user's or programmer's discretion. Then I think
that the problems that these vendors have, and to a certain
degree even your company, is that you all se DAW as the only
interesting audio application/market. While DAW is very
interesting for a number of reasons, including technological and
musical, it is only a very small part of possible audio
application uses. Turn your attention to monitoring (in general
sense), playback, broadcast, and entertainment and you discover a
huge market, at least as compared to DAW.
You're in a strange middle ground. You want professional
performance without a professional operator, and that's just not
very likely. There is a wide gap between production studios and
consumers, and there is a wide gap between computers and home
theater surround. You may have to wait quite a while before these
meet up.
There are very good engineering reasons why the better audio
interfaces do not have master volume controls. What I find
lacking are that the home theater surround processors do not have
better support for computer interfacing. Given your requirements,
you'd be better off with home theater gear, but you'll have to
wait with the rest of us while the industry catches up to the
technology and makes it easy to hook up and use.
--
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