Bug 1981663 - Add support for optional audio drivers
Summary: Add support for optional audio drivers
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.5
Assignee: Virtualization Maintenance
QA Contact: Guo, Zhiyi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-13 06:32 UTC by Lili Zhu
Modified: 2022-06-30 02:28 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-15 14:40:26 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lili Zhu 2021-07-13 06:32:24 UTC
Description of problem:
Add support for optional audio drivers

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
Tested with:
libvirt-daemon-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64
qemu-kvm-6.0.0-23.module+el8.5.0+11740+35571f13.x86_64

1. prepare a guest using non-root account with the following xml
...
  <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <audio id='1' type='pulseaudio'>
      <input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
        <settings frequency='44100' channels='2' format='s16'/>
      </input>
      <output mixingEngine='yes' fixedSettings='yes' voices='2' bufferLength='100'>
        <settings frequency='22050' channels='4' format='f32'/>
      </output>
    </audio>
...

2. start the guest
$ virsh start avocado-vt-vm1
Domain 'avocado-vt-vm1' started

3. check the qemu cmd line
...
-audiodev id=audio1,driver=pa,in.mixing-engine=on,in.fixed-settings=on,in.voices=1,in.buffer-length=100,in.frequency=44100,in.channels=2,in.format=s16,out.mixing-engine=on,out.fixed-settings=on,out.voices=2,out.buffer-length=100,out.frequency=22050,out.channels=4,out.format=f32 -vnc 0.0.0.0:1,audiodev=audio1
...

4. check the pulseaudio daemon
$ systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
   Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-06-28 10:23:05 CST; 42min ago
 Main PID: 2290 (pulseaudio)
   CGroup: /user.slice/user-1000.slice/user/pulseaudio.service
           └─2290 /usr/bin/pulseaudio --daemonize=no --log-target=journal

Jun 28 10:23:05 192.168.122.1 systemd[2269]: Starting Sound Service...
Jun 28 10:23:05 192.168.122.1 systemd[2269]: Started Sound Service.

5. login the guest, using vlc to play some audio file
(can not hear any sound)

