cannot disable resampling for ICH6 (OSS4)

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Re: cannot disable resampling for ICH6 (OSS4)

Postby hiro » Wed Nov 17, 2010 9:08 am

If you say your sound is perfect there's of course no need to switch.

I bought an external soundcard because none of my onboard soundcards ever satisfied me

You could get some nice stuff from RME, Echo, etc. Here you can hear the difference between 16 and 24 bits, because these companies will actually give you what's said on the package.

There is also M-Audio. Most of them come with a USB connector.
Some argue they don't sound the same, but for 16 bit which I tested on this card I only heard little difference, definitely not annoying like these onboard chips. There are other companies in this segment one may try. I bet most of them will sound way better than the average onboard soundcard.
As long as you don't take the 10€ version there's a high chance you will get proper sound.

Regarding resampling:
Pulseaudio has nothing to do with OSS. It sits one layer above OSS. You may seek support from your distribution if you can't find a way to disable/remove pulseaudio. But as long as your apps don't try to use pulseaudio as an audio device you shouldn't have any problems either.
All my stuff only has OSS support compiled in and as we already explained you can easily disable resampling with ossmix.

Some soundcards are dumb though and as you already know (I assume for simplicity) they resample everything to one common sample rate...
Of course if the SRC implementation is good sound can still be great.
My audiofire doesn't resample, instead you can choose one of the common sample rates.

And don't believe udial.wav or similar tests. They don't detect all SRC and probably destroyed more than helping anyone. And there possibly are other effects besides SRC which can also produce false positives.
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Wed Nov 17, 2010 3:15 pm

hiro wrote:as we already explained you can easily disable resampling with ossmix.


Do you really believe that you can disable everything with ossmix?

The most radical solution is to disable the virtual mixer by setting "vmix_disabled=1" in /usr/lib/oss/conf/osscore.conf (you have to reload oss to enable this option).
However, there is a kind of invisible resampler which exists and works, even if the virtual mixer is disabled.
It does perform resampling 44100Hz → 48000Hz, when the virtual mixer is disabled in osscore.conf
It is still unclear
(1) whether it is an internal hardware resampler of the soundcard (ICH6),
(2) or it is an invisible resampler of OSS4, which is impossible to disable.

It seems that you do not believe that certain test files may help to detect low quality resampling.
Are you going to say that ICH6 can play 44100Hz without resampling?
Which soundcards can play 44100Hz without resampling?
Could you please name such soundcards?
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby cesium » Wed Nov 17, 2010 9:28 pm

You can go further than that, and compile OSS without the virtual mixer (--config-vmix=DISABLED), but I doubt there's any need. There's no evidence in source of an "invisible resampler".
cesium
Developer
 
Posts: 902
Joined: Sun Aug 12, 2007 12:51 am

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Wed Nov 17, 2010 9:47 pm

cesium wrote:You can go further than that, and compile OSS without the virtual mixer (--config-vmix=DISABLED), but I doubt there's any need. There's no evidence in source of an "invisible resampler".


When CD format (16bit, 44100Hz) is played without the virtual mixer (it is disabled), sound quality is comparable to that of "Production quality".
Do you think that ICH6 can play 44100Hz without resampling?


----------------------------------------------
Let us imagine that my ICH6 soundcard can play the audio CD format bit-to-bit perfect with absolute exactitude (input = output). The output of such soundcard would be a discreet digital signal (16bit, 44100Hz). As far as I know, human beings cannot hear such digital signals. To be heard, digital sound should be converted into analog sound.

Any soundcard is, in fact, a kind of digital-to-analogue converter (DAC).

There are two parts to every audio interface/card that affects the sonic performance profoundly. The first are the software drivers that come with the card. The second is the quality of the digital audio converters (DACs) that are physically on the card. Audio interfaces may have mic preamps, and these too can affect the quality of your recordings. http://www.tweakheadz.com/soundcards_fo ... studio.htm


What is the difference between DAC and HW SRC (hardware sample rate converter)?

The sampling rate, sample rate, or sampling frequency defines the number of samples per second (or per other unit) taken from a continuous signal to make a discrete signal. For time-domain signals, the unit for sampling rate is hertz (inverse seconds, 1/s, s−1). The inverse of the sampling frequency is the sampling period or sampling interval, which is the time between samples. http://en.wikipedia.org/wiki/Sampling_rate


By definition, sample rate is the number of samples per second. See pictures here: http://en.wikipedia.org/wiki/Sampling_rate
If the sample rate becomes infinitely large, a discrete signal becomes an analog signal. Thus, digital-to-analogue converter (DAC) is, in fact, a sample rate converter (SRC). Any soundcard, in fact, resamples discrete signals into analog signals. If a souncard cannot perform such resampling, it cannot produce audible sound. More exactly, soundcard produces analog electric signal delivered to the speakers which produce audible sound.

