pmb/qemu/run.py: add audio support (!1840)
Changes: * Added the ALSA_PLUGIN_DIRS environment variable otherwise it tries to load the plugins of the host pc and they fails. * Added the /usr/lib/pulseaudio path to the library-path argument * Added the audiodev and soundhw parameters to the qemu command * Added the required packages necessary to be installed in the chroot
This commit is contained in:
parent
d45e88505d
commit
d145f88276
|
@ -129,7 +129,8 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
|
||||||
rootfs_native = args.work + "/chroot_native"
|
rootfs_native = args.work + "/chroot_native"
|
||||||
env = {"QEMU_MODULE_DIR": rootfs_native + "/usr/lib/qemu",
|
env = {"QEMU_MODULE_DIR": rootfs_native + "/usr/lib/qemu",
|
||||||
"GBM_DRIVERS_PATH": rootfs_native + "/usr/lib/xorg/modules/dri",
|
"GBM_DRIVERS_PATH": rootfs_native + "/usr/lib/xorg/modules/dri",
|
||||||
"LIBGL_DRIVERS_PATH": rootfs_native + "/usr/lib/xorg/modules/dri"}
|
"LIBGL_DRIVERS_PATH": rootfs_native + "/usr/lib/xorg/modules/dri",
|
||||||
|
"ALSA_PLUGIN_DIRS": rootfs_native + "/usr/lib/alsa-lib"}
|
||||||
|
|
||||||
if "gtk" in args.qemu_display:
|
if "gtk" in args.qemu_display:
|
||||||
gdk_cache = create_gdk_loader_cache(args)
|
gdk_cache = create_gdk_loader_cache(args)
|
||||||
|
@ -141,7 +142,8 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
|
||||||
command = [rootfs_native + "/lib/ld-musl-" +
|
command = [rootfs_native + "/lib/ld-musl-" +
|
||||||
args.arch_native + ".so.1"]
|
args.arch_native + ".so.1"]
|
||||||
command += ["--library-path=" + rootfs_native + "/lib:" +
|
command += ["--library-path=" + rootfs_native + "/lib:" +
|
||||||
rootfs_native + "/usr/lib"]
|
rootfs_native + "/usr/lib:" +
|
||||||
|
rootfs_native + "/usr/lib/pulseaudio"]
|
||||||
command += [rootfs_native + "/usr/bin/qemu-system-" + arch]
|
command += [rootfs_native + "/usr/bin/qemu-system-" + arch]
|
||||||
command += ["-L", rootfs_native + "/usr/share/qemu/"]
|
command += ["-L", rootfs_native + "/usr/share/qemu/"]
|
||||||
|
|
||||||
|
@ -215,6 +217,10 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
|
||||||
command += ["-vga", "virtio"]
|
command += ["-vga", "virtio"]
|
||||||
command += ["-display", args.qemu_display]
|
command += ["-display", args.qemu_display]
|
||||||
|
|
||||||
|
# Audio support
|
||||||
|
command += ["-audiodev", "id=alsa,driver=alsa"]
|
||||||
|
command += ["-soundhw", "hda"]
|
||||||
|
|
||||||
return (command, env)
|
return (command, env)
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,7 +273,8 @@ def install_depends(args, arch):
|
||||||
depends = ["qemu", "qemu-system-" + arch, "qemu-ui-sdl", "qemu-ui-gtk",
|
depends = ["qemu", "qemu-system-" + arch, "qemu-ui-sdl", "qemu-ui-gtk",
|
||||||
"mesa-gl", "mesa-egl", "mesa-dri-ati", "mesa-dri-freedreno",
|
"mesa-gl", "mesa-egl", "mesa-dri-ati", "mesa-dri-freedreno",
|
||||||
"mesa-dri-intel", "mesa-dri-nouveau", "mesa-dri-swrast",
|
"mesa-dri-intel", "mesa-dri-nouveau", "mesa-dri-swrast",
|
||||||
"mesa-dri-virtio", "mesa-dri-vmwgfx"]
|
"mesa-dri-virtio", "mesa-dri-vmwgfx", "qemu-audio-alsa",
|
||||||
|
"qemu-audio-sdl", "alsa-plugins-pulse"]
|
||||||
if args.spice_port:
|
if args.spice_port:
|
||||||
depends += ["virt-viewer", "font-noto"]
|
depends += ["virt-viewer", "font-noto"]
|
||||||
pmb.chroot.apk.install(args, depends)
|
pmb.chroot.apk.install(args, depends)
|
||||||
|
|
Loading…
Reference in New Issue