Native playback of DSD sound source on Linux desktop

Assumed reader

Those who are using desktop Linux and are interested in native playback of DSD.

What is DSD?

PCM and ΔΣ modulation have been put into practical use as modulation methods for converting analog sound to digital, but most of the digital sound sources in the world are PCM 1) and ΔΣ. The share of modulated sound sources will be less than 0.1%. The biggest reason why delta-sigma modulation is so minor is that it is difficult to reprocess the data digitized by delta-sigma modulation. The loudness of the data digitized by the delta-sigma modulation method cannot even be changed. Therefore, mixing work cannot be performed on the recording side 2), and it is annoying that only analog volume can be used on the playback side. DSD (Direct Stream Digital) is a name for a high-resolution audio system that records and plays back with ΔΣ modulation, which is a trademark of Sony and Philips. SACD, which was released in 1999 as an optical disk with higher sound quality than CD, is the first DSD product to come out. However, since the media for music distribution has moved from optical discs to online, it seems that DSD sound sources now often refer to files with extensions .dsf, .dsdiff, and .wsd that are distributed online. This article follows suit. Despite the inconvenience that DSD is difficult to change even the volume, it has received strong support from some enthusiastic recording engineers and audio enthusiasts due to its attractive sound, and although the number is small, new records are constantly being released It continues to be released.

note; 1): The delta-sigma modulation method is minor for sound source data distributed on the net and optical disks, but delta-sigma modulation is often used in the part that converts digital data to analog audio signals inside the DA converter chip. .. 2): Since it is not realistic to eliminate the mixing work when producing music data, at most DSD production sites, once convert the ΔΣ modulated data to PCM, analog, or pseudo ΔΣ format and perform the work. I have no choice but. Temporary PCM conversion during mixing seems to be considered a bad idea by DSD fundamentalists.

Is DSD a good sound?

In my experience, I've never felt that DSD sounds absolutely better than PCM at similar bitrates. However, I somehow feel the difference between the two modulation methods. Compared to PCM sound sources, it is often said that the sound of DSD has a feeling of being at the performance site. Even when SACD started to appear, everyone used words with a feeling of air. Until I hear the sound of DSD, what is the feeling of air? I thought, but when I asked it, it was "airy". (what's that) Everyone has no choice but to experience whether DSD is a good sound and what it feels like. I hope this article helps you.

What is DSD native playback?

"Native playback" is to transfer delta-sigma DSD data from a PC to a DA converter (hereinafter referred to as DAC) without converting it to PCM, and then convert it to analog sound data on the DAC side. To play DSD natively on Linux, the DAC, device driver, Linux kernel, and application software must all support it.

Playback device

In this article, we will assume that the reader owns a DAC that can play DSD and can produce sound with ALSA.

note; I won't go into detail in this article, but there is the question of whether the DAC is really playing DSD natively. This is because even DACs that claim to be able to play DSD actually have products that internally convert DSD data to PCM and then play the sound. Basically, even the volume of DSD data cannot be changed, so it is considered that a DAC whose volume can be adjusted digitally with respect to DSD does not play DSD natively. However, products that use ESS Technology's DAC chip can use digital volume while proclaiming DSD native playback. There seems to be no official announcement from ESS about why this can be done, but according to Net Bulletin Board Information, DSD 1,0,0,1,1,0, ... 2 The value data is changed to 6-bit data of 63,0,0,63,63,0, ... of the same frequency, and the volume of the sound is changed by increasing or decreasing the number of 6 bits. That is. I feel that this method can be said to be a kind of DSD native playback method. (There is also a speculation that it will be PCM such as 32-bit 352.8KHz after that)

Device driver

Most new USB DACs that support native DSD playback use an XMOS chip for the USB port, but in that case I think that native playback is usually possible. However, there seem to be exceptions, so please google if your DAC can play DSD on Linux. A DAC that says "only supports ASIO DoP on Windows" may not be able to play DSD natively with Linux device drivers. The method for checking whether the sound being played is DSD native playback will be described later. I don't know about HDMI-connected AV equipment, but it seems difficult to support.

kernel

Linux 4.1.10 and above kernels have DSD native playback capabilities. If you have a major distribution these days, you don't have to think about anything.

software

It will be described later. This article mainly explains how to use MPD. We have confirmed the operation on Debian 10, Ubuntu 18, Manjaro.

What is the native playback method for DSD on Linux?

How to use ordinary application software

Audicious, Banshee, Clementine, VLC, etc., which are often used for music playback on Linux, do not support native playback of DSD as of 2020. Audicious, DeadBeef, etc. have a function to play DSD sound source, but this is a function to convert DSD sound source to PCM and send data to DAC, and DAC receives PCM data and plays it. It is not native playback. Some paid software can play DSD natively. A high-quality audio player called HQPlayer costs 60,000 yen for consumers and 489,000 yen for studios, which is quite reasonable. JRiver Media Center is a little more popular software That's why it was 7200 yen on Amazon in Japan. Unfortunately, there is currently no free DSD native playback with a single application software.

How to use Windows music playback software

Since it is a music playback software that is highly evaluated in Windows Foobar2000 seems to run on Wine, you can also use it. Running Foobar2000 on VMware or Windows on Virtual Box instead of Wine consumes system resources, but it may be easier to set up. I will omit the specific method.

MPD; How to use Music Player Daemon

MPD is a server that plays various audio data. Since MPD does not have a user interface, it is necessary to combine application software called MPD client when playing music. Isn't this the best solution for native playback of DSD on Linux? However, the setting is a little troublesome. Also, it seems that recent Red Hat distributions do not have an official MPD package.

There are more than 60 types of MPD clients, but in this article we will use software called Cantata. cantata_playback.png

Extra edition Play with HF Player using a smartphone <Linux desktop related heyjan

Onkyo's HF Player music playback app for Android and iOS supports native playback of DSD. If you have a USB cable that connects your smartphone to the DAC, I think this is the easiest DSD native playback method.

Native playback of DSD with MPD

When the MPD package is installed, MPD will be started as a daemon by systemd when the PC is started. This is not bad, but it is easier to use if you can start and stop and change the settings with general user authority, so in this article I will explain as changing the setting to control MPD with login user authority. The procedure is as follows. --Installation of MPD, Cantata --Changed mpd not to be started by systemd when starting PC --Gathering information for configuration files --Rewriting the configuration file --Play audio data --Confirm that DSD native playback is performed

In the explanation of command typing, when "#" is attached before the command, it means to enter the command with root authority, and when "$" is attached, it means to enter the command with login user authority.

● Installation of MPD, Cantata

Debian,Ubuntu


# apt-get install mpd cantata

Arch,Manjaro


# pacman -S mpd cantata

MPD is placed in/usr/bin and installed with general user privileges so that it can be started and stopped.

● Changed mpd not to be started by systemd when starting PC

Immediately after installing MPD, MPD is running with root privileges, so once

python


# systemctl stop mpd

Stop MPD as such. Next, set so that MPD does not start at the next startup. In today's Linux, the service stop command at startup is

# systemctl disable mpd

is not it. If you are familiar with GUI or are using init.d method, please use your favorite method.

● Gathering information for configuration files

The hardware number or device name of the DAC for DSD native playback is required in the configuration file for running MPD. Try hitting the following command.

$ cat /proc/asound/cards

For example, an output like this is returned.

0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xc5740000 irq 131
1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xc4000000 irq 17
2 [HUDmx1         ]: USB-Audio - Audinst HUD-mx1
                      Audinst, Inc. Audinst HUD-mx1 at usb-0000:00:14.0-2, full speed
3 [G20            ]: USB-Audio - Gustard USB Audio 2.0
                      Gustard Gustard USB Audio 2.0 at usb-0000:00:14.0-1, high speed
4 [Audio          ]: USB-Audio - NFJ USB Audio
                      VIA Technologies Inc. NFJ USB Audio at usb-0000:00:14.0-6, full speed

The hardware number is the leftmost number, and the character string in [] is the device name. Please note that the hardware number can be changed by changing the USB port to be connected or changing the order in which the power is turned on if the DAC is connected via USB. I think you can identify the DAC from the vendor name.

● Rewriting the configuration file

When the logged-in user launches mpd, MPD goes to read the configuration file ~/.config/mpd/mpd.conf. Since the contents of mpd.conf differ slightly depending on the version of mpd, we will rewrite it based on the file attached to the installed MPD. The location of the base configuration file differs depending on the distribution, so prepare a template for mpd.conf with the following command.

For debian


$ mkdir ~/.config/mpd                 #Create directory for mpd config files
$ mkdir ~/.config/mpd/playlists       #Create directory for playlists
$ sudo cp /etc/mpd.conf ~/.config/mpd
$ sudo chown YOUR_USER_NAME ~/.config/mpd/mpd.conf

for ubuntu


$ mkdir ~/.config/mpd                 #Create directory for mpd config files
$ mkdir ~/.config/mpd/playlists       #Create directory for playlists
$ cd ~/.config/mpd
$ cp /usr/share/doc/mpd/mpdconf.example.gz ./
$ gzip -d mpdconf.example.gz
$ mv mpdconf.example mpd.conf

For manjaro


$ mkdir ~/.config/mpd                 #Create directory for mpd config files
$ mkdir ~/.config/mpd/playlists       #Create directory for playlists
$ cp /usr/share/doc/mpd/mpdconf.example ~/.config/mpd/mpd.conf

Next, open ~/.config/mpd/mpd.conf with an editor and rewrite the contents. At a minimum, there are three points that must be rewritten: (1) the specified directory and file, (2) the output device, and (3) the IP address of the output destination.

① Rewriting the specified directory and file

There are lines starting with music_directory and playlist_directory in the configuration file, so rewrite them as follows.

music_directory	"The directory where you put your music files"
playlist_directory       "~/.config/mpd/playlists"
xxxx_Since there is a line starting with file, rewrite it as follows.
db_file                 "~/.config/mpd/tag_cache"
log_file                        "~/.config/mpd/mpd.log"
pid_file                        "~/.config/mpd/pid"
state_file                      "~/.config/mpd/state"
sticker_file    "~/.config/mpd/sticker.sql"

② Rewriting the output device

Add the output device to the Audio Output section as follows:

# Audio Output ################################################################
audio_output {
  type    "alsa"           #This line is required
  name    "Gustard USB Audio 2.0"   #This line is a label so you can use any name you like
  device  "hw:G20,0"       #Specify the device name or hardware number of the DAC you checked earlier.
                           # "hw:Device name,0"Or"hw:Hardware number,0"Write.
 # device "hw:3,0"        #Example of specifying DAC by hardware number
  mixer_type   "none"    # mixer_type is"none" (Send without processing the volume)Ka
                         # "software" (Adjust volume with MPD client)Ka
                         # "hardware" (use alsa volume)Volume does not work during native DSD playback.
}

If you want to play multiple devices at the same time, you can write multiple audio_output {...} for each device you want to play. When you play a DSD sound source, native DSD data is sent to devices that support native playback, and data that is automatically converted to PCM is sent to devices that do not support it.

③ IP address of output destination

Rewrite the line bind_to_address.

When using the MPD client only on a PC running mpd


bind_to_address    "localhost"

sh:192 on a PC running mpd.168.0.10/Network 192, with 24 assigned.168.0.0/If you want to use the MPD client on other machines at 24


bind_to_address    "192.168.0.10"

When responding to MPD clients on any machine


bind_to_address    "any"

● Playback of audio data

Starting MPD

$ mpd

Just hit the command. The command to stop MPD is

$ mpd --kill  

is. If you want MPD to start all the time, add it to .profile or use the GUI to start it automatically, or whatever you like. After starting MPD, let's make a sound. Oops, I have to turn down the hardware volume of the amplifier to the minimum before that. Since the software volume of DSD does not work and 100% volume is output, there is DSD that the sound source of DSD is played at a huge volume after playing PCM music and the heart is about to pop out. Launch the previously installed Cantata. The operation of Cantata has no particular habit, and I think it can be used sensuously. It may be good as a regular music playback application including PCM sound source. cantata.png Select the "Folders" icon on the far left and click "Server Folders" on the left side of the pane (where the mouse cursor is located in the figure above) to open the directory specified by music_directory in mpd.conf. Select the file you want to hear from here and drag-drop it to the right of the pane and click the play button and the file should play. Increase the hardware volume. The sound was played, right? Congrats.

● Confirm that DSD native playback is performed

To check if you are playing natively, if the DAC has a function to display the format of the data being played, it is quick and reliable to see the display. If there is no function to display, try hitting the following command with the device name of the DAC you checked earlier as DEV_NAME.

DEV_NAME is the device name of the DAC you want to check


$ cat /proc/asound/DEV_NAME/pcm0p/sub0/hw_params

When nothing is playing

closed

When playing DSD data natively

access: RW_INTERLEAVED  
format: DSD_U32_BE     <-------With the word DSD=DSD native playback
subformat: STD  
channels: 2  
rate: 88200 (88200/1)  
...

When playing PCM data

access: RW_INTERLEAVED
format: S32_LE      <-------The word DSD is not attached. Four)
subformat: STD
channels: 2
rate: 96000 (96000/1)
...

Note 4); There is also a method called DoP; DSD over PCM for native playback of DSD. This is a method of embedding DSD data in the transfer format of PCM data and transferring it, and some DACs a little earlier accept DSD data only with this DoP. When transferring data with DoP, "DSD" is not added and it becomes format: S32_LE or format: S24_LE. I don't own a DAC that supports DoP, and I'm afraid I can't write any more about playing his DoP-only DAC.

Recommended Posts

Native playback of DSD sound source on Linux desktop
Use Github Desktop on Linux
Recording and playback on Linux
Use Chrome Remote Desktop on Linux
Basic usage of Btrfs on Arch Linux
[Linux] Review of commands for deploying on AWS
[2020July] Check the UDID of the iPad on Linux
Comfortable use of Magic Trackpad 2 on Ubuntu desktop