To summarize: if a soundcard does not have HW SRC, it is not a soundcard, because is cannot produce audible sound.

Is it true that ICH6 does not have HW SRC?

viewtopic.php?f=3&t=4035&#p15994
cesium wrote:and since the card likely has no HW SRC, you need a software one. If vmix's SRC isn't good enough - you can try a software audio server. ESD, Pulse, JACK, the late NaS and aRts etc. etc.


Since my ICH6 souncard does produce audible sound, I tend to believe that it has HW SRC. However, it is still unclear whether unwanted resamplers (e.g. a kind of invisible PulseAudio) are involved, or not.

cesium wrote:There's no evidence in source of an "invisible resampler".


The study of "source code" does not ensure anything. Let us consider a historical example:

http://www.theregister.co.uk/2009/07/17/linux_kernel_exploit/
Clever attack exploits fully-patched Linux kernel
'NULL pointer' bug plagues even super max versions
By Dan Goodin • Friday 17 Jul 2009 22:32

...The exploit works only when a security extension knows as SELinux, or Security-Enhanced Linux, is enabled. Conversely, it also works when audio software known as PulseAudio is installed.


You see, a certain security expert, Brad Spengler, studied the "source code" of Linux and discovered that SELinux and PulseAudo are actually "backdoors" which can be exploited by botnets http://www.google.com/search?aq=f&sourc ... nux+botnet
The "source code" of these "backdoors" was published and studied by many experts, and SELinux was installed in Ubuntu by default. SELinux was "merged into the mainline kernel 2.6.0-test3, released on 8 August 2003" http://en.wikipedia.org/wiki/Security-Enhanced_Linux
I had SELinux in Ubuntu 6.10 (in 2006) and in Ubuntu 9.04, and I did believe that my Ubuntu is secure.
See also: http://www.grc.com/sn/sn-268.htm

Interpolation and Resampling

By definition, upsampling is interpolation of data http://en.wikipedia.org/wiki/Upsampling
Let us imagine that we have a physical instrument for measuring electric signals (amplitude vs. time). The result of measurement can be represented in a picture like this: http://en.wikipedia.org/wiki/File:Sampled_signal.png
In this case, the picture of "sampled signal" is a picture of measured data. The points represent "real data", and "empty spaces" between points represent "imaginary data" (that is, unknown data). The "empty spaces" are "sampling intervals". The smaller the "sampling interval", the more exact measurement. This depends on the exactitude of measurement instrument. If it is exact in an absolute sense, we do not need to interpolate data. If the measurement is very exact, and "sampling intervals" are very small, we can join the points of "real data" with straight lines. This would be a linear interpolation, and it would be very exact, provided that "sampling intervals" are very small.

