USB音频仅输出白噪声

USB音频仅输出白噪声

我在一台已有 5 年历史的笔记本电脑上运行 OpenBSD/i386 5.1。扬声器和耳机端口工作正常,但耳机端口有点松动,因此我尝试安装外部 USB 声卡(Fiio E17 USB DAC)。在 Windows 上使用没有任何问题。

/dev检测到该设备,我在with中为其创建了一个节点sh /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

我的相关设备列表来自/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

一个简单的测试常问问题确定数据是否正在通过设备传递:

# 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

我的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

最后,我的mixerctl -a

outputs.aux.mute=off
outputs.aux=255,255

我再次能够cat /dev/urandom > /dev/audio获得白噪音,但我尝试过的其他方法都无法让我输出其他声音或音乐。我也尝试过,cat sample.au > /dev/audio但也很安静。

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

答案1

在 OpenBSD 上,音频播放/录音由斯迪奥德(1)默认情况下为守护进程。设备名称记录在sdio(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).

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

sndiod_flags="-f rsnd/1 -f rsnd/0"

然后跑/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

相关内容