Захотелось попробовать виджет-визуализатор аудио —
Panon.
Очень понравился, вот только звук он принимал исключительно с микрофона — какой бы источник аудио я не выбирал.
Покопавшись в этих ваших ынтернетах, я немного разобрался в работе pulseaudio. Выходит так, что микрофон у меня стоял устройством по умолчанию
Вот только в Panon'е я не выбирал 'default', я выбирал конкретное устройство.
Выполнив
pacmd set-default-source alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor
я установил по умолчанию звук с наушников. Panon заработал как я хотел, вот только проверив микрофон в дискорде, я обнаружил ту же проблему: выбранное устройство просто игнорируется, вместо него используется то, что в пульсе выставлено по умолчанию.
Поставил микрофон обратно дефолтным.
Выполнил
pacmd set-log-level 4
в настройках Panon выбрал наушники, вот фрагмент лога:
[pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream removed from object /org/pulseaudio/core1/record_stream122
D: [pulseaudio] source.c: PulseEffects_mic.monitor: state: RUNNING -> IDLE
I: [pulseaudio] source-output.c: Freeing output 122 "outputstream"
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Client removed from object /org/pulseaudio/core1/client451
I: [pulseaudio] client.c: Freed 451 "Panon"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 454 "Native client (UNIX socket client)"
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Client added for object /org/pulseaudio/core1/client454
D: [pulseaudio] protocol-native.c: Protocol version: remote 33, local 33
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1001 success=1
D: [pulseaudio] protocol-native.c: SHM possible: yes
D: [pulseaudio] protocol-native.c: Negotiated SHM: yes
D: [pulseaudio] protocol-native.c: Memfd possible: yes
D: [pulseaudio] protocol-native.c: Negotiated SHM type: shared memfd
D: [pulseaudio] log.c: Invalid UTF-8 string following below:
D: [pulseaudio] memblock.c: Using shared memfd memory pool with 1024 slots of size 64,0 Ки� each, total size is 64,0 Ми�, maximum usable slot size is 65472
D: [pulseaudio] srbchannel.c: SHM block is 65472 bytes, ringbuffer capacity is 2 * 32712 bytes
D: [pulseaudio] protocol-native.c: Enabling srbchannel...
D: [pulseaudio] module-augment-properties.c: Looking for .desktop file for python3.8
D: [pulseaudio] protocol-native.c: Client enabled srbchannel.
D: [pulseaudio] module-augment-properties.c: Looking for .desktop file for python3.8
D: [pulseaudio] module-intended-roles.c: Not setting device for stream outputstream, because already set.
D: [pulseaudio] source-output.c: Negotiated format: pcm, format.sample_format = "\"float32le\"" format.rate = "44100" format.channels = "2" format.channel_map = "\"front-left,front-right\""
I: [pulseaudio] source-output.c: Trying to change sample spec
I: [pulseaudio] source.c: Cannot update sample spec, this is a monitor source and the sink is running.
D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo becomes busy, resuming.
I: [pulseaudio] resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates.
D: [pulseaudio] resampler.c: Resampler:
D: [pulseaudio] resampler.c: rate 44100 -> 44100 (method copy)
D: [pulseaudio] resampler.c: format s16le -> float32le (intermediate s16le)
D: [pulseaudio] resampler.c: channels 2 -> 2 (resampling 2)
D: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=4, prebuf=0, minreq=1 maxrewind=0
D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=4, prebuf=0, minreq=4 maxrewind=0
I: [pulseaudio] source-output.c: Created output 123 "outputstream" on alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor with sample spec float32le 2-канальный and channel map front-left,front-right
I: [pulseaudio] source-output.c: media.name = "outputstream"
I: [pulseaudio] source-output.c: application.name = "Panon"
I: [pulseaudio] source-output.c: native-protocol.peer = "UNIX socket client"
I: [pulseaudio] source-output.c: native-protocol.version = "33"
I: [pulseaudio] source-output.c: application.process.id = "20413"
I: [pulseaudio] source-output.c: application.process.user = "android7890"
I: [pulseaudio] source-output.c: application.process.host = "komputator"
I: [pulseaudio] source-output.c: application.process.binary = "python3.8"
I: [pulseaudio] source-output.c: application.language = "C"
I: [pulseaudio] source-output.c: window.x11.display = ":0"
I: [pulseaudio] source-output.c: application.process.machine_id = "59e7fb215cdb44bc8a90c15322348986"
I: [pulseaudio] source-output.c: application.process.session_id = "1"
I: [pulseaudio] source-output.c: module-stream-restore.id = "source-output-by-application-name:Panon"
D: [pulseaudio] memblockq.c: memblockq requested: maxlength=4194304, tlength=0, base=8, prebuf=1, minreq=0 maxrewind=0
D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=4194304, tlength=4194304, base=8, prebuf=8, minreq=8 maxrewind=0
I: [pulseaudio] protocol-native.c: Final latency 51,99 ms = 25,99 ms + 26,00 ms
D: [alsa-sink-USB Audio] alsa-sink.c: Latency set to 26,00ms
D: [alsa-sink-USB Audio] alsa-sink.c: hwbuf_unused=348216
D: [alsa-sink-USB Audio] alsa-sink.c: setting avail_min=87848
D: [alsa-sink-USB Audio] alsa-sink.c: Latency set to 26,00ms
D: [alsa-sink-USB Audio] alsa-sink.c: hwbuf_unused=348216
D: [alsa-sink-USB Audio] alsa-sink.c: setting avail_min=87848
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream added for object /org/pulseaudio/core1/record_stream123
D: [pulseaudio] source.c: alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor: state: IDLE -> RUNNING
D: [pulseaudio] source-output.c: Starting to move source output 123 from 'alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor'
D: [alsa-sink-USB Audio] alsa-sink.c: Latency set to 26,00ms
D: [alsa-sink-USB Audio] alsa-sink.c: hwbuf_unused=348216
D: [alsa-sink-USB Audio] alsa-sink.c: setting avail_min=87848
D: [pulseaudio] source.c: alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor: state: RUNNING -> IDLE
I: [pulseaudio] source-output.c: Trying to change sample spec
I: [pulseaudio] source.c: Cannot update sample spec, this is a monitor source and the sink is running.
D: [pulseaudio] source.c: PulseEffects_mic.monitor: state: IDLE -> RUNNING
D: [pulseaudio] source-output.c: Successfully moved source output 123 to PulseEffects_mic.monitor.
D: [pulseaudio] module-suspend-on-idle.c: Sink PulseEffects_mic becomes busy, resuming.
Проблема решилась, когда потыкал настройки PulseEffects:
Теперь микрофон может спокойно оставаться устройством по умолчанию, остальные источники звука работают как должны и в дискорде не слышно звуков системы