Igor Kovalenko <Igor.Kovalenko@motorola.com> wrote:
Some related questions:
- What is ‘Stereo Mix’ input (available for ac97-based mixers)? It
appears to pass LineIn, but not Mic. I was hoping it is same thing as
‘What You Hear’…
It is, the “Stereo Mix” is all the sound at the output
connector (speakers) routed back to the ADC. Or as the AC’97
spec calls it “what you hear is what you get” (WYHIWYG)
Then why i can’t get Mic input when ‘Stereo Mix’ is selected? As I said,
Line-In works that way, but not Mic… Is that a bug or do I miss
I works fine here! Everything I can hear out the speakers is
recorded using the “Stereo Mix” input selection. You have to
unmute all the signals including mic (this can cause
feedback if the gain to too high). Rememeber Stereo mix will
ONLY record what you are hearing!
- What is meaning of subchannel mixers on capture channels (if any)?
The phrecord does no have input gain/mute controls, when a ‘volume/mute’
functions would be called?
Exactly the same as for a playback channel. If a subchannel
group is availiable it would affect only that stream. So if
we have a card that allows 2 simultaneous capture channels
with subchannel mixers, one stream’s volume can be adjusted
without affecting the other.
Adjusted using what? There’s no input gain control in phrecord. So how
does one ‘adjust’ them? Is that just phrecord limitation?
Just because phrecord doesn’t show a gain control doesn’t
mean that one does not exist. The API can return the mixer
group name that best controls the capture stream. In most
cards this group would use the mute and gain controls in the
AC97, but in high end cards the group could be made up of
Subchannel mixers are just mixer controls that exclusively
control their subchannel. As an example when using phplay to
play a wave (on audiopci & ac’97 codec) it’s volume slider
could adjust the "master’, “pcm” or subchannel group. But
using any group other then the subchannel group leads to
side effects when two playbacks are running at once.
Consider a system where a cd is playing and two phplay are
If phplay’s slider was connect to the master group,
increasing it would cause the signals from the cd and both
phplays to get louder.
If phplay’s slider was connect to the pcm group, increasing
it would cause both phplays to get louder but not the cd.
If phplay’s slider was connect to the subchannel group,
increasing it only make that signal get louder and not the
- I’d appreciate better explanation of SRC_test/SRC_set functions. Docs
say driver must call them to make use of them, but then why are they
part of mixer parameters? When they are needed? Are they related to
S/PDIF support? Docs mention that DDK does address S/PDIF support but no
word beyond that statement…
The AC’97 2.0 Variable Sample Rate Extension allows the
codec to do Sample Rate Conversion (SRC) providded the codec and
the controller chip support the spec.
The SRC_test function tests the codec to see if it will
support Variable Sample Rates and adjusts the pcm
capabilities structure accordingly.
The SRC_set function sets the rate converstion, and is
called when the channel is aquired.
How that is ‘variable’? The rate conversion is set when channel is
acquired in any case, isn’t it?
The original AC’97 spec said the codec supported a data of
48Khz only. AC’97 2.0 added the “Variable Sample Rate
Extension” that allows other rates. Why they used the word
‘variable’ I don’t know ask Intel. And yes the rate is set
during the aquire and is not changed.
The question about S/PDIF remains unanswered. It appears new AC97 2.1
spec also addresses S/PDIF somehow…
The AC’97 Rev 2.2 starts to address SPDIF but also recomends
using USB be used instead. Supporting SPDIF seems to be very
driver/hw specific and as such the DDK does not address it
directly nor does the AC97 dll have functionality for it.
But the driver has access to all codec registers and can
therefore support whatever it likes. Supporting PCM over
SPDIF is fairly straight forward, while supporting AC3 over
SPDIF is harder.
Two other things:
- The mute_set() function appears to be always called with ‘mute’
parameter being 0 (no matter if I am ‘muting’ or ‘unmuting’ a
subchannel. Even weirder, the ‘mute’ button in phplay appear to work
regardless of that and actually regardless of what mute_set() is doing
Phplay does some stange things, it uses a technique where to
mute a signal it moves it’s gain to 0 and never uses the hw
mute. This may explain what your seeing. When writing an
application we recommend using the hardware mute instead,
- The DLL used to play WAV files implies that driver supports
subchannel mixers. If driver does not create them using hardware and
does not do ‘software emulation’ either, WAV playback using shipped QNX
utils fails with ‘unable to init audio device’, but MP3 playback works.
The API returns the “BEST” mixer group for the stream , that
may or may not be a subchannel group depending on what the
driver supports. The the case of Audiopci+AC’97 that group
would be the 'PCM" group of the mixer because no subchannel