The officially official Devuan Forum!

You are not logged in.

#426 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-15 18:13:14

I can play them with MPlayer (Devuan) on Intel HDA (see my previous post).

#427 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-15 17:55:39

You can download free samples here:
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

You can play them with MPlayer

sudo apt install mplayer
$ mplayer "08-Faust - Funeral March Of A Marionette - 32bit.wav"
MPlayer UNKNOWN-12 (C) 2000-2023 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 08-Faust - Funeral March Of A Marionette - 32bit.wav.
libavformat version 59.27.100 (external)
libavformat file format detected.
[wav @ 0x7fab12c87d00]Discarding ID3 tags because more suitable tags were found.
[lavf] stream 0: audio (pcm_f32le), -aid 0
[lavf] stream 1: video (png), -vid 0, Picture
VIDEO:  [MPNG]  607x603  0bpp  90000.000 fps    0.0 kbps ( 0.0 kbyte/s)
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 59.37.100 (external)
[png @ 0x7fab121fdd20]Requested frame threading with a custom get_buffer2() implementation which is not marked as thread safe. This is not supported anymore, make your callback thread-safe.
Selected video codec: [ffpng] vfm: ffmpeg (FFmpeg PNG)
==========================================================================
Clip info:
 artist: Alexander Gibson -RPHO
 date: 2024-01-15
 album: Gounod - Bizet - Alexander Gibson Royal Opera House Orchestra
 encoder: Merging Technologies Album Publishing
 title: Faust - Funeral March Of A Marionette
 track: 8/9