Let as presume that our soundcard has inside the simplest sample rate converter which performs linear interpolation (that is, the simplest low quality resampling). Imagine that a linear interpolator (for example, this one: http://www.johndcook.com/interpolator.html ) is embeded in your DAC.
1. If this linear SRC is applied to a digital signal of 200000kHz sample rate, the result would be a high quality sound, it would be very exact.
2. If this linear SRC is applied to a digital signal of 48kHz sample rate, the result would be a low quality sound similar to that of PulseAudio, or even worse.

To summarize: Regardless of the interpolation method implemented in SRC, high sample rate is always better than low sample rate. This obvious fact follows from common sense. You do not need any theory to understand this. If you want to have high quality sound, you should try to record and play sound with maximum possible sample rate.

It might be stating the obvious, but mathematical methods of interpolation can never be exact. You cannot produce "real data" from the lack of "real data". Any interpolation method produces nothing more than a mix of "real data" and "imaginary data".
Both interpolation and extrapolation methods are a kind of shamanism rather than exact science. There are heuristic methods of interpolation which tend to be used when measurement instruments lack exactitude. The most fundamental heuristic method is "trial and error", one may try to interpolate sampled signal (i.e. discrete digital signal) in this, or that way, listen to the results, and decide which method produces a better sound. This is how it is actually done in reality.

However, there is a quasi-scientific mythology named "Nyquist–Shannon sampling theorem" which invites us to believe that interpolation can be perfect in an absolute sense:

The Nyquist–Shannon sampling theorem states that perfect reconstruction of a signal is possible when the sampling frequency is greater than twice the maximum frequency of the signal being sampled,[2] or equivalently, when the Nyquist frequency (half the sample rate) exceeds the highest frequency of the signal being sampled. If lower sampling rates are used, the original signal's information may not be completely recoverable from the sampled signal. For example, if a signal has an upper band limit of 100 Hz, a sampling frequency greater than 200 Hz will avoid aliasing and allow theoretically perfect reconstruction. http://en.wikipedia.org/wiki/Sampling_rate


Are you ready to believe that in the myth of "theoretically perfect reconstruction of a sampled signal"?

For example, audio CDs have a sampling frequency of 44100 Hz. The Nyquist frequency is therefore 22050 Hz, which is an upper bound on the highest frequency the data can unambiguously represent. If the chosen anti-aliasing filter (a low-pass filter in this case) has a transition band of 2000 Hz, then the cut-off frequency should be no higher than 20050 Hz to yield a signal with negligible power at frequencies of 22050 Hz and greater. http://en.wikipedia.org/wiki/Nyquist_frequency


44100 Hz of audio CD format symbolizes the "theoretically perfect reconstruction a sampled signal". You are invited to believe that your audio CDs contain perfect sound rather than "digital crap". You may play an audio CD and believe that sound quality is perfect.

However, you should not forget that the Nyquist–Shannon sampling theorem was derived from the unrealistic assumption:

The theorem assumes an idealization of any real-world situation, as it only applies to signals that are sampled for infinite time; any time-limited x(t) cannot be perfectly bandlimited. Perfect reconstruction is mathematically possible for the idealized model but only an approximation for real-world signals and sampling techniques, albeit in practice often a very good one. http://en.wikipedia.org/wiki/Nyquist%E2 ... ng_theorem

In practice, neither of the two statements of the sampling theorem described above can be completely satisfied, and neither can the reconstruction formula be precisely implemented... It cannot be realized in practice
http://en.wikipedia.org/wiki/Nyquist%E2 ... iderations


Let us consider two assumptions:

Assumption 1: Finite sample rate and infinite time interval (this is the basic assumption of Nyquist–Shannon theorem).
Assumption 2: Infinite sample rate and finite time interval.

These assumptions are equivalent. This might be obvious for those who studied math in the primary school. The first assumption represent an ideal sampled signal of infinite length in time (think of million years). The second assumption represent an analog signal which does not need to be resampled, or reconstructed, or interpolated.

In short, the Nyquist–Shannon sampling theorem appears to be a calculated deception. It seems that the purpose of this theorem is to camouflage the heuristic nature of the particular interpolation method.

hiro wrote:I bought an external soundcard because none of my onboard soundcards ever satisfied me

You could get some nice stuff from RME, Echo, etc. Here you can hear the difference between 16 and 24 bits, because these companies will actually give you what's said on the package.

There is also M-Audio. Most of them come with a USB connector.
Some argue they don't sound the same, but for 16 bit which I tested on this card I only heard little difference, definitely not annoying like these onboard chips. There are other companies in this segment one may try. I bet most of them will sound way better than the average onboard soundcard.
As long as you don't take the 10€ version there's a high chance you will get proper sound.


I have nothing against expensive soundcards, although I am not going to buy them. One may purchase a very expensive soundcard for several thousands dollars, listen to mp3s and other "digital crap", and enjoy. If it makes happy, it is perfectly O.K.

Although interpolation methods can never be exact, we can create an artificial reality where certain interpolation methods can be exact in an absolute sense. An obvious example of such artificial reality is an ordinary personal computer. Since certain mathematical functions (which are used for interpolation) are embeded in hardware (e.g. in DAC), these functions (which were obtained by trial and error) are now exact physical laws of this particular artificial world. Therefore, a very exact sample rate converter can be realized in software, but this may require the application of certain mathematical methods developed in the 19th century. Such methods, of course, have nothing in common with "Production quality", libsamplerate, and other resamplers of the sort. Such an exact converter can improve the quality of playback, but it cannot convert "digital crap" into "natural sound".
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby hiro » Fri Nov 19, 2010 1:28 pm

I hope you're just a troll...
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: cannot disable resampling for ICH6 (OSS4)

Postby igorzwx » Fri Nov 19, 2010 3:15 pm

hiro wrote:I hope you're just a troll...


If you do not believe me, you may read this:

Most soundcards on the market have acceptable quality DACs these days, compared to a few years ago when you had to spend premium dollars to get good DACs. It makes sense if you think of your CD player when thinking of the quality of DACs. Early cd players had a harsh sound to them and were often considered "brittle". As a result of that criticism, audio engineers found ways to make the DACs sound better, with oversampling, error correction, interpolation and other ways to "smooth" the output. http://www.tweakheadz.com/soundcards_fo ... studio.htm


An ordinary soundcard should be sufficient for your mp3, provided that your system is correctly configured, and proper software is installed. You do not need to buy an expensive soundcard for playing mp3s and FLACs.
igorzwx
Supporter
 
Posts: 987
Joined: Sun Jun 28, 2009 9:31 pm

Previous

Return to Linux

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 1 guest

cron