How to enable "production quality with extra precision"?

OSS specific Linux discussion (x86/amd64)

Moderators: cesium, dev, kodachi, hannu

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Sat Sep 18, 2010 1:36 pm

hiro wrote:when I can either confirm or refute your claim I will tell :wink:


Perhaps, you failed to notice that I designed a clear-cut empirical test. It is easily reproducible with certain soundcards, such as:

Code: Select all
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 30)

00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

and any other soundcards of comparable quality.

It is now an objective scientific truth. You can safely believe that Petrov's resampler is exact in an absolute sense, for it is exact much more than enough for the purpose.

Thus, there are two things to discuss:
1. clear-cut empirical tests,
2. subjective perception of sound.

To summarize: the problem of sound quality in Linux is simply a problem of conversion from one audio format to another.

The solution is obvious: you should have a good converter and you should know how to disable PulseAudio and other unwanted resamplers which distort sound.

There are three practical solutions to this problem:
1. You can buy an expensive souncard which has a good converter inside. It should be a sundcard supported by OSS4, because OSS4 allows to disable unwanted resamplers (you have to study the list of supported soundcards before you buy anything).
2. You can use Petrov's exact converter.
2. You can make such converter yourself following the example of Sergey Petrov.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Sun Sep 19, 2010 5:11 pm

hiro wrote:Yeah, I did something compareable, I'm using libsamplerate for 44,1 to 48 kHz conversion and never had/heard any problems.


If I understood you correctly, you state that you are not able to perceive strong distortions produced by libsamplerate. Right?

However, if you look at Audacity spectrograms, you may easily notice a huge difference between the original file (44.1kHz) and the converted file (libsamplerate → 48kHz). The difference in high frequencies is dramatic.

This dramatic difference is clearly audible for flute recordings, such as Händel's Sonatas for Flute, if you are able to hear certain frequencies.


It seems that "Production quality" is also doing something wrong with high frequencies. They are, in a way, suppressed and distorted. This is clearly audible with the same Händel's Sonatas for Flute and the test file 10Hz + 20kHz.

If Cesium would recompile oss_grc3.c into a userland program, we could study spectrograms
viewtopic.php?f=3&t=3543&start=15#p14256

Why do we need a resampler which is exact in an absolute sense?
Because distortions are likely to be amplified by soundcards, and it is likely to be a kind of non-linear amplification.

It is actually obvious. If you have an ideal soundcard, it would play sound as is. If you have an ordinary soundcard, you would get something like this:

Resampler → (sound + distortions) → Soundcard → (sound + amplified distortions + new distortions)

In reality, it is likely to be a non-linear mix of distortions rather than a linear sum.
When aggregate distortions (amplified and new ones) achieve a critical level, there will be a qualitative change in perception of sound, and a person may not agree to tolerate a sound quality produced by Ubuntu Linux on his computer. The effect of Ubuntu, as a rule, depends on hardware. The removal of PulseAudio usually improves sound quality, simply because PulseAudio is a source of additional distortions (which tend to be amplified non-linearly).

If you have an ideal resampler, the result would be much better:

Exact resampler → (exact sound) → Soundcard → (exact sound + new distortions)

Soundcards are, in essence, non-linear things, they do have a kind of non-linear singularities which amplify distortions. Since soundcards are different in quality, it is possible to design "clear-cut empirical tests" for certain soundcards. If you have a better soundcard, distortions might not be so obvious, but they might be still audible for audiophiles.

It turned out that it is not always possible to disable resampling in OSS4. However, if an audio file is already converted to 48kHz sample rate with Petrov's exact converter, "Production quality" is not likely to produce audible distortions, and you may notice a significant improvement in sound quality. This might be, of course, very subjective, but I did notice an essential improvement in sound quality for Intel HDA ICH6. An unexpected reaction of women and children confirmed my subjective opinion, they were really charmed by the exact sound of Carlo Farina's Le Sonate.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Wed Sep 29, 2010 5:00 pm

Yes, that's true, I can hear 20kHz, but libsamplerate doesn't create any audible distortions for me. Perhaps I have to practice this a little more?

