질문

질문

질문

새 마이크의 펄스 오디오 구성에 문제가 있습니다. ALSA는 이 장치를 완벽하게 처리하지만 기본 PulseAudio 모듈에는 소리가 없습니다.

시험

다음 테스트를 통해 기본 구성에 문제가 있다고 의심되는 부분을 설명하고 싶습니다. 하단의 설정 세부정보를 참고하세요.

  1. AlSA 및 Pulse Audio에 해당하는 장치 및 소스 이름을 정의합니다.
DEV_ALSA_DEF=hw:2,1
DEV_PULS_DEF=alsa_input.usb-Generic_USB_Audio-00.iec958-stereo
  1. 카드와 소스의 모든 채널의 음소거를 해제하고 볼륨을 높입니다.
amixer -c2 set Mic,0 0
amixer -c2 set Mic,0 100%
amixer -c2 set Mic,1 0
amixer -c2 set Mic,1 100%
pacmd set-source-mute   $DEV_PULS_DEF 0
pacmd set-source-volume $DEV_PULS_DEF 65536
  1. ALSA 및 Pulse Audio에서 권장하는 API를 사용하여 수신 사운드를 녹음하세요.
arecord -f dat -r 48000 -D $DEV_ALSA_DEF -d 10 out_alsa_def.wav
timeout 10 pacat -r --channels=2 --file-format=wav --device $DEV_PULS_DEF out_puls_def.wav

분석하다

pavucontrolPulse Audio 서비스가 제대로 작동하는지 확인하기 위해 재부팅 후와 시작 후에 이 코드를 테스트했습니다 . 그 결과 out_alsa_def.wav정확하고 명확한 기록이면서 동시에 out_puls_def.wav완전히 조용하고/비어 있으며/공허합니다. 나의 첫 번째 질문:Pulse Audio를 ALSA 채널에 연결할 수 없는 이유는 무엇입니까?.

해결책

ALSA 카드에서 생성된 새로운 소스를 사용하여 솔루션을 찾을 수 있었습니다.

시험

  1. $DEV_PULS_DEF"클론"은 카드에 해당하는 펄스 오디오 소스 모듈을 "수동으로" 로드하여 생성됩니다 $DEV_ALSA_DEF.
pacmd load-module module-alsa-source device=$DEV_ALSA_DEF
DEV_PULS_MAN=alsa_input.hw_2_1
  1. 소스의 음소거를 해제하고 볼륨을 높이세요.
pacmd set-source-mute   $DEV_PULS_MAN 0
pacmd set-source-volume $DEV_PULS_MAN 65536
  1. 들어오는 소리를 녹음하세요.
timeout 10 pacat -r --channels=2 --file-format=wav --device $DEV_PULS_MAN out_puls_man.wav

분석하다

이번에는 출력 파일이 out_puls_man.wav완벽하게 문서화되었습니다. 내 결론은 "수동으로" 로드된 소스는 ALSA용 채널을 얻지만 기본 생성 소스에는 액세스할 수 없다는 것입니다. 나에게 이는 자동 펄스 오디오 구성의 일부가 오작동하고 있음을 의미합니다. 두 번째 질문:소스 코드를 수동으로 로드하는 것이 더 성공적인 이유는 무엇입니까?

하지만…

이것문서사용하지 않는 것이 좋으며 가능하면 권장됩니다 module-alsa-source. module-udev-detect그러나 $ pacmd load-module module-udev-detect문제가 해결되지 않았습니다. 세 번째 질문:권장 도구만 사용하여 이 문제를 올바르게 해결하려면 어떻게 해야 하며, 이 해결 방법으로 인해 발생할 수 있는 문제는 무엇입니까?

설정

마이크로폰

문제의 마이크는 USB-C를 통해 연결되는 새로운 HP E27d G4의 내장 웹캠의 일부입니다. 마이크는 스테레오이며 디지털 스테레오(IEC958) 입력 프로필을 사용합니다. 비디오 전송은 즉시 작동됩니다.

체계

$ inxi -SA
System:
  Host: rivendell Kernel: 6.1.80-1-MANJARO
    arch: x86_64 bits: 64
  Desktop: i3 v: 4.23
    Distro: Manjaro Linux
Audio:
  Device-1: Intel Cannon Lake PCH cAVS
    driver: snd_hda_intel
  Device-2: NVIDIA driver: snd_hda_intel
  Device-3: HP USB Audio
    driver: hid-generic,snd-usb-audio,usbhid
    type: USB
  API: ALSA v: k6.1.80-1-MANJARO
    status: kernel-api
  Server-1: PulseAudio v: 17.0
    status: active

오디오 구성

스크립트 실행 후 생성됩니다.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****

  [some more output]

card 2: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ amixer -c2
Simple mixer control 'PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 47
  Front Left: Capture 47 [100%] [0.00dB] [on]
  Front Right: Capture 47 [100%] [0.00dB] [on]
Simple mixer control 'Mic',1
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 47
  Front Left: Capture 47 [100%] [0.00dB] [on]
  Front Right: Capture 47 [100%] [0.00dB] [on]
$ pacmd list-sources
5 source(s) available.

