You are not logged in.

#1 2021-06-08 03:01:47

erikebz
Member
Registered: 2020-10-18
Posts: 6

[SOLVED] ffmpeg / OBS Studio not able to record audio from desktop

Well, i have spent the whole day trying to figure out why i can't record the desktop audio using ffmpeg or OBS Studio, this is what i have done:

- Checking pavucontrol i can see that on the recording tab the volume meter for "Monitor of Analogic Stereo Audio" is empty, as if my desktop is not playing any sound which is not true, i'm playing an mpv video and a video from YT in firefox.

- Tried reinstalling pulseaudio, nothing changes.

- Tried the following command: 'ffmpeg -f pulse -i 0 -ac 2 sample.mp3' but the mp3 is empty.

The output of

 $ pactl list short sources
0	alsa_output.pci-0000_00_1f.3.analog-stereo.monitor	module-alsa-card.c	s16le 2ch 48000Hz	RUNNING
2	alsa_input.pci-0000_00_1f.3.analog-stereo	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING

I hope someone can help me or instruct me to where to look for possible ways to fix this, thanks smile

Last edited by erikebz (2021-06-08 15:32:12)

Offline

#2 2021-06-08 07:06:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 13,013

Re: [SOLVED] ffmpeg / OBS Studio not able to record audio from desktop

What's your

pacmd list-sinks
pacmd list-sink-inputs
pacmd list-sources
pacmd list-source-outputs

in

[code]code here[/code]

tags.

Offline

#3 2021-06-08 15:06:31

erikebz
Member
Registered: 2020-10-18
Posts: 6

Re: [SOLVED] ffmpeg / OBS Studio not able to record audio from desktop

Oh sorry, i forgot to use the tag, my bad.


$ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9039
	volume: front-left: 29426 /  45% / -20.86 dB,   front-right: 29426 /  45% / -20.86 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 23.48 ms
	max request: 4 KiB
	max rewind: 4 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	used by: 1
	linked by: 7
	configured latency: 24.99 ms; range is 0.50 .. 2000.00 ms
	card: 0 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC3204 Analog"
		alsa.id = "ALC3204 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x91620000 irq 139"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "34c8"
		device.product.name = "Ice Lake-LP Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Estéreo analógico"
		device.description = "Audio Interno Estéreo analógico"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-speaker>
$ pacmd list-sink-inputs
1 sink input(s) available.
    index: 8
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: RUNNING
	sink: 0 <alsa_output.pci-0000_00_1f.3.analog-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 105.06 ms
	requested latency: 75.00 ms
	sample spec: float32le 2ch 48000Hz
	channel map: front-left,front-right
	             Estéreo
	resample method: speex-float-1
	module: 8
	client: 93 <Firefox>
	properties:
		media.name = "AudioStream"
		application.name = "Firefox"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.process.id = "2851"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "firefox"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		application.icon_name = "firefox"
		module-stream-restore.id = "sink-input-by-application-name:Firefox"
$ pacmd list-sources
2 source(s) available.
    index: 0
	name: <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
	driver: <module-alsa-card.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 1030
	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: yes
	current latency: 0.00 ms
	max rewind: 4 KiB
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	used by: 4
	linked by: 4
	configured latency: 24.99 ms; range is 0.50 .. 2000.00 ms
	monitor_of: 0
	card: 0 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		device.description = "Monitor of Audio Interno Estéreo analógico"
		device.class = "monitor"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x91620000 irq 139"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "34c8"
		device.product.name = "Ice Lake-LP Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "0"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
  * index: 1
	name: <alsa_input.pci-0000_00_1f.3.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9039
	volume: front-left: 30421 /  46% / -20.00 dB,   front-right: 30421 /  46% / -20.00 dB
	        balance 0.00
	base volume: 6554 /  10% / -60.00 dB
	volume steps: 65537
	muted: yes
	current latency: 2.20 ms
	max rewind: 0 KiB
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	used by: 2
	linked by: 2
	configured latency: 24.99 ms; range is 0.50 .. 2000.00 ms
	card: 0 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC3204 Analog"
		alsa.id = "ALC3204 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x91620000 irq 139"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "34c8"
		device.product.name = "Ice Lake-LP Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Estéreo analógico"
		device.description = "Audio Interno Estéreo analógico"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-headphone-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-headset-mic: Headset Microphone (priority 8800, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
	active port: <analog-input-internal-mic>
$ pacmd list-source-outputs
6 source output(s) available.
    index: 0
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	source: 0 <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 15.67 ms
	requested latency: 24.99 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	resample method: (null)
	owner module: 8
	client: 151 <OBS>
	properties:
		application.name = "OBS"
		application.icon_name = "obs"
		media.role = "production"
		media.name = "Audio del escritorio"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.process.id = "29793"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "obs"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-media-role:production"
    index: 1
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	source: 1 <alsa_input.pci-0000_00_1f.3.analog-stereo>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 0.00 ms
	requested latency: 24.99 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	resample method: (null)
	owner module: 8
	client: 151 <OBS>
	properties:
		application.name = "OBS"
		application.icon_name = "obs"
		media.role = "production"
		media.name = "Mic/Aux"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.process.id = "29793"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "obs"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-media-role:production"
    index: 2
	driver: <protocol-native.c>
	flags: 
	state: RUNNING
	source: 0 <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 15.67 ms
	requested latency: 24.99 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Estéreo
	resample method: (null)
	owner module: 8
	client: 151 <OBS>
	properties:
		application.name = "OBS"
		application.icon_name = "obs"
		media.role = "production"
		media.name = "Captura de salida de audio (PulseAudio)"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.process.id = "29793"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "obs"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-media-role:production"
    index: 3
	driver: <protocol-native.c>
	flags: DONT_MOVE 
	state: RUNNING
	source: 0 <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
	volume: mono: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 15.65 ms
	requested latency: 40.00 ms
	sample spec: float32le 1ch 25Hz
	channel map: mono
	             Mono
	resample method: peaks
	owner module: 8
	client: 193 <Control de Volumen de PulseAudio>
	properties:
		media.name = "Detección de Picos"
		application.name = "Control de Volumen de PulseAudio"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.id = "org.PulseAudio.pavucontrol"
		application.icon_name = "audio-card"
		application.version = "4.0"
		application.process.id = "30600"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "pavucontrol"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-application-id:org.PulseAudio.pavucontrol"
    index: 4
	driver: <protocol-native.c>
	flags: DONT_MOVE 
	state: RUNNING
	source: 1 <alsa_input.pci-0000_00_1f.3.analog-stereo>
	volume: mono: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 0.00 ms
	requested latency: 40.00 ms
	sample spec: float32le 1ch 25Hz
	channel map: mono
	             Mono
	resample method: peaks
	owner module: 8
	client: 193 <Control de Volumen de PulseAudio>
	properties:
		media.name = "Detección de Picos"
		application.name = "Control de Volumen de PulseAudio"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.id = "org.PulseAudio.pavucontrol"
		application.icon_name = "audio-card"
		application.version = "4.0"
		application.process.id = "30600"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "pavucontrol"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-application-id:org.PulseAudio.pavucontrol"
    index: 10
	driver: <protocol-native.c>
	flags: DONT_MOVE 
	state: RUNNING
	source: 0 <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
	volume: mono: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 15.67 ms
	requested latency: 40.00 ms
	sample spec: float32le 1ch 25Hz
	channel map: mono
	             Mono
	resample method: peaks
	owner module: 8
	client: 193 <Control de Volumen de PulseAudio>
	direct on input: 8
	properties:
		media.name = "Detección de Picos"
		application.name = "Control de Volumen de PulseAudio"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "34"
		application.id = "org.PulseAudio.pavucontrol"
		application.icon_name = "audio-card"
		application.version = "4.0"
		application.process.id = "30600"
		application.process.user = "erikebz"
		application.process.host = "erikebz"
		application.process.binary = "pavucontrol"
		application.language = "es_MX.UTF-8"
		window.x11.display = ":0"
		application.process.machine_id = "32cd854fdfcb41edae07df604d4720b9"
		application.process.session_id = "1"
		module-stream-restore.id = "source-output-by-application-id:org.PulseAudio.pavucontrol"

Offline

#4 2021-06-08 15:12:25

progandy
Member
Registered: 2012-05-17
Posts: 4,333

Re: [SOLVED] ffmpeg / OBS Studio not able to record audio from desktop

Your monitor source seems to be muted. "muted: yes" in "pacmd list-sources".
Try to unmute it in pavucontrol in the Input Devices tab. You may have to set the dropdown at the bottom to show all sources first.

or use this command:

pactl set-source-mute alsa_output.pci-0000_00_1f.3.analog-stereo.monitor 0

Last edited by progandy (2021-06-08 15:16:32)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2021-06-08 15:31:56

erikebz
Member
Registered: 2020-10-18
Posts: 6

Re: [SOLVED] ffmpeg / OBS Studio not able to record audio from desktop

progandy wrote:

Your monitor source seems to be muted. "muted: yes" in "pacmd list-sources".
Try to unmute it in pavucontrol in the Input Devices tab. You may have to set the dropdown at the bottom to show all sources first.

or use this command:

pactl set-source-mute alsa_output.pci-0000_00_1f.3.analog-stereo.monitor 0

The muted monitor source was the problem.

Thank you so much!

Wish you all a great day smile

Offline

Board footer

Powered by FluxBB