Well, I did practice and test some more and I learned something at least. I compared these 4 configurations:
- qmmp->jack->alsa->good external firewire soundcard
- mpg123->oss->spdif out from a cheap intel hd soundchip to good dac
- mpg123->alsa->the analog output of the roland sh-201 synthesizer
- last and least: mpg123->oss->intel hd analog audio output

The first two sounded exactly the same when I had their loudnesses balanced.
But that sh-201 sound stood out a lot in that comparison. Lack of dynamics in both sh-201's and intel hd's analog output and even distortions in the latter (probably my fault: but ossmix had to much options for me to bother).

Alsa is probably doing linear resampling again, this could also explain the big differences. I was careful to use the same sample rates though...

In contrast to these easily audible differences libsamplerate didn't create any differences.

For me the case is simple: For playing music I will use my firewire soundcard with jack in 44.1 kHz, so that quality's bottleneck is in the source. I guess I will have to create my own music in 24bit if I want more dynamics.

How high are your observed frequencies and how much over the noise floor did they really get?
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Wed Sep 29, 2010 8:57 pm

hiro wrote:Yes, that's true, I can hear 20kHz, but libsamplerate doesn't create any audible distortions for me. Perhaps I have to practice this a little more?

Well, I did practice and test some more and I learned something at least. I compared these 4 configurations:
- qmmp->jack->alsa->good external firewire soundcard
- mpg123->oss->spdif out from a cheap intel hd soundchip to good dac
- mpg123->alsa->the analog output of the roland sh-201 synthesizer
- last and least: mpg123->oss->intel hd analog audio output

The first two sounded exactly the same when I had their loudnesses balanced.
But that sh-201 sound stood out a lot in that comparison. Lack of dynamics in both sh-201's and intel hd's analog output and even distortions in the latter (probably my fault: but ossmix had to much options for me to bother).

Alsa is probably doing linear resampling again, this could also explain the big differences. I was careful to use the same sample rates though...

In contrast to these easily audible differences libsamplerate didn't create any differences.

For me the case is simple: For playing music I will use my firewire soundcard with jack in 44.1 kHz, so that quality's bottleneck is in the source. I guess I will have to create my own music in 24bit if I want more dynamics.

How high are your observed frequencies and how much over the noise floor did they really get?


Hi hiro!

I do not think that it is a good idea to mix everything together, for it may lead to a further confusion.

1. ALSA is incomprehensible. If a linear resampler is involved, it may play "bad clipping" with Risset Bell. However, if you hear "bad clipping" with ALSA, it might be caused by many other factors.

2. All your players do not seem to be reliable, they may distort sound themselves http://4front-tech.com/hannublog/?page_id=34
MPlayer, for example, has an own resampler inside (it is not so easy to disable it with ALSA). Other players may have a resampler as well.
There is a resampler inside "libav", which is said to be impossible to disable without "esoteric techniques".
Edit: Your players may also contain filters, equalizers, and other things, which may distort sound.

3. spdif is not exact http://en.wikipedia.org/wiki/S/PDIF

4. For testing sound quality, I use ossplay and Petrov's standalone player (pcm_play).

5. Different soundcards emphasize distortions in different way.

6. "Fast" resampler of OSS4 produces "bad clipping" with Risset Bell. It may also produce "noise" and anything else, and other OSS4 resamplers may also produce a kind of noise. Why not?

7. To understand something, we have to create special "laboratory conditions" by removing all unwanted sources of distortions and uncertainty.

Let us try a simple experiment.

1. You may take a lossless recording, something like Carlo Farina's Le Sonate, or Le Chant des Templiers (Ensemble Organum), or something else of the sort.

