Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
@ 2021-05-05 19:42 bugzilla at busybox.net
  2021-05-05 20:16 ` [Buildroot] [Bug 13791] " bugzilla at busybox.net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 19:42 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

            Bug ID: 13791
           Summary: The QEMU compiled by Buildroot does not support alsa
                    or pulseaudio drivers for soundcard forwarding
           Product: buildroot
           Version: 2021.02.1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: wzab01 at gmail.com
                CC: buildroot at uclibc.org
  Target Milestone: ---

Created attachment 8921
  --> https://bugs.busybox.net/attachment.cgi?id=8921&action=edit
The minimalistic Buildroot config that shows the reported problem

I need to emulate the machine (ARM virt 64-bit) which uses the host (Linux
running Debian/testing of Ubuntu 2020.04) soundcard.
Unfortunately, when I try to run the QEMU compiled by the Buildroot, I get:

./qemu-system-aarch64 --audio-help
Environment variable based configuration deprecated.
Please use the new -audiodev option.

Equivalent -audiodev to your current environment variables:
(Since you didn't specify QEMU_AUDIO_DRV, I'll list all possibilities)
-audiodev id=oss,driver=oss
-audiodev id=none,driver=none

When I have modified the audio-drv-list in package/qemu/qemu.mk as below:

define HOST_QEMU_CONFIGURE_CMDS
        unset TARGET_DIR; \
        cd $(@D); $(HOST_CONFIGURE_OPTS) CPP="$(HOSTCC) -E" \
                ./configure \
                --target-list="$(HOST_QEMU_TARGETS)" \
                --prefix="$(HOST_DIR)" \
                --interp-prefix=$(STAGING_DIR) \
                --cc="$(HOSTCC)" \
                --host-cc="$(HOSTCC)" \
                --audio-drv-list="alsa,pa,oss" \
                --extra-cflags="$(HOST_QEMU_CFLAGS)" \
                --extra-ldflags="$(HOST_LDFLAGS) -lrt -lm" \
                --meson=$(HOST_DIR)/bin/meson \
                --ninja=$(HOST_DIR)/bin/ninja \
                --disable-bzip2 \
                --disable-containers \
                --disable-curl \
                --disable-libssh \
                --disable-linux-io-uring \
                --disable-sdl \
                --disable-vhost-user-blk-server \
                --disable-virtiofsd \
                --disable-vnc-jpeg \
                --disable-vnc-png \
                --disable-vnc-sasl \
                --disable-tests \
                $(HOST_QEMU_OPTS)

I get the following error:
Using './build' as the directory for build output

ERROR: alsa check failed
       Make sure to have the alsa libs and headers installed.

I have forced the configure script to print the "pkg_config_exe" variable,
and it appears that it uses the compiled 
buildroot-2021.02.01/output/host/bin/pkg-config

Running it by hand, I have stated that it is not aware of the packages
"libasound2-dev" and "libpulse-dev" that I have installed in my system.

Running it with "--help" option I've got:
[...]
  --keep-system-cflags              keep
-I/tmp/BR/buildroot-2021.02.1/output/host/include entries in cflags output
  --keep-system-libs                keep
-L/tmp/BR/buildroot-2021.02.1/output/host/lib entries in libs output
[...]
So it ignores my system libraries and header files!

What can I do to build the QEMU with 

PS. For Buildroot 2020.02 I managed to create a patch that enforces compilation
of the alsa and pa drivers:
https://github.com/wzab/BR_Internet_Radio/blob/gpio_simple/QemuVirt64/patches/0002-WZab-host-qemu-patched-for-forced-compilation-of-alsa-and-pa-audio.patch
Unfortunately, it doesn't work with the new, meson-based build flow.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
@ 2021-05-05 20:16 ` bugzilla at busybox.net
  2021-05-05 20:51 ` bugzilla at busybox.net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 20:16 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

--- Comment #1 from Arnout Vandecappelle <arnout@mind.be> ---
You have to add host-alsa-lib and host-pulseaudio to the QEMU_DEPENDENCIES for
this to work. Buildroot does not want to depend on anything pre-installed on
the host (if you're OK with stuff that is pre-installed on the host, you can
just as well install qemu-system-arm, right?)

Of course, currently there is no host package for alsa-lib or pulseaudio, so
you'll have to add them first. And pulsaudio has dependencies for which no host
package exits either, so this will take a bit of work...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
  2021-05-05 20:16 ` [Buildroot] [Bug 13791] " bugzilla at busybox.net
