Little Lost APIs


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.


Comments (32)

  1. 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.

  2. LarryOsterman says:

    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.

  3. Harakan says:

    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]).

  4. Jonathan says:

    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…

  5. LarryOsterman says:

    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.

  6. baljemmett says:

    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…

  7. LarryOsterman says:

    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.

  8. Foolhardy says:

    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.

  9. LarryOsterman says:

    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.

  10. baljemmett says:

    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.

  11. bob says:

    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.

  12. indranil says:

    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?

  13. indranil says:

    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?

  14. indranil says:

    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?

  15. LarryOsterman says:

    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.

  16. TheMuuj says:

    It’s funny that my SBLive5.1 has an "Auxillary" line, but it is not an "AUX" line (I confirmed this with auxGetNumDevs)

    When I have an internal TV card, I usually use this line to connect to the tuner so that I do not have to run a cable outside my case and waste the Line-In port. Most ATI TV cards (and AIW cards) have an internal connector. I think you can use your CDAudio cable, but I prefer to actually hook that up to my CD (in case I want to play a CD without using much CPU–perhaps while playing a game).

    In the past, I’ve connected the Aux port on my SBAWE64 to my internal modem so that I could hear the handshake over my speakers. I think the connector was supposed to be for speaker-phone, but I never used it for that feature.

    There was also a time when I had two sound cards (a SBAWE64 and a SoundBlaster Live–since my motherboard didn’t support the SBLive DOS emulation), and one card’s output was hooked into the Auxillary input of the other. It was actually very powerful, but switching between soundcards was a pain in the built-in Volume Control.

    Anyway, does anyone have any idea why the "Auxillary" line isn’t an AUX line? What’s the big difference?

  17. Norman Diamond says:

    > Since almost every PC system shipped in the

    > past many years (at least 5) has used

    > digital audio extraction […]

    > (there are some exceptions such as laptop

    > machines,

    The "exceptions" outnumber the "almost every". In Japan new laptops have outnumbered new desktops for, coincidentally, at least 5 years.

    > I hadn’t realized that the SB/16 had an aux

    > jack. I wonder if it functions as aux or as

    > line in?

    Guess what kind of sound card is presented to guest PCs by Microsoft Virtual PC 2004?

    Now let’s see… OK, as far as I can tell, there’s no aux to gore in this discussion.

  18. Ryan Elisei says:

    Would you consider RDO and DAO as part of that list?

  19. Norman Diamond says:

    > 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.

    More precisely: they just don’t exist on any PC powerful enough to run Windows XP or 2003, so it’d be safe to make the API stop working in these and later OSes.

    Even more precisely: they aren’t built-in on any PC powerful enough to run Windows XP or 2003, but they could be attached via SCSI cables, so it still wouldn’t be safe to make the API stop working.

    Details: last month I saw a computer actually still in use in an industrial environment with a 5.25-inch floppy drive built in, and a few months earlier I considered buying an external SCSI floppy drive just for laughs (I didn’t buy it but someone else did).

  20. Wound says:

    Larry,

    regarding your new style, which I like by the way, you could always do a bunch of alternate style sheets and allow people to pick and choose their favorites.

    http://www.alistapart.com/articles/alternate/.

  21. Paul Walker says:

    Nice article; I like these since I can follow them, while I get lost in the ones which actually try and make Windows do stuff. :-)

    (As an aside, I quite like the current style you’re using. Don’t suppose you can convince Mr Chen to switch to something similar…?)

  22. LarryOsterman says:

    Wound: Unfortunately, the Community Server software we use doesn’t allow for user-specified CSS :(.

    I’m still tweaking the CSS (and learning CSS in the process). Raymond’s given me some really useful hints on how to go about it so we’ll see what happens.

  23. mschaef says:

    "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? "

    If you have a scroll wheel (and are using MSIE 6), try holding down the control button and scrolling the wheel. Text can be enlarged and shrunk this way.

  24. Adrian says:

    My brother uses the line in/out on his sound card as a cheap analog-to-digital recorder and playback device. Hook up a IR LED and an IR sensor, and you have a learning remote control. I’ll have to check to see if he’s using the AUX port, too.

    As for floppies, what do you mean they’re obsolete? They are the only portable media in my household. Ever since putting on a security patch on my wife’s XP box (long before SP2), Microsoft file sharing stopped working (I’ve wasted many weekends trying to get that working again). My newest USB thumb drive doesn’t work with my Windows 98 box. I’ve never found a reliable CD burner. So the *only* ways to move files between our machines are email, ftp through our Web host, or a floppy. I find the floppy is fastest.

    And, yes, new PCs do come with floppy drives. My shiny, new HP/Compaq box here at work has a perfectly functional floppy drive.

    Next you’ll try to tell me serial ports are obsolete!

  25. LarryOsterman says:

    Adrian,

    Who said anything about floppies being obsolete? I said 5 1/4" floppies. 3 1/2" floppies are still around, but 5 1/4" floppies haven’t been made for PC’s in at least 10 (maybe 15) years. The 5 1/4" floppy (1.2M floppies) went out when IBM introduced the PS/2 machine with 1.4M floppy drives back in 1987.

  26. Adrian says:

    Sorry, Larry, I was reading too quickly. Others have suggested that floppies in general were going extinct, and I thought you were echoing those sentiments.

    Then again, I just picked up a box of blank 5.25" floppies on Ebay to use with the 286 PC I bought last year. (Really! It has a board in it that has no equivalent made today. I’m trying to reverse engineer it so I can emulate it in order to preserve presentations that rely upon it.)

  27. Jonathan says:

    Oh, and nice Asimov ref on the title!

  28. John Elliott says:

    At least one person has used a 5.25" drive with XP:

    http://groups-beta.google.com/group/alt.os.windows-xp/msg/6d786fc9841e58ae

    Does XP still support 4 floppy drives like NT and Win2000 do?

  29. Mark Hampton says:

    While we’re on the topic of AUX… Anyone remember the device AUX:? I think on my original IBM it was mapped to a second serial port. And what ever happened to support for 8" floppies? I still have several (CP/M formatted) in my closet of antiques.