USB音频仅输出白噪声


9

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

我的相关设备清单来自/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但是也没说。

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


输出是mixerctl -v |grep output什么?

Answers:


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).

的输出dmesg表明您的USB处于打开状态audio1,因此请添加以下内容,/etc/rc.conf.local以使用第二个默认音频设备指定两个原始audio(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

谢谢!您的回答和sndiod(1)手册页使我步入正轨,并且该设备运行良好。我感谢您的帮助。
ssh2ksh 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.