[some more output]

    index: 1
    name: <alsa_input.usb-Generic_USB_Audio-00.iec958-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE
    priority: 9047
    volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max rewind: 0 KiB
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
    card: 1 <alsa_card.usb-Generic_USB_Audio-00>
    module: 7
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "USB Audio"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "2"
        alsa.card_name = "USB Audio"
        alsa.long_card_name = "Generic USB Audio at usb-0000:00:14.0-4.4, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:14.0-usb-0:4.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.0/sound/card2"
        udev.id = "usb-Generic_USB_Audio-00"
        device.bus = "usb"
        device.vendor.id = "03f0"
        device.vendor.name = "HP, Inc"
        device.product.id = "086d"
        device.product.name = "USB Audio"
        device.serial = "Generic_USB_Audio"
        device.string = "iec958:2"
        device.buffering.buffer_size = "384000"
        device.buffering.fragment_size = "192000"
        device.access_mode = "mmap+timer"
        device.profile.name = "iec958-stereo"
        device.profile.description = "Digital Stereo (IEC958)"
        device.description = "USB Audio Digital Stereo (IEC958)"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    ports:
        iec958-stereo-input: Digital Input (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
            properties:
                
    active port: <iec958-stereo-input>

[some more output]

  index: 4
    name: <alsa_input.hw_2_1>
    driver: <module-alsa-source.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE
    priority: 9040
    volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max rewind: 0 KiB
    sample spec: s16le 2ch 48000Hz
    channel map: front-left,front-right
                 Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
    module: 25
    properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "USB Audio #1"
        alsa.id = "USB Audio"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "1"
        alsa.card = "2"
        alsa.card_name = "USB Audio"
        alsa.long_card_name = "Generic USB Audio at usb-0000:00:14.0-4.4, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:14.0-usb-0:4.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.0/sound/card2"
        udev.id = "usb-Generic_USB_Audio-00"
        device.bus = "usb"
        device.vendor.id = "03f0"
        device.vendor.name = "HP, Inc"
        device.product.id = "086d"
        device.product.name = "USB Audio"
        device.serial = "Generic_USB_Audio"
        device.string = "hw:2,1"
        device.buffering.buffer_size = "384000"
        device.buffering.fragment_size = "192000"
        device.access_mode = "mmap+timer"
        device.description = "USB Audio"
        device.icon_name = "audio-input-microphone-usb"
$ pactl list cards
 [some more output]

Card #1
    Name: alsa_card.usb-Generic_USB_Audio-00
    Driver: module-alsa-card.c
    Owner Module: 7
    Properties:
        alsa.card = "2"
        alsa.card_name = "USB Audio"
        alsa.long_card_name = "Generic USB Audio at usb-0000:00:14.0-4.4, high speed"
        alsa.driver_name = "snd_usb_audio"
        device.bus_path = "pci-0000:00:14.0-usb-0:4.4:1.0"
        sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.4/1-4.4:1.0/sound/card2"
        udev.id = "usb-Generic_USB_Audio-00"
        device.bus = "usb"
        device.vendor.id = "03f0"
        device.vendor.name = "HP, Inc"
        device.product.id = "086d"
        device.product.name = "USB Audio"
        device.serial = "Generic_USB_Audio"
        device.string = "2"
        device.description = "USB Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-usb"
    Profiles:
        input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: no)
        input:iec958-stereo: Digital Stereo (IEC958) Input (sinks: 0, sources: 1, priority: 32823, available: yes)
        output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 39268, available: yes)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
        output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 39323, available: yes)
        output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 38268, available: yes)
        output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5565, available: yes)
        output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (sinks: 1, sources: 1, priority: 38323, available: yes)
        output:iec958-ac3-surround-51: Digital Surround 5.1 (IEC958/AC3) Output (sinks: 1, sources: 0, priority: 300, available: yes)
        output:iec958-ac3-surround-51+input:analog-stereo: Digital Surround 5.1 (IEC958/AC3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 365, available: no)
        output:iec958-ac3-surround-51+input:iec958-stereo: Digital Surround 5.1 (IEC958/AC3) Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 33123, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: input:iec958-stereo
    Ports:
        analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, not available)
            Properties:
                device.icon_name = "audio-input-microphone"
            Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
        iec958-stereo-input: Digital Input (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
            Part of profile(s): input:iec958-stereo, output:analog-stereo+input:iec958-stereo, output:iec958-stereo+input:iec958-stereo, output:iec958-ac3-surround-51+input:iec958-stereo
        analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, available)
            Properties:
                device.icon_name = "audio-headphones"
            Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-stereo+input:iec958-stereo
        iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
            Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-stereo+input:iec958-stereo

 [some more output]

실패의 방법

  1. $ pacmd load-module module-udev-detect
  2. $ systemctl --user restart pulseaudio.service그리고$ systemctl --user restart pulseaudio.socket
  3. $ pacmd load-module module-remap-source master=$DEV_PULS_DEF
  4. $ ffmpeg -f pulse -i $DEV_PULS_DEF output.wav
  5. $ pamac reinstall pulseaudio그리고pamac build pulseaudio
  6. pavucontrol(눈에 보이는 진폭 없음)

관련 정보