2. You may convert them with different resamplers (libsamplerate, Petrov's coverter, etc.), and play them with "ossplay -R" and/or ossplay with "Production quality" (44100 → 48000).

3. You may play them with ordinary Intel HDA soundcard (ensure that resampling is disabled, if necessary).

4. You may try to notice "nuances".

You see, the algorithms in questions are based on different principles, they are essentially different, especially in processing "nuances".

NOTE: Petrov's resampler can also convert 16bit → 32bit, it may make a difference for Intel HDA. It can also convert stereo → surround.
In any case, run "ossinfo -a -v9" first, it will tell you which formats are supported.

------------------
Edit: You should not forget, however, that the ancient algorithm of resampling (e.g. libsamplerate, "Production quality", etc.) involves a kind of filtering (sic!) The filter might be more or less exact, but, in any case, your sound is already filtered, sterilized, it is, in fact, a kind of ersatz sound. If you have an ideal soundcard, you may believe that sound is "natural", but it cannot be natural, by definition. Is it possible to produce "natural coffee" from acorns? If sound is already processed with libsamplerate, it can hardly by made natural by the most expensive soundcard.

The information theory is still valid, and it tells you something like this:

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. The reconstruction process that involves scaled and delayed sinc functions can be described as ideal. It cannot be realized in practice...


and so on and on; and also "low pass filter", but "in practice, a signal can never be perfectly bandlimited, since ideal "brick-wall" filters cannot be realized". Read more here: http://en.wikipedia.org/wiki/Nyquist%E2 ... iderations

If to translate all these into an ordinary human language, the ancient resampling algorithm is not suitable for resampling "lossless audio", simply because it transforms "lossless" into "lossy". It was a CD, or FLAC, and now you have a kind of ogg, or mp3, and you seem to be ready to believe that everything is O.K. If your soundcard has an internal HW resampler inside, it is likely to be of the same sort. And what about high frequencies? It depends on how that "low pass filter" was designed.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Sat Oct 02, 2010 1:44 am

igorzwx wrote:I do not think that it is a good idea to mix everything together, for it may lead to a further confusion.


Yeah, the complexity of the sound systems and our hearing makes it very difficult to decide where to start when you want to improve that sound system. Without a lot of experience or knowledge at least.
You have to make a lot of compromises and get no perfection.
I think my speakers for example aren't good enough to justify deeper tests at the moment. Also I seem to need quite some time to get used to a specific sound and only afterwards I can hear differences. I will have to train my ears some more before I go on...

1. ALSA is incomprehensible. If a linear resampler is involved, it may play "bad clipping" with Risset Bell. However, if you hear "bad clipping" with ALSA, it might be caused by many other factors.

Alsa is only usable with hw:0 I guess...
2. All your players do not seem to be reliable, they may distort sound themselves http://4front-tech.com/hannublog/?page_id=34

I don't have any dropouts... and if I understand correctly that's what they are talking about, right?
MPlayer, for example, has an own resampler inside (it is not so easy to disable it with ALSA). Other players may have a resampler as well.

mpg123 is simple and has no such problems, with qmmp I don't know for sure, but seeing it's cpu usage I think not.

There is a resampler inside "libav", which is said to be impossible to disable without "esoteric techniques".
Edit: Your players may also contain filters, equalizers, and other things, which may distort sound.
qmmp's equalizer was off. mpg123 doesn't have one.

Exact enough for me. I sync to a better clock anyway.
7. To understand something, we have to create special "laboratory conditions" by removing all unwanted sources of distortions and uncertainty.

If I had enough money I would try that, too :)
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Sat Oct 02, 2010 10:10 am

hiro wrote:
igorzwx wrote:I do not think that it is a good idea to mix everything together, for it may lead to a further confusion.


Yeah, the complexity of the sound systems and our hearing makes it very difficult to decide where to start when you want to improve that sound system. Without a lot of experience or knowledge at least.
You have to make a lot of compromises and get no perfection.
I think my speakers for example aren't good enough to justify deeper tests at the moment. Also I seem to need quite some time to get used to a specific sound and only afterwards I can hear differences. I will have to train my ears some more before I go on...

1. ALSA is incomprehensible. If a linear resampler is involved, it may play "bad clipping" with Risset Bell. However, if you hear "bad clipping" with ALSA, it might be caused by many other factors.

Alsa is only usable with hw:0 I guess...
2. All your players do not seem to be reliable, they may distort sound themselves http://4front-tech.com/hannublog/?page_id=34

