LineIn plugin for Winamp 2/5 Documentation - Devices
Up | Previous | Next | Down
Different kinds of devices
There are two kinds of devices to be recognized:
- Soundcards, etc.
- Input devices (line-in, mic-in, etc.)
The first kind can be selected with the dev option in my plugin. To do that you can go to the config dialog of my plugin (see Customizing for a description) and view the list of devices listed:
The picture shows the lower part of the dialog with the first four devices listed (most people will only have two or three entries) (note that in version prior to v1.60 the tabstrip wasn't there, as well as the alias column).
The first device is the Windows Wavemapper device, this is a device that 'maps' to other devices (and can do things like samplerate conversion). The second device is the recording device of my onboard soundcard (a Yamaha), the third is the System Waverec device of my Terratec soundcard (which has a lot of 'devices'), the fourth is also a device of my Terratec soundcard. I'll refer to these sounddevices as soft from now on.
Just to show the correlation between this list and the real devices installed (I'll refer to those as hard), here is a screenshot of the sounddevices in Device Manager (I've circled the sounddevices):
As you can see I've got three 'hard' sounddevices, which all produce one or more 'soft' devices from which you can input sound (waveIn devices, the devices listed in the config dialog of my plugin).
Also, each sounddevice can normally record from more than one source. This is dealt with in (loosely) two ways, most soundcards are like my onboard Yamaha card, they export one device that can be opened and you can select from which input the soundcard records in the windows mixer (sndvol32.exe or doubleclick the little yellow icon in the systray, or see Basics for a description):
All these devices are accessible through the single (soft) sounddevice called DS-XG Wave Recording.
The other way is to have one (soft) sounddevice for each source, as my Terratec card does and also the Virtual Audio Cable uses this method.
Different APIs, standard and DirectSound
As of v1.60 of my plugin DirectSound devices are supported as well as the standard audio devices, there is a big difference in coding for these two types of devices, but it makes almost no difference wether you use one or the other with my plugin. This is a list of differences between the two:
- DirectSound is not supported by all systems, you have to have DirectX 5.0 or later installed. The standard APIs are supported by all Windows systems, from Windows 95 to Windows XP, they would probably even work under Windows 3.
- My DirectSound implementation only supports 64 buffers, this is because of a Windows limitation. The standard APIs almost don't care how many buffers you give them, I have seen a setup with a thousand buffers working without a problem. (although the usefullness of such a setup can be questioned)
- In some cases the standard API calls give problems, in these cases the DirectSound drivers usually work without any problems, this was the original reason for me to implement the support.
- In the future I may include support for DirectSound filters, these filters would not work with the standard APIs.
- The standard APIs work with device IDs (from -1 to the number of soft devices), DirectSound works with GUIDs, which are almost impossible to remember (they are more than 30 characters long). Fortunately the plugin supports aliases for devices.
Normally you would use the standard APIs, especially because the DirectSound has almost no advantages (yet), but if you run into any trouble using the standard APIs they can be a life saver.
NOTE: If you have an NT/2000/XP system the DirectSound API's are usually better supported than the standard API's, so try them. On 9x/ME it's the other way around (the standard API's are usually better supported than the DirectSound API's). But keep in mind this depends heavily on your drivers.
Aliases
Introduction
In v1.60 I introduced support for device aliases, this is necessary to specify DirectSound devices without having to memorize very large numbers and is more logical anyhow.
To give a device an alias, go to the config dialog of my plugin, you will see a list of devices in the lower-half of the screen, it should look like this (note that the DirectSound tab is only displayed if your system supports DirectSound):
Or, if you selected the DirectSound tab:
You can see that both lists contain an alias column, this column contains the aliases for respective devices. If it is empty there has not been created an alias for the device, in my case you can see that I have made a few aliases:
- wavemapper for the windows wavemapper (standard device)
- Hoi for the Primary Sound Capture Driver (DirectSound device, similar to the wavemapper)
- DS-XG for the DirectSound device of my Yamaha card
- tape for the WaveRec 1/2 device (for both types)
This means I could use:
line://dev=dDS-XG
to open my Yamaha for recording
line://dev=wtape
to open my WaveRec 1/2 device (Standard)
line://dev=dtape
to open my WaveRec 1/2 device (DirectSound)
line://dev=1
to open my System WaveRec device (Standard)
But NOT:
line://dev=wDS-XG
to open my Yamaha for recording, because of the wrong device type
line://dev=tape
to open my WaveRec 1/2 device (Standard), because dev= without a flag following it expects a device ID for a standard device
line://dev=d2
to open my WaveRec 1/2 device (DirectSound), because of the wrong device type, but also because the 'd' expects an alias
line://dev=w1
to open my System WaveRec device (Standard), because the 'w' wants an alias and not a device ID
Creating an alias
To create an alias you have to double-click on the device you want to create a device alias for in the device list, after double-clicking you will get a screen similar to this:
If you double-clicked on a DirectSound device you would have gotton a similar dialog, only with different text. Simply fill in the desired alias in the textbox and press OK. Now you will see the alias listed in the device list. To change an alias simply doubleclick the device again. (BTW, the dialog shown here is a little outdated, since starting with v1.70 the dialog will show the device name instead of the id)
Deleting an alias
Before v1.70 it wasn't possible to delete an alias, but now it is, just select the device with the alias you want to delete in the device list and press Del, you can also double-click the device and make the alias an empty string.
What to use
Normally you won't touch the dev option of my plugin, it will do what you want in most cases, you will however almost always want to change the source of the sound in the windows mixer (go to Basics for a description). There are however situations in which you might want to use the dev option, when you have a soundcard that has one soft sounddevice for every source, but also if you want to use Virtual Audio Cable (or something similar), or want to be sure you're recording from the right device (and theoretically it should give a slightly smaller delay if you input from the right device directly, this difference should be very small however).
To use a different device than the wavemapper you only have to specify the device ID (or alias) listed in the config dialog of my plugin, if I wanted to record directly from the System WaveRec device of my Terratec card, I would use the following options:
If I wanted to record from the Virtual Audio Cable (not listed in the screenshot, but it has device ID 9), I would use these options:
Of course you can use any options you like in combination with the device option, if I wanted to record at a samplerate of 96000 Hz on my WaveRec 1/2 device (which has device ID 2), I would use these options:
If I wanted to record from the line-in of my onboard Yamaha however, I would use the following options (in combination with settings in the windows mixer):
Possibly I would like to listen to my radio through Winamp, then I might use these options (again in combination with settings in the windows mixer, as described in Basics):
line://dev=0,mono,title=Radio,hideformat,numbuffers=20
These are the three ways I can use to specify my EWS88 MT WaveRec 1/2 device (which is connected to a tape recorder):
line://dev=2
, this is the old way of doing it, and the simplest
line://dev=wtape
, notice the w
in front of the tape
, this uses the standard APIs in combination with a device alias.
line://dev=dtape
, notice the d
, this tells the plugin you want to use DirectSound, and in my case the alias for the DirectSound EWS88 MT WaveRec 1/2 device is the same as the alias for the standard EWS88 MT WaveRec 1/2 device.
NOTE: Both types of devices do NOT have to have the same alias, they are completely independent of eachother, and you also don't have to give every device an alias (although you can't use a DirectSound device if you don't give it an alias).
Up | Previous | Next | Down
To contact me, please mail to: th.v.d.gronde@hccnet.nl
I hope you'll enjoy my program(s).