@ 2021-05-05 20:51 ` bugzilla at busybox.net
  2021-05-05 21:00 ` bugzilla at busybox.net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 20:51 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

--- Comment #2 from WZab <wzab01@gmail.com> ---
I have extracted the configuration of the libpulse and alsa from the system
pkgconf:

$ pkgconf libpulse --libs 
-L/usr/lib/x86_64-linux-gnu -lpulse
$ pkgconf libpulse --cflags
-D_REENTRANT 
$ pkg-config alsa --libs
-L/usr/lib/x86_64-linux-gnu -lasound 
$ pkg-config alsa --cflags


Then I have injected them by hand to the "configure" script in the
output/build/host-qemu-5.2.0/ :


##########################################
# Sound support libraries probe

audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g')
for drv in $audio_drv_list; do
    case $drv in
    alsa | try-alsa)
    if true; then
        alsa_libs="-L/usr/lib/x86_64-linux-gnu -lasound"
        alsa_cflags=""
        alsa=yes
        if test "$drv" = "try-alsa"; then
            audio_drv_list=$(echo "$audio_drv_list" | sed -e
's/try-alsa/alsa/')
        fi
    else
        if test "$drv" = "try-alsa"; then
            audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa//')
        else
            error_exit "$drv check failed" \
                "Make sure to have the $drv libs and headers installed."
        fi
    fi
    ;;

    pa | try-pa)
    if true; then
        libpulse=yes
        pulse_libs="-L/usr/lib/x86_64-linux-gnu -lpulse"
        pulse_cflags="-D_REENTRANT"
        if test "$drv" = "try-pa"; then
            audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/')
        fi
    else
        if test "$drv" = "try-pa"; then
            audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa//')
        else
            error_exit "$drv check failed" \
                "Make sure to have the $drv libs and headers installed."
        fi
    fi
    ;;

After that, and with the following:

# Override CPP, as it expects to be able to call it like it'd
# call the compiler.
define HOST_QEMU_CONFIGURE_CMDS
        unset TARGET_DIR; \
        cd $(@D); $(HOST_CONFIGURE_OPTS) CPP="$(HOSTCC) -E" \
                ./configure \
                --target-list="$(HOST_QEMU_TARGETS)" \
                --prefix="$(HOST_DIR)" \
                --interp-prefix=$(STAGING_DIR) \
                --cc="$(HOSTCC)" \
                --host-cc="$(HOSTCC)" \
                --extra-cflags="$(HOST_QEMU_CFLAGS)" \
                --extra-ldflags="$(HOST_LDFLAGS)" \
                --audio-drv-list="alsa,pa,oss" \
                --meson=$(HOST_DIR)/bin/meson \
                --ninja=$(HOST_DIR)/bin/ninja \
                --disable-bzip2 \
                --disable-containers \
                --disable-curl \
                --disable-libssh \
                --disable-linux-io-uring \
                --disable-sdl \
                --disable-vhost-user-blk-server \
                --disable-virtiofsd \
                --disable-vnc-jpeg \
                --disable-vnc-png \
                --disable-vnc-sasl \
                --disable-tests \
                $(HOST_QEMU_OPTS)
endef

in the package/qemu/qemu.mk , I was able to compile QEMU with supported alsa
and pa drivers:

./qemu-system-aarch64 --audio-help
Environment variable based configuration deprecated.
Please use the new -audiodev option.

