If anyone is interested, here is a description of measuring the output impedance of a sound card, using only a splitter, headphones, and freely available software. An amplifier can also be added to the loop to measure that instead, but you have to be careful not to damage the input of the sound card with excessively high voltage (e.g. by setting the volume too high). Also, if the amplifier is AC powered and grounded (headphone-only amplifiers are not in most cases), there may be problems due to ground loops.
Hardware setup: connect the male jacks of the splitter to the line input of the sound card, and the output of whatever is to be measured; if it is an amplifier, set the volume to zero for now, and connect the sound card line output to its input. Configure the sound card as necessary for loopback recording, setting the input and output levels in the mixer.
In the example test, I used a Xonar D1 sound card, DT770 Pro 250 Ohm headphones, and
this program. When first run, it asks for the audio input and output device, select them as needed. Then, in the menu at the top, click "Settings" to open a configuration window. Not all the following changes may be necessary or useful for this simple measurement, but I set the FFT size to 16384, sampling frequency to 96000 (or use whatever works best with your hardware), clicked "Confirm", then set the smoothing window to "Blackman opt." and the bit depth to 24 (if supported), and checked "Extensible". There is nothing else to configure here that is relevant, so the window can be closed by clicking OK. At the right of the scope (top) display, "DCremoval" and "Values" should be checked. Now open the waveform generator by clicking "Wave" in the top menu. In this window, check both "Interlock" settings, set "Levels (% full scale)" to zero for now, and the frequency to 1500 Hz. Why 1500 Hz ? Because with the headphones used, the reactance and distortion are low at that frequency. With other headphones, a different frequency may work better, but 1500-2000 Hz is good for most full size dynamic ones. On the "Setup" tab, set the waveform generator sample rate and bit depth similarly to the input. With everything set up, the test can be started.
Enable the audio input and output by clicking "On" in both the top menu of the main window, and in the waveform generator window. If there are no errors, increase the volume (with "Levels (% full scale)" and/or the amplifier volume knob) until there is some signal on the scope display that is high enough to be clean, but low enough not to be distorted (or make the test headphone too loud).
The signal level is displayed at "TRms (%fs)". If you check "Infinite avg", this can be averaged over a longer period of time for more accurate results. Do so without the headphone load first, and wait until the displayed value stabilizes enough and stops changing consistently in one direction. Write down the RMS level (I got 2.7654145, for example). Uncheck the averaging to clear the result, and then repeat the measurement with the headphone load connected. In the example test, the RMS was 1.9992840. The measurement is complete, so the program can be closed.
Calculating the output impedance from the measured levels is simple, but you have to know the impedance of the load (that is why resistors are preferred for an accurate result). In my example, I assumed it is 260 Ohm. The formula is:
Z_out = Z_load * ((V_unloaded / V_loaded) - 1)
With the example values:
Z_out = 260 * ((2.7654145 / 1.9992840) - 1) = 99.63 Ohm
This is quite close to the correct result of 100 Ohm.
I did the test again with the rear channel output, and got:
Z_out = 260 * ((2.9916870 / 2.9480940) - 1) = 3.84 Ohm
Of course, any other tools and software may be used, you just need to find out the ratio of the unloaded and loaded output voltage with a known load impedance, and then apply the above formula.
With a sound card, there is also some inaccuracy due to the low input impedance of the card itself (as opposed to a DMM), which affects the result as if it was connected in parallel with the output impedance of the source. Sticking with the above example, correcting the result for an input impedance of 3800 Ohm gives:
Z_out = 1 / (1/99.63 - 1/3800) = 102.31 Ohm
For comparison, the same test with a 220 Ohm resistor load gave 23.199% unloaded and 16.037% loaded level. That means (see formulas above) 98.25 Ohm impedance, or 100.86 Ohm with input impedance correction.
Finally, with a simple DMM (measures AC voltage reasonably accurately from ~30 to ~2000 Hz) and 400 Hz frequency, 1.362 Vrms and 0.936 Vrms were measured using the 220 Ohm dummy load. This translates to 100.13 Ohm output impedance.