6. check the log
$ cat /home/lizhu/.cache/libvirt/qemu/log/avocado-vt-vm1.log
...
audio: Unknown audio driver `pa'
audio: warning: Using timer based audio emulation
...



Actual results:
can not hear any sound

Expected results:


Additional info:
I checked the build file
....
qemu 6.0.0
  Directories
                   Install prefix: /usr
                   BIOS directory: share/qemu-kvm
                    firmware path: /usr/share/qemu-firmware
                 binary directory: bin
                library directory: lib64
                 module directory: lib64/qemu-kvm
                libexec directory: libexec
                include directory: include
                 config directory: /etc
            local state directory: /var
                 Manual directory: share/man
                    Doc directory: /usr/share/doc
                  Build directory: /builddir/build/BUILD/qemu-6.0.0/qemu_kvm_build
                      Source path: /builddir/build/BUILD/qemu-6.0.0
                   GIT submodules: 
  Host binaries
                              git: git
                             make: make
                           python: /usr/libexec/platform-python (version: 3.6)
                     sphinx-build: YES
                      genisoimage: 
                             smbd: "/usr/sbin/smbd"
  Configurable features
                    Documentation: YES
            system-mode emulation: YES
              user-mode emulation: NO

                      block layer: YES
                    Install blobs: YES
                   module support: YES
          alternative module path: NO
                   plugin support: NO
                  fuzzing support: NO
                    Audio drivers:
                   Trace backends: dtrace
                    QOM debugging: NO

Comment 1 Lili Zhu 2021-07-13 06:36:27 UTC
Fo

Comment 2 Klaus Heinrich Kiwi 2021-07-13 15:34:10 UTC
This bug report looks odd.

 * Why are we testing qemu-6.0.0 on RHEL-8 (non-AV)?
 * Was this testcase successful before (where?)
 * can you run qemu with '-audio-help' and check the available drivers?
 * Is package qemu-audio-pa installed?

Thanks,

 -Klaus

Comment 3 Lili Zhu 2021-07-13 23:22:33 UTC
(In reply to Klaus Heinrich Kiwi from comment #2)
> This bug report looks odd.
> 
>  * Why are we testing qemu-6.0.0 on RHEL-8 (non-AV)?
>  * Was this testcase successful before (where?)
>  * can you run qemu with '-audio-help' and check the available drivers?
>  * Is package qemu-audio-pa installed?
> 
> Thanks,
> 
>  -Klaus

Comment 4 Lili Zhu 2021-07-14 01:22:54 UTC
(In reply to Klaus Heinrich Kiwi from comment #2)
> This bug report looks odd.
> 
>  * Why are we testing qemu-6.0.0 on RHEL-8 (non-AV)?
Sorry about mistaking the product, the product has been changed to "RHEL-av"

>  * Was this testcase successful before (where?)
I did not test this testcase before, this case was introduced by an RFE of libvirt.
Please refer to Bug #1788807. So I have no idea of the situation before.


>  * can you run qemu with '-audio-help' and check the available drivers?
# /usr/libexec/qemu-kvm -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=none,driver=none

>  * Is package qemu-audio-pa installed?
I did not find qemu-audio-pa rpm build of rhel or centos.

Please help to check. Thanks

Comment 5 Klaus Heinrich Kiwi 2021-07-14 20:11:53 UTC
(In reply to Lili Zhu from comment #4)
> (In reply to Klaus Heinrich Kiwi from comment #2)
> > This bug report looks odd.
> > 
> >  * Why are we testing qemu-6.0.0 on RHEL-8 (non-AV)?
> Sorry about mistaking the product, the product has been changed to "RHEL-av"
> 
> >  * Was this testcase successful before (where?)
> I did not test this testcase before, this case was introduced by an RFE of
> libvirt.
> Please refer to Bug #1788807. So I have no idea of the situation before.

I'm having a hard-time connecting the dots here.. There was a blog-post by Gerd showing that libvirt now supports the new standardized '-audiodev' argument to qemu, instead of the old -audio xxx.

Then that created a Bugzilla to bring that support to libvirt downstream (why? how was that decided?)

And then it created the testcase which resulted in this bug...

But so far, I haven't seen any evidence that even 'qemu -audio xxxx' was ever supported to begin with..

> 
> >  * can you run qemu with '-audio-help' and check the available drivers?
> # /usr/libexec/qemu-kvm -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=none,driver=none
> 
> >  * Is package qemu-audio-pa installed?
> I did not find qemu-audio-pa rpm build of rhel or centos.
> 
> Please help to check. Thanks

The command above shows that the are no audio drivers compiled.. I couldn't find the build logs for this package to confirm that was by design (I strongly believe it is) - Daniel, is this something you can point us to?

And for posterity / education purposes, where can we find the latest compose + build logs from each individual package? I tried browsing brew for them but couldn't find qemu-kvm-6.0.0-23.module+el8.5.0+11740+35571f13.x86_64


Thanks

Comment 6 Danilo de Paula 2021-07-15 14:10:18 UTC
https://brewweb.engineering.redhat.com/brew/packageinfo?packageID=18283

You add qemu-kvm into the package search in brew and it should show up.
I can definitely see that particular qemu-kvm build from there.
You click on it and you should have access to the build log and etc.

About the audio driver: Yes, we're disabling the audio driver list in build time.
See http://pkgs.devel.redhat.com/cgit/rpms/qemu-kvm/tree/qemu-kvm.spec?h=stream-av-LP-rhel-8.5.0-advanced-virt
It's been this way for the whole RHEL-8 release: http://pkgs.devel.redhat.com/cgit/rpms/qemu-kvm/tree/qemu-kvm.spec?h=stream-8.1-LP-rhel-8.1.0-advanced-virt
So I don't think this was ever different. I'm wondering if this test case ever worked.

Answering some other questions: qemu-audio-pa is not available downstream.

Last but not least, by opening the "virtualization features supported in RHEL" I don't see any reference to audio there.

So the question that remains: Did this ever work? If no, and if not supported, do we actually have PM ack to add this feature?

Comment 7 Klaus Heinrich Kiwi 2021-07-15 14:40:26 UTC
(In reply to Danilo Cesar Lemes de Paula from comment #6)
> https://brewweb.engineering.redhat.com/brew/packageinfo?packageID=18283
> 
> You add qemu-kvm into the package search in brew and it should show up.
> I can definitely see that particular qemu-kvm build from there.
> You click on it and you should have access to the build log and etc.
> 

Thanks, I was having issues with brew's search function. I was able to find the package if I search for a 'build' with the particular string, stripped from arch.
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1658391

> About the audio driver: Yes, we're disabling the audio driver list in build
> time.
> See
> http://pkgs.devel.redhat.com/cgit/rpms/qemu-kvm/tree/qemu-kvm.spec?h=stream-
> av-LP-rhel-8.5.0-advanced-virt
> It's been this way for the whole RHEL-8 release:
> http://pkgs.devel.redhat.com/cgit/rpms/qemu-kvm/tree/qemu-kvm.spec?h=stream-
> 8.1-LP-rhel-8.1.0-advanced-virt
> So I don't think this was ever different. I'm wondering if this test case
> ever worked.
> 
> Answering some other questions: qemu-audio-pa is not available downstream.
> 
> Last but not least, by opening the "virtualization features supported in
> RHEL" I don't see any reference to audio there.
> 
> So the question that remains: Did this ever work? If no, and if not
> supported, do we actually have PM ack to add this feature?

I guess it's safe to say that we don't support this scenario. We can continue the conversation (here or on virt-devel) but I'll close this issue for now.


Note You need to log in before you can comment on or make changes to this bug.