Skip to contentSkip to conversation

package/ffmpeg: add support for pulseaudio

PATCH In review Florian Larysch 2 participants 5 messages Jul 11, 2025 – Jul 15, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ffmpeg: add support for pulseaudio

---
 package/ffmpeg/ffmpeg.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/ffmpeg/ffmpeg.mk +7 -0
index 2d65623926..9ba7ac0f61 100644
@@ -94,6 +94,13 @@ else
 FFMPEG_CONF_OPTS += --disable-libjack
 endif
 
+ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
+FFMPEG_DEPENDENCIES += pulseaudio
+FFMPEG_CONF_OPTS += --enable-libpulse
+else
+FFMPEG_CONF_OPTS += --disable-libpulse
+endif
+
 ifeq ($(BR2_PACKAGE_LIBV4L),y)
 FFMPEG_DEPENDENCIES += libv4l
 FFMPEG_CONF_OPTS += --enable-libv4l2
Signature · 6 lines
2.49.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Florian Larysch

Hello Florian and all,

Quoted 13 lines · Florian Larysch
---
  package/ffmpeg/ffmpeg.mk | 7 +++++++
  1 file changed, 7 insertions(+)
package/ffmpeg/ffmpeg.mk +0 -0
index 2d65623926..9ba7ac0f61 100644
@@ -94,6 +94,13 @@ else
  FFMPEG_CONF_OPTS += --disable-libjack
  endif
 

package/ffmpeg/ffmpeg.mk else · line 106

Quoted 10 lines
package/ffmpeg/ffmpeg.mk +7 -0
+ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
+FFMPEG_DEPENDENCIES += pulseaudio
+FFMPEG_CONF_OPTS += --enable-libpulse
+else
+FFMPEG_CONF_OPTS += --disable-libpulse
+endif
+
  ifeq ($(BR2_PACKAGE_LIBV4L),y)
  FFMPEG_DEPENDENCIES += libv4l
  FFMPEG_CONF_OPTS += --enable-libv4l2

In our nightly Gitlab pipeline for LTS maintenance, I notice that this created a dependency cycle:

* ffmpeg now depends on pulseaudio

* pulseaudio depends on libsoxr

* libsoxr depends on ffmpeg

For example with this defconfig:

    BR2_PACKAGE_FFMPEG=y
    BR2_PACKAGE_PULSEAUDIO=y
    BR2_PACKAGE_LIBSOXR=y

$ make show-info
package/ffmpeg/ffmpeg.mk:639: *** Recursive variable 'FFMPEG_FINAL_RECURSIVE_DEPENDENCIES' references itself (eventually).  Stop.

I personally don't use any of these so I'm unsure of what would be the best way to handle this case.

Regards,

Titouan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hello Titouan,

Quoted 2 lines · Titouan Christophe

In our nightly Gitlab pipeline for LTS maintenance, I notice that this created a dependency cycle:

Thank you for catching this! I didn't have soxr enabled in my build so I didn't notice that.

Quoted 2 lines

I personally don't use any of these so I'm unsure of what would be the best way to handle this case.

The problem here is that the packages are a bit too coarse-grained. ffmpeg needs pulseaudio only for the client libraries (which get used in libavdevice), but pulseaudio uses ffmpeg (via libsoxr) only for providing an FFT implementation (via libavcodec) and that only gets used in the main pulseaudio daemon.

This could be solved by splitting pulseaudio into a -libs package or splitting up ffmpeg. I think splitting up pulseaudio would be much easier in comparison. Also in my application I was just going to use libpulse to talk to the Pipewire implementation of the PulseAudio protocol - I wasn't even going to use the original daemon and this is probably not too uncommon nowadays.

Either way I won't have the time to dig into this any further this week, I'll send a revert for now.

Florian
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hello Florian,

Quoted 7 lines · Florian Larysch

Hello Titouan,
[--]
The problem here is that the packages are a bit too coarse-grained. ffmpeg needs pulseaudio only for the client libraries (which get used in libavdevice), but pulseaudio uses ffmpeg (via libsoxr) only for providing an FFT implementation (via libavcodec) and that only gets used in the main pulseaudio daemon.

Thank you for having looked into this so far.

Quoted 9 lines

This could be solved by splitting pulseaudio into a -libs package or splitting up ffmpeg. I think splitting up pulseaudio would be much easier in comparison. Also in my application I was just going to use libpulse to talk to the Pipewire implementation of the PulseAudio protocol - I wasn't even going to use the original daemon and this is probably not too uncommon nowadays.

Either way I won't have the time to dig into this any further this week, I'll send a revert for now.

On my side, since we're not interested at all in the build itself (only collecting metadata), I just dropped the Makefile dependency libsoxr->ffmpeg in a custom patch, see https://gitlab.com/essensium-mind/buildroot-lts-tools/-/blob/main/patches/0003-package-libsoxr-remove-dependency-on-ffmpeg.patch

The patch above also solves another existing dependency cycle with one more hop: ffmpeg -> libopenmpt -> pulseaudio -> libsoxr -> ffmpeg

But obviously, this can't be upstreamed, as this would yield an incorrect build.

Until we find a better solution, I agree with your suggestion to revert.

Quoted 1 line

Florian

Have a nice day,

Titouan

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot