Ubuntu 16.04 LTSにてオーディオデバイス番号の固定化

メモ。[Ubuntu] オーディオデバイス番号を固定化するを参照。
Music Player Deamon (MPD) で楽曲を再生しようとしたらオーディオデバイス番号が変わって音が出ないことがありますよね。で、上記記事を参照して、自分の環境でオーディオデバイスの名前を調べてみます。例えばこうだったとします。

1
2
3
4
$ cat /proc/asound/modules
 0 snd_ice1724
 1 snd_hda_intel
 2 snd_hda_intel

0番のice1724はONKYO SE-90PCI R2です。これを2番に固定します。上記参照記事では全てのオーディオデバイスに番号を振りなおしていますが、横着してSE-90PCIだけ固定しておきます。参照記事のように下記ファイルを作成/編集します。

1
$ sudo vi /etc/modprobe.d/sound.conf

その内容ですが、横着してSE-90PCI(ice1724)だけ記述します。 下記のように全て記述します。

1
2
3
options snd_hda_intel index=0
options snd_hda_intel index=1
options snd_ice1724 index=2

これでUbuntuを再起動します。オーディオデバイス番号を確認すると、

1
2
3
4
$ cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_hda_intel
 2 snd_ice1724

となります。ちなみに、

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ aplay -l
**** ハードウェアデバイス PLAYBACK のリスト ****
カード 0: PCH [HDA Intel PCH], デバイス 0: ALC887-VD Analog [ALC887-VD Analog]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 0: PCH [HDA Intel PCH], デバイス 1: ALC887-VD Digital [ALC887-VD Digital]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 3: HDMI 0 [HDMI 0]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 7: HDMI 1 [HDMI 1]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 2: SE90PCI [ONKYO SE90PCI], デバイス 0: ICE1724 [ICE1724]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 2: SE90PCI [ONKYO SE90PCI], デバイス 1: ICE1724 IEC958 [ICE1724 IEC958]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0

となってます。
[amazonjs asin=”B00DIIXZA8″ locale=”JP” title=”ONKYO SE-90PCI R2 WAVIO PCIデジタルオーディオボード ハイレゾ音源対応”]

Ubuntu 16.04 LTSでCreative Sound Blaster Audigy Rx

Creative Sound Blaster Audigy Rx、うん。Ubuntu 16.04 LTSの「サウンド設定」では以下の図のようにSB0400 Audigy 2として認識されています。
screenshot-from-2016-10-10-22-32-00
で、ライン出力するのにフロントライン出力にステレオミニプラグを挿すのですが、「サウンドの出力先」にアナログ出力を選択しても音が出ません(アンプ無し、アンプとも)。それでどういう訳かデジタル出力(S/PDIF)を選択するとフロントライン出力から音が出ます。
screenshot-from-2016-10-10-22-38-04
Rhythmboxで楽曲を再生させて、出てくる音自体は良いのですが。
さて、Music Player Daemon (MPD) から音を出したいのですが、そもそもこんな感じです。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$ aplay -l
**** ハードウェアデバイス PLAYBACK のリスト ****
カード 0: PCH [HDA Intel PCH], デバイス 0: ALC887-VD Analog [ALC887-VD Analog]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 0: PCH [HDA Intel PCH], デバイス 1: ALC887-VD Digital [ALC887-VD Digital]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 3: HDMI 0 [HDMI 0]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 7: HDMI 1 [HDMI 1]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 2: Audigy2 [SB Audigy 5/Rx [SB1550]], デバイス 0: emu10k1 [ADC Capture/Standard PCM Playback]
  サブデバイス: 32/32
  サブデバイス #0: subdevice #0
  サブデバイス #1: subdevice #1
  サブデバイス #2: subdevice #2
  サブデバイス #3: subdevice #3
  サブデバイス #4: subdevice #4
  サブデバイス #5: subdevice #5
  サブデバイス #6: subdevice #6
  サブデバイス #7: subdevice #7
  サブデバイス #8: subdevice #8
  サブデバイス #9: subdevice #9
  サブデバイス #10: subdevice #10
  サブデバイス #11: subdevice #11
  サブデバイス #12: subdevice #12
  サブデバイス #13: subdevice #13
  サブデバイス #14: subdevice #14
  サブデバイス #15: subdevice #15
  サブデバイス #16: subdevice #16
  サブデバイス #17: subdevice #17
  サブデバイス #18: subdevice #18
  サブデバイス #19: subdevice #19
  サブデバイス #20: subdevice #20
  サブデバイス #21: subdevice #21
  サブデバイス #22: subdevice #22
  サブデバイス #23: subdevice #23
  サブデバイス #24: subdevice #24
  サブデバイス #25: subdevice #25
  サブデバイス #26: subdevice #26
  サブデバイス #27: subdevice #27
  サブデバイス #28: subdevice #28
  サブデバイス #29: subdevice #29
  サブデバイス #30: subdevice #30
  サブデバイス #31: subdevice #31
カード 2: Audigy2 [SB Audigy 5/Rx [SB1550]], デバイス 2: emu10k1 efx [Multichannel Capture/PT Playback]
  サブデバイス: 8/8
  サブデバイス #0: subdevice #0
  サブデバイス #1: subdevice #1
  サブデバイス #2: subdevice #2
  サブデバイス #3: subdevice #3
  サブデバイス #4: subdevice #4
  サブデバイス #5: subdevice #5
  サブデバイス #6: subdevice #6
  サブデバイス #7: subdevice #7
カード 2: Audigy2 [SB Audigy 5/Rx [SB1550]], デバイス 3: emu10k1 [Multichannel Playback]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0

あるいは

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
$ aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=PCH
    HDA Intel PCH, ALC887-VD Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Direct sample mixing device
dmix:CARD=PCH,DEV=1
    HDA Intel PCH, ALC887-VD Digital
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=1
    HDA Intel PCH, ALC887-VD Digital
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC887-VD Digital
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC887-VD Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
    HDA Intel PCH, ALC887-VD Digital
    Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Hardware device with all software conversions
sysdefault:CARD=Audigy2
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Default Audio Device
front:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Front speakers
rear:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Rear speakers
center_lfe:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Center and Subwoofer speakers
side:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Side speakers
surround21:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Direct sample mixing device
dmix:CARD=Audigy2,DEV=2
    SB Audigy 5/Rx [SB1550], Multichannel Capture/PT Playback
    Direct sample mixing device
dmix:CARD=Audigy2,DEV=3
    SB Audigy 5/Rx [SB1550], Multichannel Playback
    Direct sample mixing device
dsnoop:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Direct sample snooping device
dsnoop:CARD=Audigy2,DEV=2
    SB Audigy 5/Rx [SB1550], Multichannel Capture/PT Playback
    Direct sample snooping device
dsnoop:CARD=Audigy2,DEV=3
    SB Audigy 5/Rx [SB1550], Multichannel Playback
    Direct sample snooping device
hw:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Direct hardware device without any conversions
hw:CARD=Audigy2,DEV=2
    SB Audigy 5/Rx [SB1550], Multichannel Capture/PT Playback
    Direct hardware device without any conversions
hw:CARD=Audigy2,DEV=3
    SB Audigy 5/Rx [SB1550], Multichannel Playback
    Direct hardware device without any conversions
plughw:CARD=Audigy2,DEV=0
    SB Audigy 5/Rx [SB1550], ADC Capture/Standard PCM Playback
    Hardware device with all software conversions
plughw:CARD=Audigy2,DEV=2
    SB Audigy 5/Rx [SB1550], Multichannel Capture/PT Playback
    Hardware device with all software conversions
plughw:CARD=Audigy2,DEV=3
    SB Audigy 5/Rx [SB1550], Multichannel Playback
    Hardware device with all software conversions

で、 /etc/mpd.conf には

1
2
3
4
5
6
7
8
9
audio_output {
    type        "alsa"
    name        "My ALSA Device"
    device      "hw:2,0"    # optional
    mixer_type      "hardware"      # optional
#   mixer_device    "default"   # optional
#   mixer_control   "PCM"       # optional
#   mixer_index "0"     # optional
}

と device を hw:2,0 と指定する。MPDクライアントのSonataで再生してみると、これで再生はしているようなのだけど、音が出ない。サブデバイスがやたらとあるので、それを一体どう指定してやれば良いのか。上記の「サウンドの出力先」でもバグっているようだし。
頭痛い。Linux でSound Blasterはダメダメなんじゃないだろうか。ついでに書いておくと、Sound Blaster Zはまともに認識すらされない。スクリーンショット取ってないけど、「サウンドの出力先」でデバイスを選択すら出来ない。既知のバグなのだけど、未だに直っていないです。
[amazonjs asin=”B00EZCAOH8″ locale=”JP” title=”Creative ハイレゾ対応 サウンドカード Sound Blaster Audigy Rx PCI-e SB-AGY-RX”]
[amazonjs asin=”B009NQU90I” locale=”JP” title=”Creative ハイレゾ対応 サウンドカード PCIe Sound Blaster Z 再生リダイレクト対応 24bit/192kH 【ファイナルファンタジーXIV: 新生エオルゼア Windows版 推奨】 SB-Z”]

Ubuntu 16.04 PCにCreative Sound Blaster Audigy Fxを挿してみた

アナログ出力 24bit/192kHz/ステレオ対応のPCI-Express x1 サウンドカード、Creative Sound Blaster Audigy Fx先のエントリーのUbuntu 16.04 PCに挿してみました。こんな感じです。カード2です。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ aplay -l
**** ハードウェアデバイス PLAYBACK のリスト ****
カード 0: PCH [HDA Intel PCH], デバイス 0: ALC887-VD Analog [ALC887-VD Analog]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 0: PCH [HDA Intel PCH], デバイス 1: ALC887-VD Digital [ALC887-VD Digital]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 3: HDMI 0 [HDMI 0]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 1: NVidia [HDA NVidia], デバイス 7: HDMI 1 [HDMI 1]
  サブデバイス: 1/1
  サブデバイス #0: subdevice #0
カード 2: Creative [HDA Creative], デバイス 0: ALC898 Analog [ALC898 Analog]
  サブデバイス: 0/1
  サブデバイス #0: subdevice #0

Music Player Daemon (MPD) で楽曲を再生すると、すぐ反応して再生が始まります。以前使っていたUbuntu PCではONKYO SE-90PCI R2を挿していましたが、やはりMPDでの楽曲再生の反応は速かったです。MPDではオンボサウンドチップだと反応が遅く、サウンドカードを出力先にしていると反応速いようですね。
ちなみに音質は、同じ楽曲、例えば宇多田ヒカル Fantôme flac 96kHz/24bit ファイルをMPD + ONKYO GX-D90で再生すると高音がシャリシャリして頭が痛くなります。一方Rhythmbox + GX-D90 で再生した場合は高音のシャリシャリ感はそれ程気にならなくなります。MPDはALSAを利用してサウンドカードにデータを送っているけど、RhythmboxはPulseAudio経由でALSAからサウンドカードにデータを送る、でいいかな。その分鈍るのですね。ちなみに Raspberry Pi 2 + サインスマート HiFi DAC サウンドカードモジュール + Volumio VERSION:0.979 + GX-D90 の組み合わせでは上記の楽曲を再生しても高音がシャリシャリしない。
まあだから、サウンドブラスターのこのサウンドカードは、普通にWindowsとかで楽曲再生する分には良いけど、MPDでハイレゾ音源を再生するには向いてない感じです。
[amazonjs asin=”B00EZCANTC” locale=”JP” title=”Creative ハイレゾ対応 サウンドカード Sound Blaster Audigy Fx PCI-e SB-AGY-FX”]
[amazonjs asin=”B00DIIXZA8″ locale=”JP” title=”ONKYO SE-90PCI R2 WAVIO PCIデジタルオーディオボード ハイレゾ音源対応”]
[amazonjs asin=”B00008B58Y” locale=”JP” title=”ONKYO WAVIO アンプ内蔵スピーカー 15W+15W ハイレゾ音源対応 木目 GX-D90(Y)”]
[amazonjs asin=”B01I4GDLZW” locale=”JP” title=”Fantôme”]
[amazonjs asin=”B00ZEWD5VK” locale=”JP” title=”サインスマート HIFI DAC サウンドカード モジュール I2Sインターフェース Raspberry Pi B+、2 Model B対応”]