听不到声音,但 Linux 认为播放成功

听不到声音,但 Linux 认为播放成功

我使用 USB 声卡在 AlmaLinux 9 安装上运行音频。我似乎改变了一些东西,因为我不再听到音频(但AlmaLinux认为它成功地播放了声音)。我确实在启动时从 GUI 切换到文本模式,但我认为这并不重要。我不知道如何继续......希望有人看到这里有问题:

例如,以下命令成功完成:

aplay /data/sounds/intruder_alert.wav
Playing WAVE '/data/sounds/intruder_alert.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono

我确认在启动时检测到我的 USB 音频设备(不确定“input,hidraw1”是否是线索):

[    2.586749] hub 2-2:1.0: USB hub found
[    2.589077] hub 2-2:1.0: 7 ports detected
[    3.536316] usb 2-2.1: new full-speed USB device number 4 using uhci_hcd
[    4.432226] usb 2-2.1: New USB device found, idVendor=08bb, idProduct=2902, bcdDevice= 1.00
[    4.432236] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.432243] usb 2-2.1: Product: USB Audio CODEC
[    4.432248] usb 2-2.1: Manufacturer: Burr-Brown from TI
[    4.524947] input: Burr-Brown from TI               USB Audio CODEC  as /devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.3/0003:08BB:2902.0002/input/input6
[    4.583437] hid-generic 0003:08BB:2902.0002: input,hidraw1: USB HID v1.00 Device [Burr-Brown from TI               USB Audio CODEC ] on usb-0000:02:00.0-2.1/input3

和声音相关的驱动程序由内核加载:

 lsmod | grep snd
snd_seq_dummy          16384  0
snd_hrtimer            16384  1
snd_usb_audio         385024  2
snd_usbmidi_lib        45056  1 snd_usb_audio
snd_hwdep              16384  1 snd_usb_audio
snd_seq                94208  7 snd_seq_dummy
snd_pcm               151552  1 snd_usb_audio
snd_timer              49152  3 snd_seq,snd_hrtimer,snd_pcm
snd_rawmidi            45056  1 snd_usbmidi_lib
snd_seq_device         16384  2 snd_seq,snd_rawmidi
snd                   122880  14 snd_seq,snd_seq_device,snd_hwdep,snd_usb_audio,snd_usbmidi_lib,snd_timer,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
mc                     69632  1 snd_usb_audio

因为我正在运行管道并且节点是

   pw-cli ls Node
        id 28, type PipeWire:Interface:Node/3
                object.serial = "28"
                factory.id = "10"
                priority.driver = "20000"
                node.name = "Dummy-Driver"
        id 29, type PipeWire:Interface:Node/3
                object.serial = "29"
                factory.id = "10"
                priority.driver = "19000"
                node.name = "Freewheel-Driver"
        id 31, type PipeWire:Interface:Node/3
                object.serial = "1736"
                object.path = "alsa:pcm:0:front:0:playback"
                factory.id = "18"
                client.id = "33"
                device.id = "44"
                priority.session = "1009"
                priority.driver = "1009"
                node.description = "PCM2902 Audio Codec Analog Stereo"
                node.name = "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo-output"
                node.nick = "USB Audio CODEC"
                media.class = "Audio/Sink"
        id 37, type PipeWire:Interface:Node/3
                object.serial = "35"
                factory.id = "10"
                client.id = "33"
                node.name = "Midi-Bridge"
                media.class = "Midi/Bridge"
        id 42, type PipeWire:Interface:Node/3
                object.serial = "1737"
                object.path = "alsa:pcm:0:hw:0:capture"
                factory.id = "18"
                client.id = "33"
                device.id = "44"
                priority.session = "2009"
                priority.driver = "2009"
                node.description = "PCM2902 Audio Codec Analog Stereo"
                node.name = "alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo-input"
                node.nick = "USB Audio CODEC"
                media.class = "Audio/Source"

我还尝试了一个简单的扬声器测试:

speaker-test -c 2

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
 0 - Front Left
 1 - Front Right
Time per period = 11.005656
 0 - Front Left
^C 1 - Front Right
Time per period = 5.263193

我检查了 aplay 设备

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault
    Default Audio Device
oss
    Open Sound System
pipewire
    PipeWire Sound Server
default
    Default ALSA Output (currently PipeWire Media Server)
sysdefault:CARD=CODEC
    USB Audio CODEC, USB Audio
    Default Audio Device
front:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    Front output / input
surround21:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

alsa 混音器表示音量已调高:

amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 55864 [85%] [on]
  Front Right: Playback 55864 [85%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 26213 [40%] [on]
  Front Right: Capture 26213 [40%] [on]

我以前从未见过这种情况,也不知道如何诊断。顺便说一句,我确认我的扬声器工作正常(当我触摸音频线连接时听到嗡嗡声)。

相关内容