JuliaPackaging / Yggdrasil

Collection of builder repositories for BinaryBuilder.jl
https://binarybuilder.org
Other
308 stars 553 forks source link

`alsa`: set `configdir` and `plugindir`? #8073

Open barucden opened 9 months ago

barucden commented 9 months ago

When using FFplay_jll to play audio files on linux as follows

using FFplay_jll
mp3_path = "sample.mp3"
ffplay() do exe
    run(`$exe $path`)
end

ffplay does not play any sound and prints these messages:

ALSA lib conf.c:4499:(snd_config_update_r) Cannot access file /workspace/destdir/share/alsa/alsa.conf
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default

That can be resolved by setting the ALSA_CONFIG_PATH variable:

run(addenv(`$exe $path`, "ALSA_CONFIG_PATH" => "/usr/share/alsa/alsa.conf"))

However, that is not enough; ffplay still does not play any sound and prints:

ALSA lib dlmisc.c:339:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/workspace/destdir/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory)

That requires to set ALSA_PLUGIN_DIR:

run(addenv(`$exe $path`, "ALSA_CONFIG_PATH" => "/usr/share/alsa/alsa.conf",
                         "ALSA_PLUGIN_DIR" => "/usr/lib/alsa-lib/"))

Based on the /workspace/destdir/ prefix, I assume there's an issue with how we build alsa_jll. I noticed that the configure.ac script from alsa-lib provides --with-configdir and --with-plugindir. Would it help to set them to /usr/share/alsa/ and /usr/lib/alsa-lib/, respectively?

I found a similar issue (https://github.com/homebridge/ffmpeg-for-homebridge/issues/9) with a corresponding fix (https://github.com/homebridge/ffmpeg-for-homebridge/pull/10).

Discovered on Discourse.

dalum commented 3 months ago

I've just run into this when trying to @ccall into libasound. Would be lovely to have a fix for it!