Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] FFMPEG and pipewire-pulse: Exec format error (Read 1257 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

[SOLVED] FFMPEG and pipewire-pulse: Exec format error

Trying to record audio using ffmpeg and pipewire-pulse, as per the instructions on https://trac.ffmpeg.org/wiki/Capture/PulseAudio, outputs an "Exec format error," which i have no idea how to troubleshoot.

Here's the command:
Code: [Select]
$ ffmpeg \
        -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor \
        -c:a aac -ar 44100 -b:a 256k \
        out.m4a
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor: Exec format error
After waiting for 30 seconds, it outputs that error. Or lately, it's just been waiting for eternity with no error message.
  • Also happens on both my USB mic device and the "default" device (which just links to the monitor).
  • Ffmpeg does record with alsa_input.pci-0000_00_1b.0.analog-stereo, but there's no audio since it's the wrong device.
  • Using ALSA works perfectly, but then any audio being played in pulse won't be recorded.
  • Parecord is also able to record audio perfectly.

My pulse sources:
Code: [Select]
$ pactl list short sources
1226 alsa_input.usb-046d_Logitech_BRIO_7D8CA652-03.analog-stereo PipeWire s16le 2ch 48000Hz SUSPENDED
1227 alsa_output.pci-0000_00_1b.0.analog-stereo.monitor PipeWire s32le 2ch 48000Hz IDLE
1228 alsa_input.pci-0000_00_1b.0.analog-stereo PipeWire s32le 2ch 48000Hz SUSPENDED

I haven't noticed any other issues with pulseaudio besides this. I actually had the exact same problem months ago when i started playing with ffmpeg, but gave up and switched to daily-driving alsa. I'm trying to go back to pulse now that i want functional audio in browsers (browsers suck btw) but this is a very yucky issue. In fact, this is my first forum post anywhere because I seem to be the only one with the screwed up config.

Thanks for the help.

Re: FFMPEG and pipewire-pulse: Exec format error

Reply #1
Ok, it works after setting my my sound card's pulse config from "analog stereo duplex" to "analog stereo output." No idea why, and the error message didn't help. But until I need to use a microphone, I guess it's solved. Thanks for reading. ALSA gang prevails once again

Re: FFMPEG and pipewire-pulse: Exec format error

Reply #2
great,

as a fix for chromium browser i recommend adding

Code: [Select]
# Never exit pulseaudio if idle. This is to deal with an issue of Chromium
# browsers not properly starting Pulseaudio by themselves. When the underlying
# issue is solved, this file/directory should be removed.
exit-idle-time = -1
 

to
Code: [Select]
.config/pulse/daemon.conf

Re: FFMPEG and pipewire-pulse: Exec format error

Reply #3
Ok, it works after setting my my sound card's pulse config from "analog stereo duplex" to "analog stereo output." No idea why, and the error message didn't help. But until I need to use a microphone, I guess it's solved. Thanks for reading. ALSA gang prevails once again
I've noticed too on a laptop, pipewire-pulse puts the duplex profile by default instead of just plain output. i think it tries to take the alsa parameters explicitly (the internal hardware loopback) and not "think" about it like pulse does.
What it should really do is leave this behavior to the pro audio profile and otherwise mimic pulse instead.