I don't have any dropouts... and if I understand correctly that's what they are talking about, right?
MPlayer, for example, has an own resampler inside (it is not so easy to disable it with ALSA). Other players may have a resampler as well.

mpg123 is simple and has no such problems, with qmmp I don't know for sure, but seeing it's cpu usage I think not.

There is a resampler inside "libav", which is said to be impossible to disable without "esoteric techniques".
Edit: Your players may also contain filters, equalizers, and other things, which may distort sound.
qmmp's equalizer was off. mpg123 doesn't have one.

Exact enough for me. I sync to a better clock anyway.
7. To understand something, we have to create special "laboratory conditions" by removing all unwanted sources of distortions and uncertainty.

If I had enough money I would try that, too :)


I do not think that money may help in this particular case. On the contrary, the more money one has, the more exotic experiments he may design. To be able to make a correct physical experiment one may need a certain knowledge and discipline of thinking rather than expensive equipment. It is affordable in our day to reproduce certain exact experiments of Galileo and Newton, and this is what children can make in a school in Russia, in Africa, and elsewhere.

Let us forget for a while about ALSA and spdif. Let us take OSS4, ossplay and Petrov's converter. Have you tried it?
You can take it here:
viewtopic.php?f=3&t=3543&start=45#p15974
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Sat Oct 02, 2010 2:21 pm

Hey, I haven't tried the "exact resampler", because I don't know what it is. Also, not hearing any difference between the original and it's (libsamplerate) resampled version, I doubt my ears are of any value in this test (assuming the exact resampler would be of higher quality)...
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Sat Oct 02, 2010 2:48 pm

hiro wrote:Hey, I haven't tried the "exact resampler", because I don't know what it is. Also, not hearing any difference between the original and it's (libsamplerate) resampled version, I doubt my ears are of any value in this test (assuming the exact resampler would be of higher quality)...


O.K. You do not want to try Petrov's resampler for this or that reason. Perhaps, you do not need it.
What remains unclear is how you compare "the original and it's (libsamplerate) resampled version".
Which equipment is used to play "the original"?
And what is that original? What kind of music is it?

EDIT: The definition of "original" is missing, and the procedure of comparison is unclear.
How do you know what is the exact sound of the original?

The sort of music does matter. If it is a natural sound of natural instruments with natural ambience, it is one thing.

am·bi·ence /ˈambēəns/ Noun
1. The character and atmosphere of a place.
2. Background noise added to a musical recording to give the impression that it was recorded

am·bi·ence - Natural background audio representative of a given recording environment. On-camera dialog might be primary sound; traffic noise, sounds from wildlife and refrigerator hum would be ambient. http://www.videomaker.com/article/9276/

am·bi·ence - The mix of background noise and other reflected sounds that make up a room's acoustic character. More recently, a generic description of new age music. http://www.fpny.org/theater_glossary.htm

am·bi·ence - An element that is a recording of a real world environment, or an element that sets an atmospheric mood. http://designingsound.noisepages.com/20 ... stwave-fx/

am·bi·ence - Sounds such as reverberation, noise, and atmosphere that form a background to the main sound. Also called room tone, presence and atmos in Great Britain. http://www.ardenwoodsnd-dvd.com/glossar ... ary_a.html


The perception of "natural music" does depend on the quality of the "natural background noise".

If it is a kind of synthetic music with artificial "reverb", it might be another thing.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Sun Oct 03, 2010 10:38 pm

I tried pianos and strings, but also some electronic music. And I use 320kbit mp3s.
I did semi-random blind ab tests and counted my misses.
Having done all that, I'm quite satisfied and when I want to improve my system I will have to buy new speakers before anything else. Because I'm quite sure they are the weakest point. Although I've also learned that a good soundcard can make a great difference...

What version of audacity, libsamplerate are you using?
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Mon Oct 04, 2010 12:39 pm

hiro wrote:I tried pianos and strings, but also some electronic music. And I use 320kbit mp3s.
I did semi-random blind ab tests and counted my misses.
Having done all that, I'm quite satisfied and when I want to improve my system I will have to buy new speakers before anything else. Because I'm quite sure they are the weakest point. Although I've also learned that a good soundcard can make a great difference...