Load subtitles in ./
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 352800 Hz, 2 ch, floatle, 22579.2 kbit/100.00% (ratio: 2822400->2822400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [oss] 192000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.01:1 - prescaling to correct movie aspect.
[swscaler @ 0x7fab12e13f20]bicubic scaler, from rgba to yuv420p using MMXEXT
VO: [vdpau] 608x604 => 609x604 Planar YV12 
Movie-Aspect is 1.01:1 - prescaling to correct movie aspect.
VO: [vdpau] 608x604 => 609x604 Planar YV12 
No pts value from demuxer to use for frame!
pts after filters MISSING
A:   0.0 V:-9223372036854775808.0 A-V:  0.000 ct:  0.000   0/  0 ??% ??% ??,?% 0 0 0.54x 
Possibly bad interleaving detected.
Use -ni option if this causes playback issues and avoid or fix the program that created the file.
A:   3.0 V:-9223372036854775808.0 A-V:  0.000 ct:19449.693   0/  0  0%  0%  0.0% 0 0 0.54x 

Exiting... (Quit)

It does play DXDs (with downsampling and format conversion):

==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 352800 Hz, 2 ch, floatle, 22579.2 kbit/100.00% (ratio: 2822400->2822400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [oss] 192000Hz 2ch s16le (2 bytes per sample)
Starting playback...

#428 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-15 17:45:13

OK, let us put it as simple as possible.

Can your DAC play 32bit float audio files (which it should not play)?

Have you tried?

#429 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-15 09:31:02

If everything has already been clarified, then, perhaps, you may answer my question.
May I ask it again?

My hypothesis is that the Playback Designs MPD-8 DAC is playing 32bit float DXDs (which it should not play), because a sound system, or a player "performs the necessary format conversions in software".

Would you agree that it might be the case?

CONNECTING THE MPD-8 TO A WINDOWS BASED PC or APPLE MAC
Supported resolutions: PCM: all sample rates up to 384kHz and word lengths up to 24 bits.
DSD: native up to 11.2MHz and DoP up to 5.6MHz
Connection protocol and method: USB 2.0 / Audio class 2.0 compliant, asynchronous mode where MPD-
8 generates high precision clock master and computer is clock slaved.
PC requirements: Windows 7 or later, ASIO compatible player software such as JRiver
etc.
Mac requirements: OS X (10.6.6 or later)
If your computer is a Mac running OSX 10.6.6 or later you don’t need any driver software as OSX already supports all PCM formats up to 384kHz sample rate.
_http://playbackdesigns.com/docs/manuals/PlaybackDesigns_MPD-8_Manual1v1.pdf

$ mediainfo "08-Faust - Funeral March Of A Marionette - 32bit.wav" | grep Audio -A11
Audio
Format                                   : PCM
Format profile                           : Float
Codec ID                                 : 3
Codec ID/Hint                            : IEEE 
Duration                                 : 4 min 35 s
Bit rate mode                            : Constant
Bit rate                                 : 22.6 Mb/s
Channel(s)                               : 2 channels
Sampling rate                            : 352.8 kHz
Bit depth                                : 32 bits
Stream size                              : 743 MiB (100%)

I've written here and there about my preference for listening to 32-bit PCM versus 24-bit PCM files (either 352.8kHz or 384kHz)...
But wait, you say... The Playback Designs MPD-8 accepts only 24-bit input files, so how can this be?
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

If he is using MAC, DXD waves and flacs are likely to be downsampled to 48kHz (default) . OSX resamplers can do the work.

If "OSX already supports all PCM formats up to 384kHz sample rate", it does not mean that the OSX driver for MPD-8 DAC supports 384kHz sample rate. It may simply mean that OSX resamplers support 384kHz sample rate.
In this case, Foobar2000 may fail to play DXDs in "exclusive mode".

_https://support.apple.com/en-gb/108326
Play high sample rate audio on your Mac
The hardware digital-to-analogue converter (DAC) built into compatible Mac computers supports sample rates of up to 96 kHz.

The result of downsampling depends on the quality of the resampler and resolution of the original file.
If the original DXD wave is 32bit Float, downsampling to 48kHz (or 96kHz) may produce a better sound quality.
That is why, perhaps, Rushton Paul claims that 32bit DXDs are better than 24bit DXDs.

Would you agree with this?

#430 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-14 13:17:14

aluma wrote:

I use audigy2, 24 bit, 195 kHz

Perhaps, it is Audigy2, 24 bit, 192 kHz.

aluma wrote:

There are many possibilities, for example, by recording a pure sinusodal signal from a generator with a frequency of 1 kHz and measuring the distortion when it is played back in different versions of the system, we can objectively evaluate the comparison of alsa vs pipeware vs pulseaudio. Or various resamplers.

It seems that your experiments can be simplified and made more exact.
All sorts of sinusoidal signals can be easily created with Audacity (with mathematical exactitude).

sudo apt install audacity 

Audacity → Generate → Tone → select frequency and amplitude

You can also change resolution:

Audacity → Edit → Preferences → Quality → "Default Sample Rate" and "Default Sample Format"

Then you may try to measure the distortions in playback. It might be very interesting.

But you may better start a new topic for this.

#431 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-13 22:06:22

Yes, it was not a scientific experiment, and it was not intended.
The fft resampler was tested several years. Then it was replaced with dct in an OSS4 plugin.
One user noticed the difference and began to complain about the sound quality and some unwanted effects, such as "fatigue".

#432 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-13 16:33:10

Yes, a blind test might be very useful, but the problem is that you may not know what you are actually testing.

If, for example. a sound system performs resampling and format conversions in software, you may not know what you are actually playing with your DAC, or soundcard. That is why, perhaps, some users want to know how to enable "exclusive mode".

steve_v wrote:

Trivial differences in resampling are irrelevant, and unless you are doing digital mastering, so are bit depths >16 and sampling rates significantly above the Nyquist limit. Fight me.

Although the difference between Petrov's dct and fft seems insignificant, I would strongly recommend to use fft instead of dct (default). The reason is the results of an unintended blind test with OSS4 users.

#433 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-13 15:06:52

Again, my hypothesis is that the Playback Designs MPD-8 DAC is playing 32bit float DXDs (which it should not play), because a sound system, or a player "performs the necessary format conversions in software".

Would you agree that it might be the case?

#434 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-13 14:15:27

aluma wrote:

Can you honestly say why you are raising these questions?

I asked the question about the Playback Designs MPD-8 DAC, because you seems to be an expert on DACs.

The Playback Designs MPD-8 accepts only 24-bit input files, so how can this be?
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

Instead of answering the question, you are trying to sell me a very old theory that people do not need high resolution audio, because they cannot hear the difference.

I've talked with the Playback Design's Andreas Koch about this and he has a theory but no firm answer.
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

It seems that you also have theories but no firm answer.

Perhaps, you may try to help us to find out how it can be that the Playback Designs MPD-8 DAC is playing 32bit float DXDs, which it should not play.

With OSS4, one may suspect the COOKEDMODE:

$ cat /usr/lib/oss/conf/osscore.conf | grep sampling -A9
# By default OSS will let applications use sampling rates and formats that
# are not supported by the hardware. Instead OSS performs the necessary
# format conversions in software. Applications that don't tolerate these
# kind of conversions usually disable them by using features of the OSS API
# (SNDCTL_DSP_COOKEDMODE). If this option is set to 0 then the format
# conversions will be disabled for all applications and devices unless the
# application explicitly enables them. This option should not be changed
# without wery strong reason.
# 
#cooked_enable=1 

What do you think about such hypothesis?

#435 Re: Freedom Hacks » A scientific test for resamplers. » 2024-07-13 08:05:17

Yes, it is very interesting.

But we still have a question to answer:

But wait, you say... The Playback Designs MPD-8 accepts only 24-bit input files, so how can this be?
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

The DXD wave is 32bit Float. What do you think about this?

#436 Freedom Hacks » A scientific test for resamplers. » 2024-07-11 21:03:53

igorzwx
Replies: 23

If you cannot hear the difference between Petrov's dct and fft resamplers, you may try to measure it with exact scientific instruments.

The method is very simple:
1. downsample a DXD wave,
2. upsample the result to DXD format,
3. measure the difference with the original DXD wave,
4. compare the results of measurement for different resamplers.

Perhaps, you noticed that Petrov's pcm-utils package provides a sort of toolbox:
   - pcm_info: information of the data format in 'wav' file
   - pcm_conv: standalone PCM converter
   - pcm_mse:  computing of the Mean Squared Error (MSE) between two 'wav' files in PCM format

Free DXD samples are available here:
What We Hear With DXD 32-bit Files (Free Sample Downloads)
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

[FFT] Downsampling:

$ pcm_conv -f 192000 -b 32 -T fft -v *32bit.wav Faust_192kHz_32bit_downfft.wav
Input file : 08-Faust - Funeral March Of A Marionette - 32bit.wav
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Output file: Faust_192kHz_32bit_downfft.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (37632 => 20480)
Delay   : 107 ms
Sync.   : ON
Trans.  : "FFT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.906667 sec
Processing time: 13.305000 sec ( 4.82% of real time) 

[FFT] Upsampling:

$ pcm_conv -f 352800 -b 32f -T fft -v *downfft.wav Faust_DXD_32bit_downupfft.wav
Input file : Faust_192kHz_32bit_downfft.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

Output file: Faust_DXD_32bit_downupfft.wav
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (20480 => 37632)
Delay   : 107 ms
Sync.   : ON
Trans.  : "FFT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.786667 sec
Processing time: 12.539000 sec ( 4.55% of real time) 

[FFT] Measuring the difference:

$ pcm_mse *32bit.wav *upfft.wav -b 10 -e 10000000000
Opening file '08-Faust - Funeral March Of A Marionette - 32bit.wav' ... Ok.
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Opening file 'Faust_DXD_32bit_downupfft.wav' ... Ok.
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Processing format:
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 64 (actual: 64, float)

File '08-Faust - Funeral March Of A Marionette - 32bit.wav' is longer than 'Faust_DXD_32bit_downupfft.wav'

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

Fragment form 10 to 97259904 (97259894 samples)

Front Left:
~~~~~~~~~~~
 Dynamic range: from -0.92281 to 0.792051
 MSE = 0.0001395137
 SNR = 38.5538 dB
 First diff.: 0.000288079 on position 10 (0 in fragment)
 Max diff.  : 0.00377898 on position 81946564 (81946554 in fragment)
 Number of different samples: 97259747 ( 100.0% )

Front Right:
~~~~~~~~~~~~
 Dynamic range: from -0.984298 to 1.04113
 MSE = 0.0001161680
 SNR = 39.3491 dB
 First diff.: 0.000536871 on position 10 (0 in fragment)
 Max diff.  : 0.0408844 on position 66347702 (66347692 in fragment)
 Number of different samples: 97259754 ( 100.0% ) 

[DCT] Downsampling:

$ pcm_conv -f 192000 -b 32 -T dct -v *32bit.wav Faust_192kHz_32bit_downdct.wav
Input file : 08-Faust - Funeral March Of A Marionette - 32bit.wav
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Output file: Faust_192kHz_32bit_downdct.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (37632 => 20480)
Delay   : 53 ms
Sync.   : ON
Trans.  : "DCT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.906667 sec
Processing time: 7.655000 sec ( 2.77% of real time) 

[DCT] Upsampling:

$ pcm_conv -f 352800 -b 32f -T dct -v *downdct.wav Faust_DXD_32bit_downupdct.wav
Input file : Faust_192kHz_32bit_downdct.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

Output file: Faust_DXD_32bit_downupdct.wav
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (20480 => 37632)
Delay   : 53 ms
Sync.   : ON
Trans.  : "DCT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.840000 sec
Processing time: 7.881000 sec ( 2.86% of real time) 

[DCT] Measuring the difference:

$ pcm_mse *32bit.wav *updct.wav -b 10 -e 10000000000
Opening file '08-Faust - Funeral March Of A Marionette - 32bit.wav' ... Ok.
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Opening file 'Faust_DXD_32bit_downupdct.wav' ... Ok.
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Processing format:
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 64 (actual: 64, float)

File '08-Faust - Funeral March Of A Marionette - 32bit.wav' is longer than 'Faust_DXD_32bit_downupdct.wav'

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

Fragment form 10 to 97297536 (97297526 samples)

Front Left:
~~~~~~~~~~~
 Dynamic range: from -0.92281 to 0.792051
 MSE = 0.0001395591
 SNR = 38.5524 dB
 First diff.: 0.000289127 on position 10 (0 in fragment)
 Max diff.  : 0.0037787 on position 81946564 (81946554 in fragment)
 Number of different samples: 97297377 ( 100.0% )

Front Right:
~~~~~~~~~~~~
 Dynamic range: from -0.984298 to 1.04113
 MSE = 0.0001162062
 SNR = 39.3477 dB
 First diff.: 0.000540629 on position 10 (0 in fragment)
 Max diff.  : 0.0409828 on position 66347702 (66347692 in fragment)
 Number of different samples: 97297363 ( 100.0% ) 

Results of measurement:

[FFT] Front Left:    MSE = 0.0001395137
[DCT] Front Left:    MSE = 0.0001395591

[FFT] Front Right:   MSE = 0.0001161680
[DCT] Front Right:   MSE = 0.0001162062

MSE is the Mean Squared Error 

[FFT downsampling] Processing time: 13.305000 sec ( 4.82% of real time)
[DCT downsampling] Processing time: 7.655000 sec ( 2.77% of real time) 

You can see that DCT is faster than FFT (13.305/7.655 ≈ 1.738).
FFT is more exact, although the difference is insignificant.
Petrov claimed that the difference is not audible, but it was detected by an OSS4/Gentoo user in a "blind test".

If you are using ALSA, you may not hear the difference between 192kHz/32bit and 48kHz/16bit formats of the same audio file (if the DXD wave was downsampled with the FFT resampler).

You may also try to measure the Secret Rabbit Code of ALSA (libsamplerate)
_https://libsndfile.github.io/libsamplerate/
_https://github.com/libsndfile/libsamplerate

sudo apt install sndfile-programs 
man sndfile-convert 

#437 Re: Freedom Hacks » DXD waves and flacs (and dsf files) with OSS4 and ALSA » 2024-07-10 14:45:56

aluma wrote:

An ordinary computer is not suitable as a playback source.

I can agree with this. The same is for recording. A sort of portable HiRes audio recorders, such as Olympus or Zoom, might be a much more reasonable solution.

But, it we take this for granted, then, perhaps, Petrov's fftrate ALSA plugin with Audacious (without pulseaudio or pipewire) might be a practical solutions for notebooks.

aluma wrote:

Today I heard wonderful sound “out of the box” only from my son’s Mac, both desktop and laptop.

This is exactly the case. Kids are perfectly happy with Mac. Then they want to have the same sound quality with Fedora on a cheap notebook. It seems that fftrate plugin and apulse fixed the problem.

Notice, however, that MacOS sound system does not support 192kHz sample rate. But you can downsample DXD waves to 96kHz with Petrov's pcm_conv. Then you can play them with foobar2000. It can be installed with Homebrew
_https://formulae.brew.sh/cask/foobar2000#default

Foobar2000 "exclusive mode" is now supported for MAC. It may work, if the audio device supports the bit rate and sample rate of your audio file. There might be other problems as well
_https://forum.rme-audio.de/viewtopic.php?id=37063

_https://support.apple.com/en-gb/108326
Play high sample rate audio on your Mac
The hardware digital-to-analogue converter (DAC) built into compatible Mac computers supports sample rates of up to 96 kHz.
Compatible Mac computers feature a high-quality, built-in hardware DAC that can convert up to 96 kHz digital audio to analogue audio. You can connect analogue devices such as headphones or speakers directly to the headphone jack on your Mac and monitor your audio at full resolution without needing an external DAC.
To set the sample rate for the headphone jack, use the Audio Midi Setup app, which is located in the Utilities folder of your Applications folder.
_https://support.apple.com/en-gb/guide/audio-midi-setup/ams59f301fda/mac

ArchWiki wrote:

By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed, that you will have a loss in audio quality. This is most noticeable in down sampling (ie. 96000hz → 48000hz). There is an article about this issue in Stereophile which was discussed on Apple's CoreAudio API mailing list if you wish to learn more about this issue.
_https://wiki.archlinux.org/title/Open_Sound_System#Changing_the_sample_rate
_https://www.stereophile.com/news/121707lucky/
_https://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html

This was a quote from ArchWiki manual on OSS4. All this does not apply to Petrov's fftrate resampler. Regardless of your usage patterns, you can safely configure fftrate for the highest sample rate supported by your sound card. Some users even claimed that Petrov's fftrate resampler somehow improves sound quality of audio files. I cannot dismiss their claims, because one of them detected the difference between Petrov's dct and fft resamplers in a "blind test" (he noticed the difference and began to complain). However, you have to dismiss such claims, if you know what the Gibbs phenomenon is. The problem is knowledge, of course. It always restricts our freedom of thinking.

In a word, you can easily switch between resamplers in /etc/fftrate.conf

$ cat /etc/fftrate.conf | grep Transform -A3
# Transform type
# Available: dct, fft (default: dct)
#transform = dct
transform = fft 

#438 Re: Freedom Hacks » DXD waves and flacs (and dsf files) with OSS4 and ALSA » 2024-07-10 11:18:54

The problem seems be that ALSA does not permit "exclusive mode", and, therefore, it may not make much sense to use a very expensive DAC with ALSA.

#440 Re: Freedom Hacks » DXD waves and flacs (and dsf files) with OSS4 and ALSA » 2024-07-09 09:48:30

Perhaps, you are missing the point. iMic USB sound card, or a similar one, can be used for video conferencing or playing videos in youtube, if fftrate plugin and apulse are installed, and PulseAudio and PipeWire are removed. This might be a practical solution for notebooks.
Intel HDA codecs (32bit 192kHz) can be used with OSS4 for playing HiRes audio files in "exclusive mode". Although, of course, Intel HDA codecs can also be used with ALSA, if you cannot compile OSS4.

However, if you suffer from hearing loss caused by PulseAudio, you may need an amplifier.

If you want to explain us how to play DXD and DSF audio files on Devuan with the highest possible sound quality, you may start a new topic.

#441 Freedom Hacks » DXD waves and flacs (and dsf files) with OSS4 and ALSA » 2024-07-08 21:34:34

igorzwx
Replies: 8

Free DXD samples are available here:
What We Hear With DXD 32-bit Files (Free Sample Downloads)
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

If you do not know how to play DXD waves and flacs (and dsf files) on Devuan, it may mean, perhaps, that your freedom is somehow restricted by your knowledge. They can be easily played with Audacious through the help of the fftrate resampler.

The DXD samples were provided as a sort of "material artefacts" for a theological discussion about 32bit format:

if PCM processing has been applied in post, or if the recording is originally a PCM recording (viz. DXD), my experience has been that the 32-bit version simply sounds better than the either the 24-bit file or the PCM processed DSD256 file. It's a half-step closer to the sound I love from a Pure DSD256 recording.

At least on my primary system, with my DAC (a Playback Designs MPD-8).

But wait, you say... The Playback Designs MPD-8 accepts only 24-bit input files, so how can this be?

I don't know the answer. I've talked with the Playback Design's Andreas Koch about this and he has a theory but no firm answer.
_https://positive-feedback.com/reviews/music-reviews/what-we-hear-with-dxd-32-bit-files/

See also: "What Is 32-Bit Float Audio, and Should You Record In It?"
_https://www.wired.com/story/32-bit-float-audio-explained/

Since Intel HDA codecs support 32bit format, you can play 32bit audio files with OSS4 or ALSA, without thinking "how can this be?" Although, of course, Intel HDA codecs do not support "32bit Float" audio format.

1. DXD and vinyl

If you know what the Gibbs phenomenon is, you may think that analogue recordings might be better than digital ones.

A phonograph record (also known as a gramophone record, especially in British English), a vinyl record (for later varieties only), or simply a record or vinyl is an analog sound storage medium in the form of a flat disc with an inscribed, modulated spiral groove.
_https://en.wikipedia.org/wiki/Phonograph_record

However, when sample rate 🡪 infinity, digital recordings may eventually converge to analogue ones.
The goal of the "never-ending quest for the ultimate sound quality" seems to be a sort of extreme freedom.

2. Digital eXtreme Definition (DXD) with OSS4

There is a Petrov's fftrate plugin for Audacious, but it works only with a very old version of Audacious. Therefore, if you want to play DXD waves (or dsf files) with OSS4 in "exclusive mode", you may better convert them to an audio format, which is supported by your sound card.

For example, Intel HDA codecs support 32bit 192kHz format:

$ ossinfo -v9 | grep "Output formats" -A8
    Output formats (0x00001010):
      AFMT_S16_LE	- 16 bit signed little endian
      AFMT_S32_LE	- 32 bit signed little endian
    Device handle: PCIa0021458-0000:00:1b.0-au01
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 8
    Native sample rates (min - max): 44100 - 192000 (44100,48000,96000,192000) 

DXD waves can be converted to 192kHz 32bit format with Petrov's pcm_conv. Notice that the original DXD wave is 32bit float:

$ pcm_conv -f 192000 -b 32 -T fft -v "08-Faust - Funeral March Of A Marionette - 32bit.wav" output_Faust_192kHz_32bit.wav
Input file : 08-Faust - Funeral March Of A Marionette - 32bit.wav
 Samples rate    = 352800 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Output file: output_Faust_192kHz_32bit.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (37632 => 20480)
Delay   : 107 ms
Sync.   : ON
Trans.  : "FFT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.906667 sec
Processing time: 14.542000 sec ( 5.27% of real time) 

Now you can play it with OSS4 in "exclusive mode":

ossplay -R -d0 -s192000 -c2 -fS32_LE output_Faust_192kHz_32bit.wav 

You can also play 192kHz waves with Audacious in "exclusive mode", if OSS4 plugin is enabled.

dsf files can be easily converted to waves with Audacious:
File → Settings → Audio
(1) set "Bit depth" to "Floating point"
(2) "Output plugin": "FileWriter Plugin" (then "Settings")
(3) "FileWriter Plugin Settings" - Output file format: WAV
Now, you can simply "play" a dsf file with Audacious, and it will be converted to a wave.
Notice, however, that the wave might be very big:

$ mediainfo '08-Faust - Funeral March Of A Marionette - DSD256.dsf.wav'
General
Complete name                            : 08-Faust - Funeral March Of A Marionette - DSD256.dsf-1.wav
Format                                   : Wave
Format settings                          : PcmWaveformat
File size                                : 2.90 GiB
Duration                                 : 4 min 35 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 90.3 Mb/s

Audio
Format                                   : PCM
Format profile                           : Float
Codec ID                                 : 3
Codec ID/Hint                            : IEEE 
Duration                                 : 4 min 35 s
Bit rate mode                            : Constant
Bit rate                                 : 90.3 Mb/s
Channel(s)                               : 2 channels
Sampling rate                            : 1 411 kHz
Bit depth                                : 32 bits
Stream size                              : 2.90 GiB (100%) 

It can be converted to 32bit 192kHz with pcm_conv:

$ pcm_conv -f 192000 -b 32 -T fft -v *DSD256.dsf.wav output_Faust_192kHz_32bit.dsf.wav
Input file : 08-Faust - Funeral March Of A Marionette - DSD256.dsf.wav
 Samples rate    = 1411200 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, float)

Output file: output_Faust_192kHz_32bit.dsf.wav
 Samples rate    = 192000 Hz
 Channels        = 2
 Bits per sample = 32 (actual: 32, fixed)

        FL      FR      
FL      1.000   -----   
FR      -----   1.000   

Windows : "Vorbis" (150528 => 20480)
Delay   : 107 ms
Sync.   : ON
Trans.  : "FFT"

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.0 %
Ok.

File duration  : 275.906667 sec
Processing time: 61.711000 sec (22.37% of real time) 

Now, it can be played in "exclusive mode":

ossplay -R -d0 -s192000 -c2 -fS32_LE output_Faust_192kHz_32bit.dsf.wav 

3. DXD and dsf with ALSA

DXD waves and flacs (as well as dsf files) can be easily played with Audacious, if Petrov's fftrate ALSA plugin is installed (and configured).

It is also possible to output a sort of "debug" to terminal or a text file. This is how it looks with iMic USB sound card (16bit 48kHz):

$ audacious 2>&1 *.dsf
Input:  1411200 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 56448
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  1411200 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok. 
$ audacious 2>&1 *32bit.wav
Input:  352800 Hz, 2 ch, 's32_le' (0xa): dummy = 0, period = 14112
Output: 48000 Hz, 2 ch, 's16_le' (0x2): dummy = 0, period = 1920
Rates:  352800 --> 48000 (J: 0.00%, T: FFT, W: Vorbis)
Ok. 

You may also try FLAC (encoding and decoding) with "32bit fixed" audio format.

FLAC 1.4.0 released
09 Sep 2022
This release brings many small improvements and a few large ones. Here are the most important for end-users:
FLAC can now encode and decode 32 bit-per-sample audio. This means the FLAC format is now one step closer to being fully implemented. Note that this is 32 bit integer samples, not 32 bit float samples.
_https://xiph.org/flac/2022/09/09/flac-1-4-0-released.html

#443 Re: Off-topic » How World Leaders are Scrambling to Secure Food in the Shadows » 2024-07-01 15:48:25

It might be a sin to obfuscate the Teaching.

Our life is shaped by our mind; we become what we think.
The Dhammapada - Full Audiobook with Text (AudioEbook)
_https://youtu.be/TcGfY4WSgVA

#445 Re: Off-topic » How World Leaders are Scrambling to Secure Food in the Shadows » 2024-07-01 14:11:16

The problems of "vital resources" and of "reproduction" are real problems. Another problem is how to separate facts from myths.

You might be surprised, but facts are myths, and nothing more. This scientific discovery was made by Roland Barthes.
If you think that it is a joke, you might be mistaken. The secret knowledge in encoded in British textbooks:

Barthes claims that is at the level of secondary signification or connotation that myth is produced and consumed... According to Barthes,

"what allows the reader to consume myth innocently is that he does not see it as a semiological system but as an inductive one. Where there is only equivalence, he sees a kind of causal process: the signifier and the signified  have, in his eyes, a natural relationship. This confusion can be expressed otherwise: any semiological system is a system of values; now the myth-consumer takes the signification for a system of facts: myth is read as a factual system, whereas it is but a semiological system."
Jonh Storey, And Introductory Guide to Cultural Theory and Popular Culture, Edinburgh University Press, 1993.

To summarize, facts are myths, and myths are a sort of knowledge. The consumer of facts is a slave of knowledge.

#446 Re: Off-topic » Thoughts on Pipewire » 2024-06-30 20:32:55

Yes, it is very interesting.

#447 Re: Off-topic » Thoughts on Pipewire » 2024-06-30 19:50:54

Sorry to interrupt the voting procedure.

rolfie wrote:

Didn't get audio to work with pure ALSA.

This seems to be the problem.

There is a belief that problems can be solved by voting. If it does not work, we may try something else.

#448 Re: Off-topic » Thoughts on Pipewire » 2024-06-30 14:12:04

Most important, it is easy to remove. Just another crap produced by the same sort of people.

I was asked to fix sound quality on Fedora without removing PipeWire.
Sound quality was so bad that it was impossible to use Discord.
First of all, I installed fftrate plugin and configured it for 32bit 192kHz.
The user was already satisfied with sound quality.
Then, I installed apulse and explained how to use it. This produced a sort of happiness.

#449 Re: Off-topic » Statistics is a very exact science » 2024-06-30 10:44:37

Can you hear ordinary music recordings without amplification?
If you feel that you really need an amplifier, you may better visit a doctor. Otherwise, very soon, you may need a much more powerful amplifier.

#450 Re: Off-topic » Statistics is a very exact science » 2024-06-30 09:33:48

Your sound card can reproduce the sound, because it has a very powerful amplifier (as you proudly declared before).
I may agree that such sound cards might be very helpful for semi-deaf PulseAudio users.

Board footer

Forum Software