The officially official Devuan Forum!

You are not logged in.

#1 2024-07-08 21:34:34

igorzwx
Member
Registered: 2024-05-06
Posts: 103  

DXD waves and flacs (and dsf files) with OSS4 and ALSA

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

Last edited by igorzwx (2024-07-09 17:00:03)

Offline

#2 2024-07-09 08:34:16

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

Commentary Steven Segal on the article by Rushton Paul

I gave these a spin through my digital system, that can actually play them all in their original format and has a noise floor above 24-bit resolution (Innuos Pulsar into Holo May Level 2). The data is coming over fibre and goes through a reclocker and LAN isolator before the streamer.

I can't say I heard any difference other than the DSD level was lower than PCM.

Well, of course, with the help of a simple USB card from 2001, we will refute this!
This should be moved to the joke thread.

Offline

#3 2024-07-09 09:48:30

igorzwx
Member
Registered: 2024-05-06
Posts: 103  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

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.

Last edited by igorzwx (2024-07-09 11:23:26)

Offline

#4 2024-07-10 05:22:00

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

Let's get to the heart of the matter.

Here's a warning

All DSD-capable units can accept DSD 64, but not all can accept DSD 128 or higher. Please check which rates your DAC can handle before placing your purchase.

https://www.nativedsd.com/welcome/

Here is the DAC database
https://docs.google.com/spreadsheets/d/ … id=0#gid=0

Here's a playback for Linux
https://help.nativedsd.com/en/articles/ … s-on-linux

Everything else is wasted work and a waste of time.

But freedom comes first.
One character, who sculpts living images for the sake of the procedure itself, is (was) already on the forum, now with a mantra about pulseaudio..

Offline

#5 2024-07-10 07:51:37

igorzwx
Member
Registered: 2024-05-06
Posts: 103  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

Thank you for the information. Have you tried it?

Offline

#6 2024-07-10 11:08:01

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

Seriously speaking, I never even thought about it.
My audiophile preferences are a multi-bit DAC. A semi-homemade one, I don't remember which Marantz laser video player, with PCM56.

Offline

#7 2024-07-10 11:18:54

igorzwx
Member
Registered: 2024-05-06
Posts: 103  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

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.

Offline

#8 2024-07-10 11:39:00

aluma
Member
Registered: 2022-10-26
Posts: 646  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

An ordinary computer is not suitable as a playback source. I once compared the sound of a regular CD player and this device ABIT UA-11 (USB MP3 Theater 5.1). (Still lying on the shelf).
https://www.abit.com.tw/eng/product/mm/ua11.htm
Despite its 24-bit DAC and 100 dB signal-to-noise ratio, the sound was muddy.
Since then I have abandoned this matter.
Today I heard wonderful sound “out of the box” only from my son’s Mac, both desktop and laptop.

Last edited by aluma (2024-07-10 11:48:44)

Offline

#9 2024-07-10 14:45:56

igorzwx
Member
Registered: 2024-05-06
Posts: 103  

Re: DXD waves and flacs (and dsf files) with OSS4 and ALSA

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 

Last edited by igorzwx (2024-07-10 19:45:39)

Offline

Board footer