Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Output as 32-bit float when soundcard doesn't support the format (Read 2735 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Output as 32-bit float when soundcard doesn't support the format

Hello developers,
I have recently downloaded Foobar v 1.6 (stable release) to give it a try and just found that on my laptop with Intel 6th gen processors and Win 7 when playing something through Foobar and then reading the log in console it writes output stream as 32 bit float but this option is not neither reported as possible in the output option of the onboard soundcard (for which I don't have installed drivers yet but using Windows standard HD audio drivers - because have problems with original Realtek drivers ).
I havent done proper audio listening test to tell if this is good or bad but yety it seems weird to me so I am reporting it.

Cheers

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #1
That's completely normal. The 32bit float stream goes to the Windows audio engine, which in turn converts it to whatever the soundcard driver supports (like 24bit, for example). Such conversions don't affect the sound in an audible way.

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #2
Ok thanks,
that's understandable, but what I intend is how this process of resampling the output before it goes into the audio sound card is profitable for an audio player of foobar's scope?
I mean it's not an editing program, it is just an audio player and at most an audio archive, so what is the implicit benefit of sending the output at 32 bit per sample when it is originally written at a lower resolution? Does it not just increase processors' workload?
On other hand let's say you record samples at 32 bit resolution (and it means you have quite big perspectives in recording music ) then you don't use foobar to listen to those samples - actually downsampling original masters is a widely accepted practice since long time now, as far as i know, and it is said to deliver quite an excellent sound.

I don't want to sound adverse to the concept but personally I run few tests to discover the advantages of outputting at 24-bit a 16-bit original sample and I haven't noticed anything noticeably better (and I agree it may be a personal limitation so I want to know what is the perception of others who say that changing original resolution gives something to the sound... )  :)

Thanks,
Filippo

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #3
I mean it's not an editing program...
Well, it kinda is. Besides the fact that it can apply various effects, even just changing the playback volume is a form of audio processing. And working at 32bit float internally allows for much bigger volume changes without losing sound quality, so that's what audio apps usually do. The CPU load of converting to 32bit float is insignificant.

I run few tests to discover the advantages of outputting at 24-bit a 16-bit original sample and I haven't noticed anything noticeably better
Right, it shouldn't make much of a difference. Converting from 16bit to 24bit alone doesn't improve anything. But for example if you lower the volume of 16bit audio and then output to 16bit, you lose some lower bits of audio. Whereas if you output to 24bit the low level audio is preserved (up to a point). That's why it's also better to set the Windows audio/driver to a higher bit depth, even if you're playing 16bit music.

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #4
Previous answer beat me to some of this, but I don't bother editing it away:

First, resampling is about sampling frequency, not about bit depth.
To convert a 16-bit signal to 24 bits, you don't resample - you just throw in zeroes. It is just like if you have three-digit decimal numbers 000 to 999 and choose to represent them as six-digit numbers 00000 to 000999 - there is nothing strange happening to the quantities represented. OK, you cannot just put "000" in front of negatives, you have to put them after the negative sign, but it isn't witchcraft. Neither is the conversion to 32-bit float - which is a general-purpose numerical format. To humans there might be a bookkeeping job (go to https://www.h-schmidt.net/FloatConverter/IEEE754.html and enter your fave number between -32768 and 32767 and see what happens - or for 24-bits, -8388608 to 8388607), but computers do bookkeeping faster than you can even think.

So that is the case for "bit-perfect" output. But if you use a (digital) volume control, you are not delivering the bits as they were on the file. Changing volume obviously changes the signal.
foobar2000 versions 1.x.y use 32-bit float for whatever processing you ask it to do to the signal, including the volume controls (and ReplayGain is a 'volume control' as well!). The signal is already converted to 32-bit float internally before processing.

Then after all that, the sound card should get a signal which it can process. fb2k can either send it to Windows' audio engine, or process itself (if you go into Preferences -> Playback -> Output -> Devices, you will see that there are some <automatic> - and for exclusive mode, some numbers. Don't try to be too smart there, you might get errors.)

Delivering what was originally a "16 bit" signal in a 24-bit stream might have an advantage if you have attenuated it a lot and then use the amplifier's volume knob. Say if you turned it down 30 decibel, then 16 bit delivery would discard the five lowest bits, and you won't get them back by amplifying. Converting to 24 means that those five bits are still there, just shifted five bits to the right. and provided the DAC can deliver 21 bits resolution - that is about the max available! - they will still be there after a 30 dB volume boost.

Now, let's go full circle back to your resampling question. Most sound cards don't handle every thinkable sampling rate, so if you go to https://hydrogenaud.io/index.php/topic,121478.0.html and download the testbench files, there will be some which will need to be resampled for you sound card to play them. That is "for compatibility". If you feed your sound card a 48 kHz signal, your sound card does not need it to be resampled.

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #5
Oh very nice and interesting explanation, thanks for it.
I have never thought that changing bit quantity per sample could help in reducing quality loss when changing volume between player and output. But If I have understood correctly it is advisable to set the volume fixed on the player and change it on the soundcard control panel, right?
Anyway, my contribution here would be suggesting to do a little sound check when changing playing music set and then keep the volume at that level that suits the room and the audience and if necessary change it smoothly at the amplification stadium.
Thanks folks,
C0574

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #6
If I have understood correctly it is advisable to set the volume fixed on the player and change it on the soundcard control panel, right?

Nah ... often you don't. "Most often" I don't, but it depends on what you want to achieve.
Do you let other sounds mix in? (I mean, if you are doing work and want system beeps to tell you you are doing something wrong, then ... fine.)
What I do:
 * use Exclusive mode, let let it take control over the soundcard, use fb2k's volume control (with ReplayGain enabled)
 * if I need other audio output from the computer, that goes to the built-in speakers.  Which I mute from the Windows volume control if don't want the music to be interrupted in any way.

Caveat: Windows may mess up this if your computer goes into and out of power saving modes. Then it may pick the first available audio device to send the "I'm awake!" or "power up" sounds. Possibly louder than you think. Test out!

Re: Output as 32-bit float when soundcard doesn't support the format

Reply #7
hello wise Porcus,
I've spent my spare time so far in going into Windows core audio Apis documentation to gain better understanding of what discriminates this from that and I realized that programming that kind of stuff is a world apart from what is playing and recording music but I also realized that there is not much space for improvement when the audio mixing engine works at 44100hz 16 bit and there aren't killer application that works in exclusive mode stream (except for FOOBar naturally )... so I'm fine with what the tech gurus developed so far (i mean i think with spatial audio they already went too far... out in the space perhaps...) and I will happily listen to good old CD tracks even if the disc is not spinning anymore. This is not a judgement over current developments but just a farewell to this forum...  which I really like but sadly haven't enough competence to share in it... and honestly I don't think much space is left for improvement seeing all these kids listening to music streamed over wireless internet on their smartphones' speakers It seems to me all this development brought back to fm portable radios (but with many stream providers whose aim is not playing music but setting trends...) Sorry but I'm not of this scene.  Bye by c0574