Larry Osterman's WebLog

Confessions of an Old Fogey
Blog - Title

Little Lost APIs

Little Lost APIs

Rate This
  • Comments 32
When you have an API set as large as the Win32 API set, sometimes APIs get "lost".  Either by forgetfulness, or by the evolution of the hardware platform.

We've got one such set of APIs here in multimedia-land, they're the "aux" APIs.

The "aux" APIs (auxGetNumDevs, auxGetDevCaps, auxGetVolume, auxSetVolume, and auxOutMessage) are intended to control the volume of the "aux" port on your audio adapter.

It's a measure of how little used these are that when I asked around my group what the aux APIs did, the general consensus was "I don't know" (this isn't exactly true, but it's close).  We certainly don't know of any applications that actually uses these APIs.

And that's not really surprising since the AUX APIs are used to control the volume of either the AUX input jack on your sound card or the output volume from a CDROM drive (if connected via the analog cable).

What's that you say? Your sound card doesn't have an "AUX" jack?  That's not surprising, I'm not sure that ANY sound card has been manufactured in the past 10 years with an AUX input jack (they typically have a "LINE-IN" jack and a "MIC" jack).  And for at least the past 5 years, hardware manufacturers haven't been connecting the analog CD cable to the sound card (it enables them to save on manufacturing costs).

Since almost every PC system shipped in the past many years (at least 5) has used digital audio extraction to retrieve the CD audio, the analog cable's simply not needed on most systems (there are some exceptions such as laptop machines, which use the analog connector to save battery life when playing back CD audio).  And even if a sound card were to add an AUX input, the "mixer" APIs provide a more flexable mechanism for managing those APIs anyway.

So with the "aux" APIs, you have a set of APIs that were designed to support a series of technologies that are at this point essentially obsolete.  And even if your hardware used them, there's an alternate, more reliable set of APIs that provide the same functionality - the mixer APIs.  In fact, if you launch sndvol32.exe (the volume control applet), you can see a bunch of sliders to the right of the volume control - they're labeled things like "wave", "sw synth", "Line in", etc.  If your audio card has an "AUX" line, then you'll see an "Aux" volume control - that's the same control that the auxSetVolume and auxGetVolume API controls.  Similarly, there's likely to be a "CD Player" volume control - that's the volume for the CD-ROM control (and it works for both digital and analog CD audio).  So all the "aux" API functionality is available from the "mixer" APIs, but the mixer version works in more situations.

But even so, the "aux" APIs still exist in the system in the event that someone might still be calling them...  Even if there's no hardware on the system which would be controlled by these APIs, they still exist.

These APIs are one of the few examples of APIs where it's actually possible that we might be able to end-of-life the APIs - they'll never be removed from the system, but a time might come in the future where the APIs simply stop working (auxGetNumDevs will return 0 in that case indicating that there are no AUX devices on the system).

Edit: Clarified mixer and aux API relationship a bit to explain how older systems would continue to work.

  • Hm, most sound cards I've seen recently do have aux pinheads on the card (or on the mobo), and I generally try to wire them. My current mobo even has two, one wired to a CD-ROM drive, the other to a DVD-ROM. (I do not, however, use them.)

    Sadly, I haven't seen a cable with a male 1/8th inch on one end, and a female 4-pin audio connector on the other recently; such a thing would be useful for wiring my TV card.
  • James,
    I'd check to be sure - are you SURE it's an AUX connector? As I said, I'm not aware of any current audio cards with an AUX connector. Certainly the SB Live in my test machine and the AC97 in my dev machine and test machine don't have them, neither do most (all?) of the HDAUDIO machine's I've got access to.
  • Hey, you can't obsolete the Aux API's! (Just kidding).

    I actually did write a program a long time ago that used this API (CD Control Centre, using these calls to do a fade-in/fade-out of tracks, and provide a software volume control). I know of 1 person still using it on a Win98 platform, but haven't looked at it in a LONG time (it was written in VB2.0 [yes, 16-bit]).
  • EOLing APIs is tricky bussiness. Once you do, you'll find that some media player doesn't work, and that Media Player is thr default in PCs by the largest PC OEM in China or something, and you once again get charged of using the MS monopoly to push Media Player, etc etc...
  • Jonathan,
    You're right. The reason that this particular set of APIs might be ok is simply because they don't work on the vast majority of machines today. So any application that depends on them working isn't working on the vast majority of machines today.

    If it was anything different, we'd not be able to do this. It's as if we had an API to access 5 1/4" floppy drives - they just don't exist nowadays, so it'd be safe to make the API stop working at some point. This isn't the case for the vast majority of Windows APIs because those APIs aren't tied to a particular hardware implementation.
  • You've just scared me by making me work out how old my main workstation is -- I think it turns 7 in June. I know the CD-ROM is hooked up with an analogue cable, to one of three 4-pin sockets on the card (CD-ROM, PHONE and AUX if memory serves). My old SoundBlaster 16 (clone?) had an AUX connector which I broke out to a pair of phono/RCA jacks on a blanking plate -- came in very useful at times. Shame they've fallen out of use, but I suppose if I really needed one I could pick up a decent external soundcard quite cheaply. How times change...
  • baljemmett, don't worry :)

    I forgot to mention that the mixer APIs manipulate the CDROM volume more efficiently - and they work for both analog and digital versions.

    I hadn't realized that the SB/16 had an aux jack. I wonder if it functions as aux or as line in? If you look at the mixer lines (run sndvol32.exe) do you see one labeled AUX?

    If you do, that's the exact same control that's controlled by the auxSetVolume API - there are two separate unrelated APIs for that particular control.
  • I've got an Asus A7N8X-X (see URL for manual as PDF) with onboard Realtek ALC650 (AC'97) sound. It has a white AUX audio socket just like the analog CD audio connector. It's listed as Aux in volume control, although I'm not actually using it for anything.

    What was the point of creating these APIs in the first place? A shortcut version of the mixer* functions for AUX?

    It looks like mixerOpen depends on the output of auxGetNumDevs for aux device numbering, so EOLing it would break part of mixerOpen. Er, sndvol32.exe still uses auxGetDevCaps and auxGetNumDevs, or at least links to them.
  • Fascinating. I'm not sure why the aux APIs exist, and neither does anyone currently working on audio (I asked the same question).

    And mixerOpen doesn't depend on this (unless you specify MIXER_OBJECTF_AUX for the open).

    I just checked the code in sndvol - you're right, it turns out that sndvol32.exe was written to operate in two separate modes - one where it used the mixer APIs the other where it didn't (there was at one point apparently UI to switch between the two). The non mixer code path is dead code however - it can't be enabled.
  • Larry,

    The odd thing is, I'm not sure if that particular SB-16 was actually a real card or some sort of clone -- it had Creative markings on the chips, including the optional ASP, but the board didn't bear any SoundBlaster markings and the manual made no reference to the company. It might have been OEM, but it always puzzled me.

    The genuine SB-16 I have (or had -- there's a 3Com EtherLink II on my desk where I thought I had the soundcard!) somewhere around here didn't have an AUX connector; if I get a moment in the office tomorrow I'll fire up the machine that hosted the other card and find out what inputs it offered.
  • I have a sound blaster 512 pci that has 3 (cd/aux/tv) connectors on the board. My recently purchased Asus mb has CD/Aux on board too.
  • Larry I'm a big fan of your blog, but I dont post too often. I almost always learn something new or old when I your posts.
    But there is something very harsh on my eyes with your new page style. Can we have a slightly darker background or a larger for font?
  • Larry I'm a big fan of your blog, but I dont post too often. I almost always learn something new or old when I your posts.
    But there is something very harsh on my eyes with your new page style. Can we have a slightly darker background or a larger for font?
  • Larry I'm a big fan of your blog, but I dont post too often. I almost always learn something new or old when I your posts.
    But there is something very harsh on my eyes with your new page style. Can we have a slightly darker background or a larger for font?
  • Is this better? I've bumped the font size a bit, and the background should be a smidge darker.

    I think I may need to learn CSS to tweak this the way I like it - I like the style overall, but it lacks contrast to my eyes.
Page 1 of 3 (32 items) 123