Equivalent -audiodev to your current environment variables:
(Since you didn't specify QEMU_AUDIO_DRV, I'll list all possibilities)
-audiodev id=alsa,driver=alsa
-audiodev id=pa,driver=pa
-audiodev id=oss,driver=oss
-audiodev id=none,driver=none

It is an awful workaround, but at least it works...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
  2021-05-05 20:16 ` [Buildroot] [Bug 13791] " bugzilla at busybox.net
  2021-05-05 20:51 ` bugzilla at busybox.net
@ 2021-05-05 21:00 ` bugzilla at busybox.net
  2021-05-05 21:45 ` bugzilla at busybox.net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 21:00 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

--- Comment #3 from WZab <wzab01@gmail.com> ---
(In reply to Arnout Vandecappelle from comment #1)
Unfortunately we have to use the patched QEMU (to add the GUI-connected GPIO
emulation for our students -
http://koral.ise.pw.edu.pl/~wzab/artykuly/Teaching_electronics_disease_virtual_lab.pdf
).
The version for BR 2021.02 is in
https://github.com/wzab/BR_Internet_Radio/tree/gpio_simple_2021.02/QemuVirt64

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2021-05-05 21:00 ` bugzilla at busybox.net
@ 2021-05-05 21:45 ` bugzilla at busybox.net
  2021-05-05 21:49 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 21:45 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

--- Comment #4 from WZab <wzab01@gmail.com> ---
Created attachment 8926
  --> https://bugs.busybox.net/attachment.cgi?id=8926&action=edit
Patch with temporary work-around

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
                   ` (3 preceding siblings ...)
  2021-05-05 21:45 ` bugzilla at busybox.net
@ 2021-05-05 21:49 ` bugzilla at busybox.net
  2021-05-05 23:20 ` bugzilla at busybox.net
  2024-06-15 14:58 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 21:49 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

WZab <wzab01@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #8926|0                           |1
        is obsolete|                            |

--- Comment #5 from WZab <wzab01@gmail.com> ---
Created attachment 8931
  --> https://bugs.busybox.net/attachment.cgi?id=8931&action=edit
Patch with temporary work-around

This is a temporary work-around - a patch to the qemu package.
It simply switches to using the standard pkg-config, when the sound libraries
are detected and configured. After that the original Buildroot-provided
pkg-config is restored.
The correct operation is confirmed on Debian/testing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
                   ` (4 preceding siblings ...)
  2021-05-05 21:49 ` bugzilla at busybox.net
@ 2021-05-05 23:20 ` bugzilla at busybox.net
  2024-06-15 14:58 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2021-05-05 23:20 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

--- Comment #6 from WZab <wzab01@gmail.com> ---
The temporary workaround is also available in the BR_Internet_Radio:

https://github.com/wzab/BR_Internet_Radio/commit/bdf7afed292ec0408fe908df42a4bc298031141a

https://github.com/wzab/BR_Internet_Radio/commit/2117504dc040cdc679e379eee87cde3c498c694d

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 13791] The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding
  2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
                   ` (5 preceding siblings ...)
  2021-05-05 23:20 ` bugzilla at busybox.net
@ 2024-06-15 14:58 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla @ 2024-06-15 14:58 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13791

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |MOVED
                 CC|                            |yann.morin.1998@free.fr
             Status|NEW                         |RESOLVED

--- Comment #7 from Yann E. MORIN <yann.morin.1998@free.fr> ---
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-15 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-05 19:42 [Buildroot] [Bug 13791] New: The QEMU compiled by Buildroot does not support alsa or pulseaudio drivers for soundcard forwarding bugzilla at busybox.net
2021-05-05 20:16 ` [Buildroot] [Bug 13791] " bugzilla at busybox.net
2021-05-05 20:51 ` bugzilla at busybox.net
2021-05-05 21:00 ` bugzilla at busybox.net
2021-05-05 21:45 ` bugzilla at busybox.net
2021-05-05 21:49 ` bugzilla at busybox.net
2021-05-05 23:20 ` bugzilla at busybox.net
2024-06-15 14:58 ` bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox