おなまえ
Eメール
タイトル
コメント
参照先
暗証キー (英数字で8文字以内)
画像認証 (右画像の数字を入力) 画像認証
Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/04/19(Sun) 21:24 home No.7378

手順書の作成方針

手順書は、「ファイルサーバの構築」、「MPDサーバの構築1」、「MPDサーバの構築2」、「運用方法」の順に書いていきます。
yoさん、ゴンザエモンさん、他の方達の多くにおいてはおそらくご存じのことを書いていきますが、
初心者の方もおられると思いますので、ご寛容ください。
また、yoさんのブログから頂いた情報も書いていますが、手順を書くに代え難いものですのでご容赦の程、お願いします。
また、他のブログ等からの情報も参考にしています。
引用先を明示はしませんが、先達の方達には感謝しております。

前提条件および、私の環境について

私のシステム構成は、ファイルサーバ、MPDサーバ、クライアントの3台です。
システムディスク、音楽データにはSSDを使用しています。
SSDを選択した理由は、速いこともありますが電気代が安いからです。
サーバの運用形態が24時間365日稼働ですので。
OSはDebian、ネットワークはnfsを使用しています。
プログラムの開発は行っておらず(但し、MPD、alsa関係のプログラムのコンパイルはしています)、全て既存のものを使用しています。
パソコンはインテルNCUを使用しています。
サーバのスペックとしては、インテル Core i3、メモリ8Gあれば十分だと思います。

「ファイルサーバの構築」

1.Debian Busterのインストール

 DebianのサイトからISOイメージをダウンロードし、USBメモリーに書き込み後、
 パソコンからDebianをインストールして下さい。
導入機能はSSHサーバのみ、ファイルシステムはXFSがいいと思います。

 インストール後、再起動して下さい

・パッケージアーカイブ先の設定
vi /etc/apt/sources.list
  以下の行をコメントアウトして下さい。
#deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 DVD Binary-1 20180714-10:25]/ stretch contrib main

 ・PATHの設定
  vi ~/.bashrc

  PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/ohsawa/bin:
  export PATH

source ~/.bashrc

 ・パッケージの更新および関係パッケージのインストール
apt-get update
apt-get upgrade
apt-get install net-tools ※ifconfigを使用するため
apt-get install aptitude
apt-get install samba  ※sambaを使用するのであれば(samba設定ファイルの例を最後に添付します)
apt-get install install nfs-kernel-server ※nfsを使用するのであれば必要
apt-get install irqbarance 割り込みのコア負荷分散
apt-get install rtirq-init オーディオ機器に関連するIRQストリームの優先度を上げるスクリプトが含まれています
インストール後、/ etc / default / rtirqファイル、つまり優先度を上げるIRQストリームの
リストを編集する必要がある場合があります。
RTIRQ_NAME_LIST="rtc snd usb i8042"

※不要なサービスを停止するためにsysv-rc-confをインストールされている方も多いと思いますが、停止設定をしてもサービスは停止しません。
   サービス停止は、直接停止のためのコマンドを実行する必要があります。
   (例) service cron stop

・リアルタイムカーネルのインストール

  aptitude search linux-image によりカーネルイメージを探し、インストール
  私は以下を選択しました。
  aptitude install linux-image-4.19.0-8-rt-amd64
aptitude install linux-image-rt-amd64

 ・現在のIPアドレスの確認

ifconfig -a

IPアドレスを確認後は、Tera Term等を使用したSSHによるWindowsからの作業となります。

・ネットワークの設定

vi /etc/network/interfaces
  ※環境に応じて、ネットワーク名、IPアドレスを書き換えてください。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug enp0s25
#iface enp0s25 inet dhcp
# This is an autoconfigured IPv6 interface
#iface enp0s25 inet6 auto
auto enp0s25
iface enp0s25 inet static
address 192.168.1.14
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

 ・GRUBの更新
  vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULの行を以下のように変更し保存
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs nowatchdog mitigations=off"
nowatchdog:watchdogの停止
mitigations=off:CPU の脆弱性の緩和策をオフにする

update-grub2

・rootによるログインを可能とする(任意)
  rootによるログインは好ましいものではありませんが、
  自宅で本人しか使用しないのであればいいと思います。

  vi /etc/ssh/sshd_config

  PermitRootLoginの行を探し
PermitRootLogin yes とします。

再起動します。
再起動後uname -a にてカーネル名が「linux-image-4.19.0-8-rt-amd64」
  になっているか確認して下さい。

  再起動後の作業は、Tera Term等を使用したSSHによるWindowsからのものとなります。

 ・RAIDの構築
  ※RAIDを使用しないのであれば必要ありません。
 [私の場合、SSD3台によるRAID0]

 (1)パーティションの確認
    fdisk -l 
 (2)パーティションの作成
  fdisk /dev/sda
  fdisk /dev/sdb
  fdisk /dev/sdc
※全てデフォルトでかまいません。
  (3)RAIDの作成
  aptitude install mdadm
  mdadm --create /dev/md0 --level=raid0 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1
  mdadm --detail --scan >> /etc/mdadm/mdadm.conf

  ※注意点
     実は、RTカーネルをインストールをしていないでRAID構築後、再起動すると、
     /dev/md0が存在せず、/dev/md127と言う名称に変わっています。
     この不具合は、RTカーネルをインストール後、/etc/mdadm/mdadm.confを削除し
     もう一度、mdadm --detail --scan >> /etc/mdadm/mdadm.conf を実行すると直ります。

・xfsファイルシステムの作成
mkfs.xfs /dev/md0

 ・マウントの設定
   [私の場合]
   
mkdir /music

vi /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=8e8e3d95-f4f9-4c56-96b2-beb83f7a16a4 / xfs noatime 0 0
# swap was on /dev/nvme0n1p5 during installation
UUID=4d19de4f-bea0-4992-a220-ee876a439215 none swap sw 0 0
#
tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
#tmpfs /var/log tmpfs defaults,noatime 0 0
#
/dev/md0 /music xfs rw,nosuid,dev,noexec,auto,nouser,async,nofail,noatime barrier=0 0 0

   vi /etc/exports(NFSを使用するのであれば)
[私の場合]

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
/music 192.168.1.0/24(rw,async,no_subtree_check)
#

   mount -a

chmod 777 /music

・細かい設定

 vi /etc/sysctl.d/99-sysctl.conf

 vm.swappiness = 10
 net.ipv4.tcp_no_metrics_save=1
  net.ipv6.conf.eno1.disable_ipv6 = 1

sysctl -えぃtぃtp

 ・sambaの設定ファイル

  vi /etc/samba/smb.conf

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.

#======================= Global Settings =======================

[global]
unix charset = UTF-8
dos charset = CP932
hosts allow = 192.168.1. 127.
security = user
map to guest = bad user
load printers = no
disable spoolss = yes
printing = bsd

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700


# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
#
[music]
path = /music
writable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴンザエモン 投稿日:2020/04/22(Wed) 08:24 home No.7392

ゴロキさん

音源SSDのストライピングをされている由。ふと、こんなことを思ったのですが、可能なのかな?

1.現状1台のSSDで運用しているが、容量が足りなくなりつつある。
2.容量を倍増させようと思うと高いし、今のSSDが余ってしまう。
3.(例えば)1TBくらいのSSDなら安いし当面の対応ともなるので、現状+追加の1台で全体容量を拡大して使う。

改めてシステム的にはRAID0を組んで、音源も流し込まねばいけないとは思いますが、、、


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/04/22(Wed) 19:41 home No.7395

ゴンザエモンさん、こんばんは

SSDの追加は可能です。
但し、現状と同じ容量のSSDを購入する必要があります。
RAIDは容量の少ない方に合わせて作成されるからです。
(これはRAID0だけではなく全てのRAIDに共通する仕様です。)
例えば、現状のSSDが2TBでも新たに購入したSSDが1TBだと
1TB+1TB=2TBとなってしまいます。
従って、RAID0を作成するのであれば現状と同じ容量のSSDを購入してください。

手順は以下のとおりです。

1.samba等を利用し現在の音楽データをハードディスク等にバックアップします。
2.2台のSSDでRAID0を構築します。
3.念の為、PCを再起動してRAIDが出来ているか確認してください。
4.バックアップから音楽データをRAID0のSSDにコピーします。


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/04/25(Sat) 18:11 home No.7400

yoさん、皆さん、こんばんは

MPDサーバの構築について、以下に書かせて頂きます。
ただ、考えてみるとMPDサーバの構築はファイルサーバの構築と
ほとんど同じですので、追加、変更箇所のみ書きますね。

「MPDサーバの構築手順」

・NFSを使用している場合

apt-get install nfs-common

vi /etc/sysctl.d/nfs_tuning.conf ※ファイルサーバ側でも行ってください。書き忘れていました。
net.core.wmem_max = 50331648
net.core.rmem_max = 50331648
net.ipv4.tcp_mem = "50331648 50331648 50331648"
net.ipv4.udp_mem= "50331648 50331648 50331648"
net.core.netdev_max_backlog = 5000

・/etc/fstabの編集

mkdir /music

vi /etc/fstab(私の環境)

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=ffc9e593-9387-42c5-8f96-8b0979282396 / xfs noatime 0 0
# swap was on /dev/nvme0n1p5 during installation
UUID=2109c492-4d39-4ce1-b477-b4acee059f22 none swap sw 0 0
#
192.168.1.14:/music /music nfs auto,rw,nosuid,dev,noexec,nouser,async,nofail,noatime,udp 0 0
#
tmpfs /dev/shm tmpfs defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime 0 0

・mpdとmpcのインストール
※参考までに、私の/etc/mpd.confの変更箇所を最後に付加しておきます。

aptitude install mpd
aptitude install mpc

・mpd、libmpdclient、alsa-lib、alsa-plugins、libsamplerate、libsndfile のコンパイル

apt-get install build-essential dpkg-dev autoconf automake libboost-dev libicu-dev

(1)mpd

cd /tmp
apt-get build-dep mpd
wget http://www.musicpd.org/download/mpd/0.21/mpd-0.21.23.tar.xz" target="_blank">http://www.musicpd.org/download/mpd/0.21/mpd-0.21.23.tar.xz
tar xvJf mpd-0.21.23.tar.xz
cd mpd-0.21.23
CFLAGS="-O2 -march=native" meson . output/release --buildtype=plain -Db_ndebug=true
meson configure output/release
ninja -C output/release
ninja -C output/release install

vi /etc/init.d/mpd 編集
daemon=/user/local/bin

vi /etc/default/mpd 編集
echo DAEMON=/usr/local/bin/mpd >>/etc/default/mpd

vi /usr/lib/systemd/user/mpd.service 編集
ExecStart=/usr/local/bin/mpd --no-daemon

ln -sf /etc/mpd.conf /usr/local/etc/mpd.conf

/etc/init.d/mpd/stop
/etc/init.d/mpd/start
mpd -V にて変更を確認

(2)libmpdclient

cd /tmp
apt-get build-dep libmpdclient
wget https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.18.tar.xz" target="_blank">https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.18.tar.xz
tar xvJf libmpdclient-2.18.tar.xz
cd libmpdclient-2.18
CFLAGS="-O2 -march=native" meson . output/release --buildtype=plain -Db_ndebug=true
meson configure output/release
ninja -C output/release
ninja -C output/release install

(3)alisa-lib

apt-get build-dep alsa-lib
wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.2.tar.bz2
bunzip2 -c alsa-lib-1.2.2.tar.bz2 | tar -xf -
cd alsa-lib-1.2.2
./configure CFLAGS="-O2 -march=native"
make
make install

(4)alsa-plugins

apt-get build-dep alsa-plugins
cd /tmp
wget ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-1.2.2.tar.bz2
bunzip2 -c alsa-plugins-1.2.2.tar.bz2 | tar -xf -
cd alsa-plugins-1.2.2
./configure CFLAGS="-O2 -march=native"
make
make install

(5)libsamplerate

cd /tmp
apt-get build-dep libsamplerate
wget http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz" target="_blank">http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz
tar -xvzf libsamplerate-0.1.9.tar.gz
cd libsamplerate-0.1.9
./configure CFLAGS="-O2 -march=native"
make
make install

(6)libsndfile

cd /tmp
apt-get build-dep libsndfile
wget http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz" target="_blank">http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz
tar -xvzf libsndfile-1.0.28.tar.gz
cd libsndfile-1.0.28
./configure CFLAGS="-O2 -march=native"
make
make install

・I/Oスケジューラの設定
SSDの場合 ※ファイルサーバでも必要なことなのですが、何故か最初からnone(デフォルトはmq-deadline)になっていました。
cat /sys/block/nvme0n1/queue/scheduler 使用できるI/Oスケジューラを確認
 none [mq-deadline]
vi /etc/udev/rules.d/60-ioschedulers.rules noneに変更
ACTION=="add|change", KERNEL=="nvme0n1", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"
cat /sys/block/nvme0n1/queue/scheduler
[none] mq-deadline


・細かいこと

vi /etc/asound.conf
defaults.pcm.rate_converter "samplerate_best"

aplay -l
vi /etc/sysctl.d/99-sysctl.conf
options snd-usb-audio index=1
options snd-usb-audio nrpacks=1

vi /etc/security/limits.conf
@audio - rtprio 99
@audio - nice -19
@audio - memlock unlimited

vi /etc/sysctl.d/99-sysctl.conf
vm.swappiness = 1
fs.inotify.max_user_watches = 524288
net.ipv4.tcp_no_metrics_save=1
net.ipv6.conf.eno1.disable_ipv6 = 1

・ /etc/mpd.conf(私の環境での変更箇所のみ記述)

log_level "default"

audio_output {
type "alsa"
name "My ALSA Device"
device "hw:1,0" # optional
mixer_type "disabled" # optional
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
dop "yes"
}

samplerate_converter "Best Sinc Interpolator"


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/04/26(Sun) 17:48 home No.7403

yoさん、皆さん、こんにちは

以下に、運用について書かせて頂きます。

「運用手順」
前提として、運用は24時間365日稼働です。

まず、ファイルサーバ、MPDサーバともオーディオ機能はBIOSにてOFFにしてください。

・ファイルサーバ

(1)topコマンドにてusb、ネットワークのデーモンを確認。
私の環境ではUSBは「irq/124-xhci_hc」です。
しかし、何故か再起動すると、 irq/124-xhci_hcが irq/123-xhci_hcや irq/125-xhci_hcに
変わることがあるので/etc/rc.localに書くことが出来ません。

私の環境ではネットワークは「irq/122-eno1」です。

(2)USBコントローラPCIコードを確認
lspci -nn
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21)

(3)以下のコマンドを実行
chrt -f -p 99 `pgrep irq/124-xhci_hc`
setpci -v -d *:* latency_timer=b0
setpci -v -d 8086:9d2f latency_timer=ff
chrt -f -p 99 `pgrep irq/122-eno1`

service cron stop
service rsyslog stop
service dbus stop
service exim4 stop

echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq

・mpdサーバ

(1)topコマンドにてusb、ネットワークのデーモンを確認。
私の環境ではUSBは「irq/124-xhci_hc」です。
しかし、何故か再起動すると、 irq/124-xhci_hcが irq/123-xhci_hcや irq/125-xhci_hcに
変わることがあるので/etc/rc.localに書くことが出来ません。

私の環境ではネットワークは「irq/122-eno1」です。

(2)USBコントローラPCIコードを確認
lspci -nn
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21)

(3)以下のコマンドを実行
chrt -f -p 99 `pgrep irq/124-xhci_hc`
setpci -v -d *:* latency_timer=b0
setpci -v -d 8086:9d2f latency_timer=ff
chrt -f -p 99 `pgrep irq/122-eno1`
chrt -f -p 99 `pgrep mpd`

service cron stop
service rsyslog stop
service dbus stop
service exim4 stop

echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq

私の現時点におけるの手順書は以上ですが、
これからも皆さんのお役に立てることが有ればコメントさせて頂きますね。


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/04/28(Tue) 18:42 home No.7410

yoさん、皆さん、こんばんは

MPDサーバ、ファイルサーバの設定を一部修正、追加しました。

・/etc/sysctl.d/nfs_tuning.confを削除し、/etc/sysctl.d/99-sysctl.confに統一

内容は以下の通り(MPDサーバ、ファイルサーバ共通です。そして、nfsのudpのみに
関係がある項目がありますが、TCPでは使われないだけで問題ありません)。
私の環境では、以下の設定が最も通信効率がいいようです。

vi /etc/sysctl.d/99-sysctl.conf

vm.swappiness = 10
fs.inotify.max_user_watches = 524288
net.ipv4.tcp_no_metrics_save=1
net.ipv6.conf.eno1.disable_ipv6 = 1

net.core.rmem_default=33554432
net.core.wmem_default=33554432
net.core.rmem_max=33554432
net.core.wmem_max=33554432
net.ipv4.tcp_rmem=33554432 33554432 33554432
net.ipv4.tcp_wmem=33554432 33554432 33554432

net.ipv4.udp_rmem_min=33554432
net.ipv4.udp_wmem_min=33554432
net.ipv4.udp_mem=33554432 33554432 33554432

net.core.netdev_max_backlog=5000
net.ipv4.conf.all.forwarding=1

sysctl -p にて反映

・/etc/mpd.confの一部変更

audio_output {
type "alsa"
name "My ALSA Device"
device "hw:1,0" # optional
mixer_type "disabled" # optional
  auto_resample "no" # 追加部分です(関係ないと思いますが、念の為)
  use_mmap "yes" #追加部分です
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
dop "yes"
}

・prelinkの導入
mpdサーバ、ファイルサーバの両方にインストールします。

aptitude install prelink
prelink -amR #サーバ立ち上げに実行
※パッケージ更新時には、再度、実行してください。

私の環境ではprelinkの音質向上は大きいものでした。

・ファイルサーバの運用の変更

setpciをUSBからEthernetに変更

lspci -nn

00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (4) I219-V [8086:15d8] (rev 21)

setpci -v -d *:* latency_timer=b0
#setpci -v -d 8086:9d2f latency_timer=ff #USBをコメントアウト
setpci -v -d 8086:15d8 latency_timer=ff #Ethernetを追加


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/05/02(Sat) 15:07 home No.7431

yoさん、皆さん、こんにちは

パソコン立ち上げ時のメッセージを確認したところ
intel関係のファームウェアロードエラーが出ていることがわかりました。
エラーが出ても動作に問題は無いようですが、
気持ちのいいものではないのでその解決法を書かせて頂きます。

vi /etc/apt/sources.list

以下を追加

# buster-updates, previously known as 'volatile'
deb http://ftp.jp.debian.org/debian/" target="_blank">http://ftp.jp.debian.org/debian/ buster-updates main contrib
deb-src http://ftp.jp.debian.org/debian/" target="_blank">http://ftp.jp.debian.org/debian/ buster-updates main contrib

deb http://ftp.jp.debian.org/debian" target="_blank">http://ftp.jp.debian.org/debian buster main non-free
deb-src http://ftp.jp.debian.org/debian" target="_blank">http://ftp.jp.debian.org/debian buster main non-free

aptitude update

aptitude upgrade

aptitude install firmware-linux-free

aptitude install firmware-linux-nonfree

上記作業において質問されますが、全てYesで大丈夫です。

作業終了後、再起動

dmesgにてエラーが無いことを確認。

以上です。


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/05/05(Tue) 09:55 home No.7450

yoさん、皆さん、おはようございます。

mpdサーバ側のfstabの変更

変更点は、rsizeとwsizeの追加ですが、この値については
これから最適値を探していきます。

vi /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=ffc9e593-9387-42c5-8f96-8b0979282396 / xfs noatime 0 0
# swap was on /dev/nvme0n1p5 during installation
UUID=2109c492-4d39-4ce1-b477-b4acee059f22 none swap sw 0 0
#
#192.168.1.14:/music /music nfs auto,rw,nosuid,dev,noexec,nouser,async,nofail,noatime,udp,rsize=65536,wsize=65536 0 0
192.168.1.14:/music /music nfs auto,rw,nosuid,dev,noexec,nouser,async,nofail,noatime,udp,rsize=1048576,wsize=1048576 0 0
#
tmpfs /dev/shm tmpfs defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime 0 0


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2020/05/05(Tue) 10:00 home No.7451

lsusbのコンパイルをしました。
音が変わったかは、はっきりとはわかりませんでした。

まず、一部、コンパイルのところに間違いがありましたので
修正させて頂きます。

誤 apt-get install build-essential dpkg-dev autoconf automake libboost-dev libicu-dev

正 apt-get install build-essential dpkg-dev autoconf automake libboost-dev libicu-dev meson

・lsusb のコンパイル(mpdサーバ、ファイルサーバ両方に実行)

cd /tmp

apt-get build-dep libusb

wget https://github.com//libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.tar.bz2" target="_blank">https://github.com//libusb/libusb/releases/download/v1.0.23/libusb-1.0.23.tar.bz2

bunzip2 -c libusb-1.0.23.tar.bz2 | tar -xf -

cd libusb-1.0.23

./configure CFLAGS="-O2 -march=native"

make

make install

再起動します。




Re: USB-DACによるPCオーディオ作成手順書 投稿者:goroki 投稿日:2021/04/07(Wed) 19:46 home No.8053

yoさん、皆さん、こんばんは。
gorokiです。
お久しぶりです。
私は、自身でファイルサーバを構築しているのですが、その設定により
かなり音質に影響が出るようです。
そこで、私の環境において、現時点では、まあ、いい感じではないかと思われる設定内容を公開させて頂きます。
内容の多くは、yoさん、はじめ、いろいろな方のサイトを参考にしています。
/etc/fstab
/etc/sysctl.conf
/etc/rc.local

OSはdebian bullseye リアルタイムカーネル、ファイルサーバはNFS、SSD,2TB 3枚によるRAID0を使用しています。
MPDサーバの設定もraid以外は同じですが、一応、書いておきます。
参考になりましたら幸いです。


■ファイルサーバー環境

※</etc/fstab>

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=8e8e3d95-f4f9-4c56-96b2-beb83f7a16a4 / xfs noatime,discard 0 0
# swap was on /dev/nvme0n1p5 during installation
UUID=4d19de4f-bea0-4992-a220-ee876a439215 none swap sw 0 0
#
tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
#tmpfs /var/log tmpfs defaults,noatime 0 0
#
/dev/md0 /music xfs rw,nosuid,dev,noexec,auto,nouser,async,nofail,noatime,discard 0 0


※</etc/sysctl.conf>

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/" target="_blank">http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
###################################################################
# Magic system request Key
# 0=disable, 1=enable all, >1 bitmask of sysrq functions
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html" target="_blank">https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
# for what other values do
#kernel.sysrq=438
vm.swappiness = 1
net.ipv4.tcp_no_metrics_save=1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn=2048
net.core.netdev_max_backlog=30000
net.core.rmem_default=253952
net.core.wmem_default=253952
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=253952 253952 16777216
net.ipv4.tcp_wmem=253952 253952 16777216
net.ipv4.tcp_mem=253952 253952 16777216
net.ipv4.tcp_max_syn_backlog=1024
net.ipv4.tcp_congestion_control = bbr
net.core.default_qdisc = fq
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_moderate_rcvbuf=0
net.ipv4.tcp_fack=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1
net.ipv4.tcp_low_latency=1
kernel.sched_rt_runtime_us = -1


※</etc/rc.local>

#!/bin/sh -e
sleep 2
chrt -f -p 99 `pgrep eno1`
chrt -f -p 99 `pgrep xhci_hc`
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
echo none > /sys/block/sda/queue/scheduler
echo none > /sys/block/sdb/queue/scheduler
echo none > /sys/block/sdc/queue/scheduler
echo 0 > /sys/block/sda/queue/rotational
echo 0 > /sys/block/sdb/queue/rotational
echo 0 > /sys/block/sdc/queue/rotational
echo 0 > /sys/block/md0/queue/rotational
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
sleep 2
prelink -amR
#
blockdev --setra 16384 /dev/nvme0n1p1
blockdev --setra 16384 /dev/sda
blockdev --setra 16384 /dev/sdb
blockdev --setra 16384 /dev/sdc
blockdev --setra 16384 /dev/md0
echo 16384 /sys/block/md0/queue/read_ahead_kb
echo 16384 /sys/block/nvme0n1/queue/read_ahead_kb
#
renice -n -20 -p `pgrep xhci_hc`
renice -n -20 -p `pgrep eno1`
ionice -c 1 -n 0 -p `pgrep xhci_hc`
#
exit 0

■MPDサーバ環境

※</etc/fstab>

#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=ffc9e593-9387-42c5-8f96-8b0979282396 / xfs noatime,discard 0 0
# swap was on /dev/nvme0n1p5 during installation
UUID=2109c492-4d39-4ce1-b477-b4acee059f22 none swap sw 0 0
#
192.168.1.12:/music /music nfs auto,rw,nosuid,dev,noexec,nouser,async,nofail,noatime,tcp,nfsvers=4 0 0
#
tmpfs /dev/shm tmpfs defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime 0 0


※</etc/sysctl.conf>

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/" target="_blank">http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
###################################################################
# Magic system request Key
# 0=disable, 1=enable all, >1 bitmask of sysrq functions
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html" target="_blank">https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
# for what other values do
#kernel.sysrq=438
#

vm.swappiness = 1
fs.inotify.max_user_watches = 524288
net.ipv4.tcp_no_metrics_save=1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn=2048
net.core.netdev_max_backlog=30000
net.core.rmem_default=253952
net.core.wmem_default=253952
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=253952 253952 16777216
net.ipv4.tcp_wmem=253952 253952 16777216
net.ipv4.tcp_mem=253952 253952 16777216
net.ipv4.tcp_max_syn_backlog=1024
net.ipv4.tcp_congestion_control = bbr
net.core.default_qdisc = fq
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_moderate_rcvbuf=0
net.ipv4.tcp_fack=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1
net.ipv4.tcp_low_latency=1


※</etc/rc.local>

#!/bin/sh -e
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
chrt -f -p 99 `pgrep eno1`
chrt -f -p 99 `pgrep xhci_hc`
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
sleep 2
chrt -f -p 99 `pgrep mpd`
sleep 2
prelink -amR
renice -n -20 -p `pgrep xhci_hc`
renice -n -20 -p `pgrep eno1`
renice -n -20 -p `pgrep mpd`
ionice -c 1 -n 0 -p `pgrep xhci_hc`
ionice -c 1 -n 0 -p `pgrep mpd`
blockdev --setra 16384 /dev/nvme0n1p1
echo 16384 /sys/block/nvme0n1/queue/read_ahead_kb
exit 0


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/04/12(Mon) 18:42 home No.8061

/etc/rc.localを変更しました。
I/O優先度変更は、スケジューラがcfq以外には効果が無いので削除しました。
また、MPDをリアルタイム化及び優先度を上げると高音がきつくなり
音が乱れたような感じになりますので止めました。

音楽再生サーバ

/etc/rc.local

#!/bin/sh -e
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
chrt -f -p 99 `pgrep irq/124-eno1`
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
sleep 2
prelink -amR
renice -n -20 -p `pgrep xhci_hc`
renice -n -20 -p `pgrep eno1`
exit 0

ファイルサーバ

/etc/rc.local

#!/bin/sh -e
sleep 2
chrt -f -p 99 `pgrep eno1`
chrt -f -p 99 `pgrep xhci_hc`
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
echo none > /sys/block/sda/queue/scheduler
echo none > /sys/block/sdb/queue/scheduler
echo none > /sys/block/sdc/queue/scheduler
echo 0 > /sys/block/sda/queue/rotational
echo 0 > /sys/block/sdb/queue/rotational
echo 0 > /sys/block/sdc/queue/rotational
echo 0 > /sys/block/md0/queue/rotational
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
sleep 2
prelink -amR
blockdev --setra 16384 /dev/sda
blockdev --setra 16384 /dev/sdb
blockdev --setra 16384 /dev/sdc
blockdev --setra 16384 /dev/md0
echo 16384 /sys/block/md0/queue/read_ahead_kb
renice -n -20 -p `pgrep xhci_hc`
renice -n -20 -p `pgrep eno1`
chrt -f -p 99 `pgrep nfsd`
renice -n -20 -p `pgrep nfsd`
exit 0


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/04/13(Tue) 14:02 home No.8064

私の環境下のmpd.confです。

/etc/mpd.conf

# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/" target="_blank">http://www.musicpd.org/doc/user/
# or /usr/share/doc/mpd/html/user.html


# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "/var/lib/mpd/music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory "/var/lib/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file "/var/lib/mpd/tag_cache"
#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, or to journal if mpd was started as
# a systemd service.
#
log_file "/var/log/mpd/mpd.log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file "/run/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
state_file "/var/lib/mpd/state"
#
# The location of the sticker database. This is a database which
# manages dynamic information attached to songs.
#
sticker_file "/var/lib/mpd/sticker.sql"
#
###############################################################################


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user "mpd"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group "nogroup"
###############################################################################
#

decoder {
plugin "hybrid_dsd"
enabled "no"
# gapless "no"
}

#
###############################################################################

# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
audio_output {
type "alsa"
name "My ALSA Device"
device "hw:1,0" # optional
mixer_type "disabled" # optional
auto_resample "no"
use_mmap "yes"
#
buffer_time "500000"
period_time "37500"
#
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
dop "yes"
#format "*:24:*"
}
#
# An example of an OSS output:
#
#audio_output {
# type "oss"
# name "My OSS Device"
# device "/dev/dsp" # optional
# mixer_type "hardware" # optional
# mixer_device "/dev/mixer" # optional
# mixer_control "PCM" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
# type "shout"
# encoder "vorbis" # optional
# name "My Shout Stream"
# host "localhost"
# port "8000"
# mount "/mpd.ogg"
# password "hackme"
# quality "5.0"
# bitrate "128"
# format "44100:16:1"
# protocol "icecast2" # optional
# user "source" # optional
# description "My Stream Description" # optional
# url "http://example.com"" target="_blank">http://example.com" # optional
# genre "jazz" # optional
# public "no" # optional
# timeout "2" # optional
# mixer_type "software" # optional
#}
#
# An example of a recorder output:


# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled "yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network. %h will be replaced with the hostname.
#
#zeroconf_name "Music Player @ %h"
#
###############################################################################


# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions "read,add,control,admin"
#
###############################################################################


# Database #######################################################################
#

#database {
# plugin "proxy"
# host "other.mpd.host"
# port "6600"
#}

# Input #######################################################################
#

input {
plugin "curl"
proxy "proxy.isp.com:8080"
proxy_user "user"
proxy_password "password"
}

# QOBUZ input plugin
input {
enabled "no"
plugin "qobuz"
# app_id "ID"
# app_secret "SECRET"
# username "USERNAME"
# password "PASSWORD"
# format_id "N"
}

# TIDAL input plugin
input {
enabled "no"
plugin "tidal"
# token "TOKEN"
# username "USERNAME"
# password "PASSWORD"
# audioquality "Q"
}

# Decoder #####################################################################
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Choose any if you want
# to have mpd listen on every address. Not effective if systemd socket
# activation is in use.
#
# For network
bind_to_address "any"
#
# And for Unix Socket
#bind_to_address "/run/mpd/socket"
bind_to_address "@mpd"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
port "6600"
#
# This setting controls the type of information which is logged. Available
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
log_level "default"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists "no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This example just enables the "comment" tag without disabling all
# the other supported tags:
#metadata_to_use "+comment"
#
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
#auto_update "yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself. There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################


# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks "yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
#follow_inside_symlinks "yes"
#
#
#audio_output {
# type "recorder"
# name "My recorder"
# encoder "vorbis" # optional, vorbis or lame
# path "/var/lib/mpd/recorder/mpd.ogg"
## quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
#audio_output {
# type "httpd"
# name "My HTTP Stream"
# encoder "vorbis" # optional, vorbis or lame
# port "8000"
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
# quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
# max_clients "0" # optional 0=no limit
#}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
# Please see README.Debian if you want mpd to play through the pulseaudio
# daemon started as part of your graphical desktop session!
#
#audio_output {
# type "pulse"
# name "My Pulse Output"
# server "remote_server" # optional
# sink "remote_server_sink" # optional
#}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
# type "winmm"
# name "My WinMM output"
# device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
# or
# device "0" # optional
# mixer_type "hardware" # optional
#}
#
# An example of an openal output.
#
#audio_output {
# type "openal"
# name "My OpenAL output"
# device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#}
#
## Example "pipe" output:
#
#audio_output {
# type "pipe"
# name "my pipe"
# command "aplay -f cd 2>/dev/null"
## Or if you're want to use AudioCompress
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
## Or to send raw PCM stream through PCM:
# command "nc example.org 8765"
# format "44100:16:2"
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
# type "null"
# name "My Null Output"
# mixer_type "none" # optional
#}
#
###############################################################################


# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
# chooses between "track" and "album" depending on the current state of
# random playback. If random playback is enabled then "track" mode is used.
# See <http://www.replaygain.org>" target="_blank">http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
#replaygain "album"
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp "0"
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp "0"
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit "yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has
# equal "loudness". This setting is disabled by default.
#
#volume_normalization "no"
#
###############################################################################

# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
#
samplerate_converter "Best Sinc Interpolator"
#samplerate_converter "soxr very high"
#
gapless_mp3_playback "yes"
buffer_before_play "100%"
audio_buffer_size "256"
###############################################################################
input_cache {
size "1 GB"
}






Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/06/30(Wed) 09:01 home No.8132

以下、多少の参考になれば幸いです。

※私のMPDサーバ、ファイルサーバの/etc/sysctl.confの内容です。

vm.swappiness = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
#
fs.inotify.max_user_watches = 524288
net.core.netdev_budget = 50000
net.core.netdev_budget_usecs = 5000
net.core.netdev_max_backlog = 65535
net.core.optmem_max = 25165824
net.core.rmem_default = 253952
net.core.rmem_max = 16777216
net.core.somaxconn = 65535
net.core.wmem_default = 253952
net.core.wmem_max = 16777216
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.default.log_martians = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_abort_on_overflow = 1
net.ipv4.tcp_ecn = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_fastopen = 1
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_low_latency = 0
net.ipv4.tcp_max_syn_backlog = 30000
net.ipv4.tcp_max_tw_buckets = 2000000
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_orphan_retries = 3
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 253952 253952 16777216
net.ipv4.tcp_wmem = 253952 253952 16777216
#
kernel.sched_rt_runtime_us = -1
#
kernel.sched_rt_period_us=500000
kernel.sched_wakeup_granularity_ns = 200000
kernel.sched_wakeup_granularity_ns = 200000

※私のmpdサーバの/etc/rc.localの内容です。

#!/bin/sh -e
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
chrt -f -p 99 `pgrep eno1`
chrt -f -p 99 `pgrep xhci_hc`
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
sleep 2
chrt -f -p 99 `pgrep mpd`
renice -n -19 -p `pgrep xhci_hc`
renice -n -19 -p `pgrep eno1`
renice -n -19 -p `pgrep mpd`
renice -n -19 -u mpd
#
exit 0

※私のファイルサーバの/etc/rc.localの内容です。

#!/bin/sh -e
setpci -v -d *:* latency_timer=b0
sleep 1
setpci -v -d 8086:15d8 latency_timer=ff
setpci -v -d 8086:9d2f latency_timer=ff
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
echo none > /sys/block/sda/queue/scheduler
echo none > /sys/block/sdb/queue/scheduler
echo none > /sys/block/sdc/queue/scheduler
echo 0 > /sys/block/sda/queue/rotational
echo 0 > /sys/block/sdb/queue/rotational
echo 0 > /sys/block/sdc/queue/rotational
echo 0 > /sys/block/md0/queue/rotational
ip route change default via 192.168.1.1 dev eno1 proto static initcwnd 10
#
sleep 2
chrt -f -p 99 `pgrep eno1`
chrt -f -p 99 `pgrep xhci_hc`
renice -n -19 -p `pgrep xhci_hc`
renice -n -19 -p `pgrep eno1`
#
exit 0


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/06/30(Wed) 09:05 home No.8133

※mpd関係のコンパイルの方法です。

cd /tmp

wget https://www.musicpd.org/download/mpd/0.22/mpd-0.22.9.tar.xz" target="_blank">https://www.musicpd.org/download/mpd/0.22/mpd-0.22.9.tar.xz

tar xf mpd-0.22.9.tar.xz

cd mpd-0.22.9

apt-get build-dep mpd

meson . output/release --buildtype=release -Db_ndebug=false

meson configure output/release

ninja -C output/release

/etc/init.d/mpd stop

ninja -C output/release install

cd /tmp

rm mpd-0.22.9.tar.xz

rm -r mpd-0.22.9

---------------------------------------------------------------------------------------------------------------------
cd /tmp

wget http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.19.tar.xz" target="_blank">http://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.19.tar.xz

tar xf libmpdclient-2.19.tar.xz

cd libmpdclient-2.19

apt-get build-dep libmpdclient

meson . output/release --buildtype=debugoptimized -Db_ndebug=true

meson configure output/release

ninja -C output/release

ninja -C output/release install

cd /tmp

rm libmpdclient-2.19.tar.xz

rm -r libmpdclient-2.19

---------------------------------------------------------------------------------------------------------------------


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/06/30(Wed) 09:07 home No.8134

※alsa関係のコンパイルの方法です。
----------------------------------------------------------------------------------------------
cd /tmp

wget ftp://ftp.alsa-project.org/pub/lib//alsa-lib-1.2.5.1.tar.bz2

tar jxf alsa-lib-1.2.5.1.tar.bz2

cd alsa-lib-1.2.5.1

apt-get build-dep alsa-lib

./configure CFLAGS="-O2 -march=native" CXXFLAGS="-O2 -march=native"

make

make install

cd /tmp

rm alsa-lib-1.2.5.1.tar.bz2

rm -r alsa-lib-1.2.5.1

---------------------------------------------------------------------------------------------------------------------
cd /tmp

wget ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-1.2.5.tar.bz2

tar jxf alsa-plugins-1.2.5.tar.bz2

cd alsa-plugins-1.2.5

apt-get build-dep alsa-plugins

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --sysconfdir=/etc

make

make install

cd /tmp

rm alsa-plugins-1.2.5.tar.bz2

rm -r alsa-plugins-1.2.5

---------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://downloads.xiph.org/releases/flac/flac-1.3.3.tar.xz" target="_blank">https://downloads.xiph.org/releases/flac/flac-1.3.3.tar.xz

wget http://www.linuxfromscratch.org/patches/blfs/svn/flac-1.3.3-security_fixes-1.patch" target="_blank">http://www.linuxfromscratch.org/patches/blfs/svn/flac-1.3.3-security_fixes-1.patch

tar Jxfv flac-1.3.3.tar.xz

cd flac-1.3.3

apt-get build-dep flac

patch -Np1 -i ../flac-1.3.3-security_fixes-1.patch

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --disable-thorough-tests --docdir=/usr/share/doc/flac-1.3.3

make

make install

cd /tmp

rm flac-1.3.3.tar.xz

rm -r flac-1.3.3

rm flac-1.3.3-security_fixes-1.patch

---------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2" target="_blank">https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2

tar jxf libsndfile-1.0.31.tar.bz2

cd libsndfile-1.0.31

apt-get build-dep libsndfile

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --disable-static --docdir=/usr/share/doc/libsndfile-1.0.31

make

make install

cd /tmp

rm libsndfile-1.0.31.tar.bz2

rm -r libsndfile-1.0.31

---------------------------------------------------------------------------------------------------------------------
cd /tmp

wget https://github.com/libsndfile/libsamplerate/releases/download/0.2.1/libsamplerate-0.2.1.tar.bz2" target="_blank">https://github.com/libsndfile/libsamplerate/releases/download/0.2.1/libsamplerate-0.2.1.tar.bz2

tar jxf libsamplerate-0.2.1.tar.bz2

cd libsamplerate-0.2.1

apt-get build-dep libsamplerate

./autogen.sh

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --disable-static --docdir=/usr/share/doc/libsamplerate-0.2.1

make

make install

cd /tmp

rm libsamplerate-0.2.1.tar.bz2

rm -r libsamplerate-0.2.1

---------------------------------------------------------------------------------------------------------------------
cd /tmp

wget https://download.gnome.org/sources/audiofile/0.3/audiofile-0.3.6.tar.xz" target="_blank">https://download.gnome.org/sources/audiofile/0.3/audiofile-0.3.6.tar.xz

tar Jxfv audiofile-0.3.6.tar.xz

cd audiofile-0.3.6

apt-get build-dep audiofile

CXXFLAGS="${CXXFLAGS:--O2 -march=native -flto -g} -std=c++98" \
./configure --disable-static

make

make install

cd /tmp

rm audiofile-0.3.6.tar.xz

rm -r audiofile-0.3.6

---------------------------------------------------------------------------------------------------------------------

cd /tmp

wget http://www.fftw.org/fftw-3.3.9.tar.gz" target="_blank">http://www.fftw.org/fftw-3.3.9.tar.gz

tar -zxvf fftw-3.3.9.tar.gz

cd fftw-3.3.9

apt-get build-dep fftw

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --enable-shared --disable-static --enable-threads --enable-sse2 --enable-avx

make

make install

make clean

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" -enable-shared --disable-static --enable-threads --enable-sse2 --enable-avx --enable-float

make

make install

make clean

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto" --enable-shared --disable-static --enable-threads --enable-long-double

make

make install

rm fftw-3.3.9.tar.gz

rm -r fftw-3.3.9


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/06/30(Wed) 09:10 home No.8135

※nfs-utils xfsprogs lsusb lsgusb irqbalanceなどのコンパイルの方法です。

cd /tmp

wget https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.tar.bz2" target="_blank">https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.tar.bz2

tar jxf libusb-1.0.24.tar.bz2

cd libusb-1.0.24

apt-get build-dep libusb

./configure CFLAGS="-O2 -flto -march=native" CXXFLAGS="-O2 -march=native -flto" --disable-static

make

make install

cd /tmp

rm libusb-1.0.24.tar.bz2

rm -r libusb-1.0.24

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://sourceforge.net/projects/nfs/files/nfs-utils/2.5.4/nfs-utils-2.5.4.tar.xz" target="_blank">https://sourceforge.net/projects/nfs/files/nfs-utils/2.5.4/nfs-utils-2.5.4.tar.xz

tar Jxfv nfs-utils-2.5.4.tar.xz

cd nfs-utils-2.5.4

apt-get build-dep nfs-utils

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto"

make

make install

cd /tmp

rm nfs-utils-2.5.4.tar.xz

rm -r nfs-utils-2.5.4

----------------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.xz" target="_blank">https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.xz

tar Jxfv mdadm-4.1.tar.xz

cd mdadm-4.1

apt-get build-dep mdadm

sed 's@-Werror@@' -i Makefile

make

make install

cd /tmp

rm mdadm-4.1.tar.xz

rm -r mdadm-4.1

----------------------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-5.12.0.tar.xz" target="_blank">https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-5.12.0.tar.xz

tar Jxfv xfsprogs-5.12.0.tar.xz

cd xfsprogs-5.12.0

apt-get build-dep xfsprogs

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto"

make DEBUG=-DNDEBUG

make install

cd /tmp

rm xfsprogs-5.12.0.tar.xz

rm -r xfsprogs-5.12.0

---------------------------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://people.freedesktop.org/~hughsient/releases/libgusb-0.3.7.tar.xz" target="_blank">https://people.freedesktop.org/~hughsient/releases/libgusb-0.3.7.tar.xz

tar Jxfv libgusb-0.3.7.tar.xz

cd libgusb-0.3.7

mkdir build

cd build

meson -Ddocs=false ..

ninja

ninja install

cd /tmp

rm libgusb-0.3.6.tar.xz

rm -r libgusb-0.3.6

--------------------------------------------------------------------------------------------------------------------------------------------------------

cd /tmp

wget https://github.com/Irqbalance/irqbalance/tarball/master/Irqbalance-irqbalance-v1.8.0-0-g99ae256.tar.gz" target="_blank">https://github.com/Irqbalance/irqbalance/tarball/master/Irqbalance-irqbalance-v1.8.0-0-g99ae256.tar.gz

tar -zxvf Irqbalance-irqbalance-v1.8.0-0-g99ae256.tar.gz

cd Irqbalance-irqbalance-bd5aaf5

apt-get build-dep irqbalance

./autogen.sh

./configure CFLAGS="-O2 -march=native -flto" CXXFLAGS="-O2 -march=native -flto"

make

make install

cd /tmp

rm Irqbalance-irqbalance-v1.8.0-0-g99ae256.tar.gz

rm -r Irqbalance-irqbalance-99ae256


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/06/30(Wed) 09:15 home No.8136

※私の/etc/mpd.confの内容です。

# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/" target="_blank">http://www.musicpd.org/doc/user/
# or /usr/share/doc/mpd/html/user.html


# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "/var/lib/mpd/music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory "/var/lib/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file "/var/lib/mpd/tag_cache"
#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, or to journal if mpd was started as
# a systemd service.
#
log_file "/var/log/mpd/mpd.log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file "/run/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
state_file "/var/lib/mpd/state"
#
# The location of the sticker database. This is a database which
# manages dynamic information attached to songs.
#
sticker_file "/var/lib/mpd/sticker.sql"
#
###############################################################################


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user "mpd"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group "nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Choose any if you want
# to have mpd listen on every address. Not effective if systemd socket
# activation is in use.
#
# For network
bind_to_address "any"
#
# And for Unix Socket
#bind_to_address "/run/mpd/socket"
#bind_to_address "@mpd"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
port "6600"
#
# This setting controls the type of information which is logged. Available
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
log_level "default"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists "no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This example just enables the "comment" tag without disabling all
# the other supported tags:
#metadata_to_use "+comment"
#
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
#auto_update "yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself. There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################


# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks "yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
#follow_inside_symlinks "yes"
#
###############################################################################


# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled "yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network. %h will be replaced with the hostname.
#
#zeroconf_name "Music Player @ %h"
#
###############################################################################


# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions "read,add,control,admin"
#
###############################################################################


# Database #######################################################################
#

#database {
# plugin "proxy"
# host "other.mpd.host"
# port "6600"
#}

# Input #######################################################################
#

input {
plugin "curl"
proxy "proxy.isp.com:8080"
proxy_user "user"
proxy_password "password"
}

# QOBUZ input plugin
input {
enabled "no"
plugin "qobuz"
# app_id "ID"
# app_secret "SECRET"
# username "USERNAME"
# password "PASSWORD"
# format_id "N"
}

# TIDAL input plugin
input {
enabled "no"
plugin "tidal"
# token "TOKEN"
# username "USERNAME"
# password "PASSWORD"
# audioquality "Q"
}

# Decoder #####################################################################
#

decoder {
plugin "hybrid_dsd"
enabled "no"
# gapless "no"
}

#
###############################################################################

# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
audio_output {
type "alsa"
# type "jack"
name "My ALSA Device"
device "hw:1,0" # optional
mixer_type "disabled" # optional
auto_resample "no"
use_mmap "yes"
#
buffer_time "500000"
period_time "37500"
#buffer_time "100000"
#period_time "2000"

#
# mixer_device "default" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
dop "yes"
#format "*:24:*"
}
#
# An example of an OSS output:
#
#audio_output {
# type "oss"
# name "My OSS Device"
# device "/dev/dsp" # optional
# mixer_type "hardware" # optional
# mixer_device "/dev/mixer" # optional
# mixer_control "PCM" # optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
# type "shout"
# encoder "vorbis" # optional
# name "My Shout Stream"
# host "localhost"
# port "8000"
# mount "/mpd.ogg"
# password "hackme"
# quality "5.0"
# bitrate "128"
# format "44100:16:1"
# protocol "icecast2" # optional
# user "source" # optional
# description "My Stream Description" # optional
# url "http://example.com"" target="_blank">http://example.com" # optional
# genre "jazz" # optional
# public "no" # optional
# timeout "2" # optional
# mixer_type "software" # optional
#}
#
# An example of a recorder output:
#
#audio_output {
# type "recorder"
# name "My recorder"
# encoder "vorbis" # optional, vorbis or lame
# path "/var/lib/mpd/recorder/mpd.ogg"
## quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
#audio_output {
# type "httpd"
# name "My HTTP Stream"
# encoder "vorbis" # optional, vorbis or lame
# port "8000"
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
# quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
# format "44100:16:1"
# max_clients "0" # optional 0=no limit
#}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
# Please see README.Debian if you want mpd to play through the pulseaudio
# daemon started as part of your graphical desktop session!
#
#audio_output {
# type "pulse"
# name "My Pulse Output"
# server "remote_server" # optional
# sink "remote_server_sink" # optional
#}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
# type "winmm"
# name "My WinMM output"
# device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
# or
# device "0" # optional
# mixer_type "hardware" # optional
#}
#
# An example of an openal output.
#
#audio_output {
# type "openal"
# name "My OpenAL output"
# device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#}
#
## Example "pipe" output:
#
#audio_output {
# type "pipe"
# name "my pipe"
# command "aplay -f cd 2>/dev/null"
## Or if you're want to use AudioCompress
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
## Or to send raw PCM stream through PCM:
# command "nc example.org 8765"
# format "44100:16:2"
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
# type "null"
# name "My Null Output"
# mixer_type "none" # optional
#}
#
###############################################################################


# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
# chooses between "track" and "album" depending on the current state of
# random playback. If random playback is enabled then "track" mode is used.
# See <http://www.replaygain.org>" target="_blank">http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
#replaygain "album"
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp "0"
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp "0"
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit "yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has
# equal "loudness". This setting is disabled by default.
#
#volume_normalization "no"
#
###############################################################################

# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
#
samplerate_converter "Best Sinc Interpolator"
#samplerate_converter "soxr very high"
#
gapless_mp3_playback "yes"
buffer_before_play "100%"
audio_buffer_size "32"
###############################################################################
input_cache {
size "1 GB"
}
#decoder {
#plugin "sndfile"
#enabled "no"
#}
#
#decoder {
#plugin "audiofile"
#enabled "no"
#}
#
#decoder {
#plugin "flac"
#enabled "no"
#}


Re: USB-DACによるPCオーディオ作成手順書 投稿者:ゴロキ 投稿日:2021/07/26(Mon) 18:12 home No.8143

音質については、ファイルサーバの出来によって大きく左右されます。再生システムが大切であることはもちろんですが、上流がしっかりしていることが重要だと思います。その意味において、可能であれば、NASではなく自力でファイルサーバを構築することをお勧めします。また、ネットワークも調整を進めるためにはNFSの方がCIFSより好ましいですね。私としては、部分最適化ではなく全体最適化の視点が重要だと思う次第です。



mail

- YY-BOARD -