USB 音频只输出白噪声

ssh*_*ksh 9 usb audio openbsd

我在一台使用了 5 年的笔记本电脑上运行 OpenBSD/i386 5.1。扬声器和耳机端口工作正常,但耳机端口有点松,所以我尝试安装外置 USB 声卡(Fiio E17 USB DAC)。在 Windows 上使用它没有问题。

该装置被检测到并且我创建了它的节点在/devsh /dev/MAKEDEV audio1,然后链接的设备的其余部分,以指向新的声卡。到目前为止一切顺利,我可以跑步cat /dev/urandom > /dev/audio并且听到白噪音。但是,我无法通过它运行任何其他音频。

tail /var/log/messages插入设备后我的:

Aug 30 10:03:55 s96j /bsd: uhidev0 at uhub1
Aug 30 10:03:55 s96j /bsd:  port 1 configuration 1 interface 0 "FiiO FiiO USB DAC-E17" rev 1.10/0.01 addr 2
Aug 30 10:03:55 s96j /bsd: uhidev0: iclass 3/0
Aug 30 10:03:55 s96j /bsd: uhid0 at uhidev0: input=18, output=27, feature=0
Aug 30 10:03:55 s96j /bsd: uaudio0 at uhub1
Aug 30 10:03:55 s96j /bsd:  port 1 configuration 1 interface 1 "FiiO FiiO USB DAC-E17" rev 1.10/0.01 addr 2
Aug 30 10:03:56 s96j /bsd: uaudio0: ignored setting with type 8193 format
Aug 30 10:03:56 s96j /bsd: uaudio0: audio rev 1.00, 2 mixer controls
Aug 30 10:03:56 s96j /bsd: audio1 at uaudio0
Run Code Online (Sandbox Code Playgroud)

我的相关设备列表来自/dev

lrwxr-xr-x  1 root  wheel         6 Aug 30 09:44 audio -> audio1
crw-rw-rw-  1 root  wheel   42, 128 Aug 30 10:07 audio0
crw-rw-rw-  1 root  wheel   42, 129 Aug 30 10:15 audio1
crw-rw-rw-  1 root  wheel   42, 130 Aug 30 06:40 audio2
lrwxr-xr-x  1 root  wheel         9 Aug 30 09:44 audioctl -> audioctl1
crw-rw-rw-  1 root  wheel   42, 192 Aug 30 06:40 audioctl0
crw-rw-rw-  1 root  wheel   42, 193 Aug 30 09:44 audioctl1
crw-rw-rw-  1 root  wheel   42, 194 Aug 30 06:40 audioctl2
lrwxr-xr-x  1 root  wheel         6 Aug 30 09:45 mixer -> mixer1
crw-rw-rw-  1 root  wheel   42,  16 Aug 30 06:40 mixer0
crw-rw-rw-  1 root  wheel   42,  17 Aug 30 09:44 mixer1
crw-rw-rw-  1 root  wheel   42,  18 Aug 30 06:40 mixer2
lrwxr-xr-x  1 root  wheel         6 Aug 30 09:45 sound -> sound1
crw-rw-rw-  1 root  wheel   42,   0 Aug 30 06:40 sound0
crw-rw-rw-  1 root  wheel   42,   1 Aug 30 09:44 sound1
crw-rw-rw-  1 root  wheel   42,   2 Aug 30 06:40 sound2
Run Code Online (Sandbox Code Playgroud)

来自FAQ 的一个简单测试,以确定数据是否通过设备:

# cat > /dev/audio < /dev/zero &
[1] 21098
# audioctl play.{seek,samples,errors}
play.seek=61712
play.samples=1146080
play.errors=0
# audioctl play.{seek,samples,errors}
play.seek=52896
play.samples=1542800
play.errors=0
# audioctl play.{seek,samples,errors}
play.seek=61712
play.samples=1957152
play.errors=0
Run Code Online (Sandbox Code Playgroud)

我的audioctl -a

name=USB audio
version=
config=uaudio
encodings=slinear_le:16:2:1,slinear_le:24:3:1
properties=independent
full_duplex=0
fullduplex=0
blocksize=8816
hiwat=7
lowat=1
output_muted=0
monitor_gain=0
mode=
play.rate=44100
play.sample_rate=44100
play.channels=2
play.precision=16
play.bps=2
play.msb=1
play.encoding=slinear_le
play.gain=127
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=8816
play.samples=131988
play.eof=0
play.pause=0
play.error=1
play.waiting=0
play.open=0
play.active=0
play.buffer_size=65536
play.block_size=8816
play.errors=2267
record.rate=44100
record.sample_rate=44100
record.channels=2
record.precision=16
record.bps=2
record.msb=1
record.encoding=slinear_le
record.gain=127
record.balance=32
record.port=0x0
record.avail_ports=0x0
record.seek=0
record.samples=0
record.eof=0
record.pause=0
record.error=0
record.waiting=0
record.open=0
record.active=0
record.buffer_size=65536
record.block_size=8816
record.errors=0
Run Code Online (Sandbox Code Playgroud)

最后,我的mixerctl -a

outputs.aux.mute=off
outputs.aux=255,255
Run Code Online (Sandbox Code Playgroud)

我再次能够cat /dev/urandom > /dev/audio获得白噪声,但我尝试过的其他任何事情都没有让我输出其他声音或音乐。我也尝试过,cat sample.au > /dev/audio但那也是沉默的。

任何建议或帮助将不胜感激!最坏的情况是,希望有人可以使用我在此处概述的步骤来对自己的声音设备进行故障排除。

era*_*man 2

在 OpenBSD 上,音频播放/录音默认由sndiod(1)守护进程处理。设备名称记录在sndio(7)下,如下所示:

 type      The type of the audio device or MIDI port.  Possible values
           are:

              rsnd      Raw audio(4) device.
              rmidi     Raw midi(4) port.
              snd       Audio device exposed by sndiod(1).
              midithru  MIDI thru box created with sndiod(1).
              midi      MIDI port exposed by sndiod(1).
              default   Default audio device or MIDI port (see below).
Run Code Online (Sandbox Code Playgroud)

的输出dmesg表明您的 USB 已打开audio1,因此添加以下内容/etc/rc.conf.local以指定两个原始音频(4)设备,使用第二个设备作为默认值:

sndiod_flags="-f rsnd/1 -f rsnd/0"
Run Code Online (Sandbox Code Playgroud)

然后跑/etc/rc.d/sndiod restart。该-f标志还可以用于aucat播放或录制音频:

aucat -f rsnd/1 -i my.wav # second "raw" audio device 
aucat -f snd/1 -i my.wav  # second sndiod device
Run Code Online (Sandbox Code Playgroud)