Page 2 of 3
Re: Vista Playback Default Format and Audacity
Posted: Wed Jan 07, 2009 6:45 pm
by kozikowski
Got got me there. How did you get the "distortion" waveform? Just subtracting before and after won't necessarily give you that.......unless you're really looking at the difference in the sample points. That would give you a comb like that.
That's also misleading because the audible distortion is really the difference between sample rate changes without distortion and sample rate changes with. If you suck out the digital carriers, I bet you find signal flat-topping which is what you're really hearing.
This piqued my interest because I don't have a digital distortion analyzer.
I wonder if you can get "real" distortion numbers if you do a distortion causing change, and then reconvert back to the original sample rate. Subtract and poof, distortion waves with no carrier interference.
The obvious brute force way to do this is a multi-pole Butterworth Low Pass Filter.
My "real" distortion analyzer has a frequency limit switch. I'm pretty sure the instrument won't go up to 48 KHz. There are time signals broadcast in the US on 20 KHz., so anything above that is considered "radio" and not audio.
I also suspect that the reason bass notes seem to have this, is the difference between the note and the aural effect--a chirp or click. If you started with a higher musical note, the distortion would still be there, but would be ultrasonic.
It would probably make your dog crazy.
Koz
Re: Vista Playback Default Format and Audacity
Posted: Wed Jan 07, 2009 7:08 pm
by NineEyes
stevethefiddle wrote:I've isolated the distortion Vista_SB_MP3_resample_noise.ogg.zip and it appears to be two frequencies, one at around 3800 Hz and the other around 4000 Hz "chirping" along with your bass notes.
And here's the plot of
http://webpages.charter.net/friedl/Vist ... ayback.wav:
It looks like classic aliasing to me, centered on 1x and 2x the difference between 48000Hz and 44100Hz.
The relationship may be a little difficult to see...I'm using 1.2.6 for the plot and the horizontal axis doesn't quite line up with what the cursor says.
Re: Vista Playback Default Format and Audacity
Posted: Wed Jan 07, 2009 8:07 pm
by steve
NineEyes wrote:It looks like classic aliasing to me, centered on 1x and 2x the difference between 48000Hz and 44100Hz.
So why the distinct double peak, and why not on my computer?
In fact, this is the first report of the problem that I've seen.
kozikowski wrote:I bet you find signal flat-topping which is what you're really hearing
I don't think so. Doing a "sum difference" would give you the clipped peaks, but this distortion gives a distinct tone that is superimposed over the waveform. It looks like a tone with harmonics (or two very close tones with harmonics) that have been amplitude modulated by the sound wave.
Interesting to note that the frequency of the peaks shown in the Analysis view posted by NineEyes remains at the same frequency and is indipendent of the frequency of the original audio.
Is this with any version of Vista?
Is this with dual processor machines?
Re: Vista Playback Default Format and Audacity
Posted: Wed Jan 07, 2009 8:20 pm
by NineEyes
stevethefiddle wrote:So why the distinct double peak,
Because the main lobe has no energy at or around 0Hz.
stevethefiddle wrote:and why not on my computer?
From all observations so far, this appears to be a Vista+Audacity thing.
stevethefiddle wrote:Is this with any version of Vista?
Vista Home Premium, on both computers.
stevethefiddle wrote:Is this with dual processor machines?
Both are Core2 Duos.
Re: Vista Default Playback Sample Rate
Posted: Thu Jan 08, 2009 4:34 am
by NineEyes
NineEyes wrote:Using Vista, Audacity playback is colored when the Audacity "Project Rate" is not equal to the default sample rate of the playback device (called the "Default Format" in Vista).
This coloring can be demonstrated on any Vista system. Here's how:
1. Set the Default Format of the playback device to 44100Hz.
2. Start Audacity 1.2.6 or 1.3.x and set the Project Rate to 44100Hz.
3. Import this 44100Hz wav file:
http://webpages.charter.net/friedl/Vista_SB_MP3+.wav
4. Play it from Audacity. This is how it should sound.
5. Set the Default Format of the playback device to 48000Hz.
6. Play it again. Notice the chirpy sound.
Does anybody know why this is happening in Vista and not XP? Is there a solution for those of us who cannot match our Audacity Project Rate and playback device sample rate?
Here's a second, easier and more sterile experiment. It would be great if a few people with Vista would try it and report back:
1. Set the Default Format of the playback device to 44100Hz (right click the speaker tray icon -> Playback devices -> your sound device -> Advanced Tab -> Default Format) .
2. Start Audacity 1.2.6 or 1.3.6 and set the Project Rate to 44100Hz.
3. Generate a tone (Generate -> Tone) of Sine/80Hz/Amplitude 0.70/Length 30s.
4. Play the tone from Audacity. This is how it should sound.
5. Set the Default Format of the playback device to 48000Hz.
6. Play it again. Note the additional tones.
Thanks!
Re: Vista Playback Default Format and Audacity
Posted: Thu Jan 08, 2009 8:00 am
by Gale Andrews
I suppose it's "possible" the new Vista audio stack has problems we don't know about yet, though if there have been playback or recording problems in the past with Audacity on Vista, switching from 1.2.6 to 1.3.6 has tended to cure them.
The concept of a "default format" is completely new to Vista (I'm not on Vista, so did not even know about it). Could we see a screenshot of this part of the Advanced tab? One thing I have found out is that the Default Format for a capture device is "1 channel, 16 bit, 44100 Hz", so when you install the sound card that only supports 48000 Hz I am interested what will happen if it's initialized to 44100 Hz.
And how do we know Media Player isn't just resampling the 44100 Hz file to 48000 Hz when the Default Format is 48000 Hz? In that case the only difference is that Audacity isn't doing it automatically, because it gives you the choice.
If there is no one here who can try on Vista, I'll see what I can do to have this tested, but as far as I know only developer has a Vista machine.
Gale
Re: Vista Playback Default Format and Audacity
Posted: Thu Jan 08, 2009 3:02 pm
by NineEyes
Gale Andrews wrote:I suppose it's "possible" the new Vista audio stack has problems we don't know about yet, though if there have been playback or recording problems in the past with Audacity on Vista, switching from 1.2.6 to 1.3.6 has tended to cure them.
The switch to 1.3.6 does not help in this case, just to be clear.
Gale Andrews wrote:The concept of a "default format" is completely new to Vista (I'm not on Vista, so did not even know about it). Could we see a screen shot of this part of the Advanced tab? One thing I have found out is that the Default Format for a capture device is "1 channel, 16 bit, 44100 Hz", so when you install the sound card that only supports 48000 Hz I am interested what will happen if it's initialized to 44100 Hz.
Sure. This is from a sound card that only supports 48000Hz:
Here are the advanced tabs for two other sound cards:
Gale Andrews wrote:And how do we know Media Player isn't just resampling the 44100 Hz file to 48000 Hz when the Default Format is 48000 Hz?
...a question posed in my original post. I would guess that either WMP is performing its own SRC or (and I don't know a thing about the Vista audio API), WMP is telling the stack to use a higher quality interpolation.
Gale Andrews wrote:In that case the only difference is that Audacity isn't doing it automatically, because it gives you the choice.
Choice? If there to a way to force playback SRC in Audacity, let me know. I don't think Audacity performs playback SRC unless the tracks have a sample rate different than the project rate.
Gale Andrews wrote:If there is no one here who can try on Vista, I'll see what I can do to have this tested, but as far as I know only developer has a Vista machine.
If there is only one developer with Vista, it's understandable how this may have slipped by - you need your configuration "just so" and you need a simple low-Hz sample. I used Audacity+Vista for a while in this condition and never heard the aliasing until I worked on bass tracks alone.
Re: Vista Playback Default Format and Audacity
Posted: Sat Jan 10, 2009 4:13 am
by NineEyes
Here's an update: I restored the hard disk image that was on my Vista PC the day I received it from Dell (Summer '08). With that image, and nothing new installed but Audacity 1.3.6, the playback issue was still observed. So, it would seem that the PC arrived in this condition.
Re: Vista Playback Default Format and Audacity
Posted: Sat Jan 10, 2009 7:46 am
by Gale Andrews
Thanks for the screenshots. I am not sure of the scenario where things sound better for you, but: if the "normal" activity you want to do is import 44100 Hz files, then a kludge workaround is to launch Audacity not by clicking its executable, but by opening a 48000 Hz silent file with a suitable command or file association. A file a few milliseconds will do. For example just create a .bat file in Notepad containing:
"C:Program Filesaudacity.exe" C:silent.wav
and double-click the .bat to launch Audacity.
Then when you import your 44100 Hz files, the project rate will stay at 48000 Hz (because only the first imported file changes the project rate to the rate of the imported file), and the 44100 Hz file will be resampled (by Audacity) on playback to 48000 Hz. If you want to export at 48000 Hz sample rate, you're all set. If you want 44100 Hz (for example because you are burning an audio CD), you'll have to change the project rate at export time.
Or if you can install two sound devices at once and be satisfied with the 44100 Hz device just for playback in Audacity, set that one as the playback device in the Audacity Audio I/O Preferences.
Please be patient while we see about testing this on Vista.
Thanks
Gale
Re: Vista Playback Default Format and Audacity
Posted: Mon Jan 12, 2009 9:04 pm
by Leland
NineEyes wrote:
If there is only one developer with Vista, it's understandable how this may have slipped by - you need your configuration "just so" and you need a simple low-Hz sample. I used Audacity+Vista for a while in this condition and never heard the aliasing until I worked on bass tracks alone.
I see what you mean. I couldn't hear it until I turned up the volume quite a bit, but it's certainly there.
The problem as you seem to have already figured out is that Audacity doesn't really have access to the default device format and probably couldn't change it anyway if the device is running in shared mode. In shared mode, the system has to retain one set format and resample to that format for data coming from all applications. Nor do we have the ability to change to exclusive mode.
So, if Audacity's Project Rate is set to 44100 and the default format is 48000, the system will have to resample the data Audacity gives it to satisfy the default format. Same goes for the other way round...default=441000, project=48000. And that resampling, as you've pointed out, doesn't produce very pleasant results.
I have two options for you.
The first is to simply ensure that Audacity's Project Rate and the default format for the sound device are the same, even if the individual tracks within Audacity have differing rates. If the tracks do have differing rates, then Audacity will resample to the Project Rate and will produce better results that what we seem to getting from the system.
The second option is to download the following:
http://audacity.homerow.net/index.php?d ... +1.3.7.zip
It is a recent build of our upcoming 1.3.7 release. While it does not directly address your problem, it does have a feature that seems to get around it.
When you start it, go back into Audacity's Preferences and reselect your Playback and Recording devices. You'll notice that you have more devices than before and you should see "MME:" and "Windows DirectSound:" devices. Select one of the DirectSound devices and try your testing again. I think you'll find that it no longer happens. (Well, my aging ears can't hear it anyway.)
The reason this works is that the library we use to access the system's audio devices happens to allocate DirectSound devices in exclusive mode! This is exactly what we need to open the device in whatever format we like without incurring the resampling present when using the MME devices, or more correctly, the devices in shared mode.
Leland