Do you mean that the "original" is a kind of lossy mp3 file?
In this case, our discussion about sound quality does not make much sense, especially, if those mp3s were encoded with LAME.

You may ask PulseAudio experts on Ubuntu forum which soundcards and speakers are suitable for such mp3s.

hiro wrote:What version of audacity, libsamplerate are you using?


Code: Select all
$ pacman -Qs audacity
local/audacity 1.3.12-3

libsamplerate-0.1.7 (c) 2002-2008 Erik de Castro Lopo
       libsndfile-1.0.21


You may try Audacity with Arch LiveCD
http://www.opensound.com/forum/viewtopic.php?f=3&t=3933
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Mon Oct 04, 2010 9:16 pm

Strange. If I remember correctly the last src version with any significant distortion was 0.1.2. See:
http://src.infinitewave.ca/images/Tone/SRC_BestSinc.png
I also use 0.17 and should thus hear exactly the same as you do. Can you show me your bad audacity results perhaps? I don't believe they can be *that* bad...

Or are you actually able to hear over 20kHz?

Give me a break, all my classical stuff is in flac.
And what gear are you using? 1000$ dac, 500$ headphone preamp,... ? (For some people this comes near perfection, for some it's better than perfection when I recall correctly;)
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Mon Oct 04, 2010 9:41 pm

hiro wrote:Strange. If I remember correctly the last src version with any significant distortion was 0.1.2. See:
http://src.infinitewave.ca/images/Tone/SRC_BestSinc.png
I also use 0.17 and should thus hear exactly the same as you do. Can you show me your bad audacity results perhaps? I don't believe they can be *that* bad...

Or are you actually able to hear over 20kHz?

Give me a break, all my classical stuff is in flac.
And what gear are you using? 1000$ dac, 500$ headphone preamp,... ? (For some people this comes near perfection, for some it's better than perfection when I recall correctly;)


It seems that we have a nice discussion. Everyone is speaking with himself.
As far as I know, the Russian kids do not use such mp3s for any sort of music.
There are also Linux users who are perfectly happy with PulseAudio and lossy formats.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby hiro » Tue Oct 05, 2010 12:06 am

Well, all my russian friends like my mp3s. Although some don't, in which case they created them 8)

I like sharing what I've heard, (it seems to fit into my theoretical understanding of the subject, but I'd still like to verify it).

So, what about my question and my request of a screenshot?
I'd really like to understand why you hear distortions with libsamplerate. (Because I don't follow your reasoning)
hiro
Member
 
Posts: 28
Joined: Tue Sep 14, 2010 6:38 pm

Re: How to enable "production quality with extra precision"?

Postby igorzwx » Tue Oct 05, 2010 10:02 am

hiro wrote:Well, all my russian friends like my mp3s. Although some don't, in which case they created them 8)

I like sharing what I've heard, (it seems to fit into my theoretical understanding of the subject, but I'd still like to verify it).

So, what about my question and my request of a screenshot?
I'd really like to understand why you hear distortions with libsamplerate. (Because I don't follow your reasoning)


Yes. Agreement cannot be achieved through the help of reasoning, screenshots and mathematical formulae, if something else is missing. The history of economic science proves this point (see Arjo Klamer, Conversations with Economists). There are many schools of economic thought which cannot reach agreement. Many attempts had been made to solve this problem. Eventually, consensus was achieved with something like this: "We have agreement that we have no agreement". This seems to be a "universal solution" for any discussion of the sort.
igorzwx
Known Member
 
Posts: 1000
Joined: Sun Jun 28, 2009 9:31 pm

Re: How to enable "production quality with extra precision"?

Postby trew » Tue Oct 05, 2010 1:36 pm

What is this "Sergey Petrov experimental SRC" thing I keep seeing?

I'm sensing placebo effect, not sure...
trew
New Member
 
Posts: 6
Joined: Thu Jun 28, 2007 9:52 am

PreviousNext

Return to Linux

Who is online

Users browsing this forum: Bing [Bot] and 1 guest