Re: How am I supposed to use the -audiodev option?

2019-10-29 Thread _
After scouring through sources and commit logs, I was able to figure it out.

To direct both the pc speaker and an ac97 device to the host's alsa:

qemu ... \
-audiodev alsa,id=1 -global isa-pcspk.audiodev=1 -soundhw pcspk \
-audiodev alsa,id=2 -device AC97,audiodev=2

Setting the same audiodev= for both the pcs speaker and the sound card
results in the last part of the beep being played again when the sound
card is opened.

Unlike the argument to -soundw which is a lowercase "ac97", the
argument to device should be an uppercase "AC97"

> No matter what I try, it keeps slapping me on the face with a
> "audiodev default parameter is deprecated, please specify
> audiodev=foo" warning:

Actually, though this is not documented anywhere, it's the -soundhw
option which is kind of deprecated, as mentioned in this commit:
https://git.qemu.org/?p=qemu.git;a=commit;h=af2041ed2d6

> Also, the documentation is as obtuse as humanly possible, and gives
> no hints whatsoever to how to emulate multiple sound cards and direct
> them to different backends.

With two soundcards, one of them redirected to a wav file:

qemu .. \
-audiodev alsa,id=1 -global isa-pcspk.audiodev=1 -soundhw pcspk \
-audiodev alsa,id=2 -device AC97,audiodev=2 \
-audiodev wav,id=3,path=/tmp/qemu.wav -device AC97,audiodev=3



Re: How am I supposed to use the -audiodev option?

2019-10-27 Thread Alex John
I use 

-audiodev pa,id=pa1,server=`pactl info | grep 'Server String' | awk '{print 
$3}'`

On a gentoo system without systemd. The arch wiki has more information under 
PCI pass through. 


> On 27 Oct 2019, at 7:23 PM, Lukas Straub  wrote:
> 
> On Sun, 27 Oct 2019 07:35:23 +0200
> _  wrote:
> 
>> No matter what I try, it keeps slapping me on the face with a
>> "audiodev default parameter is deprecated, please specify
>> audiodev=foo" warning:
>> 
>> $ qemu -soundhw ac97 -audiodev alsa,id=alsa
>> audio: Device ac97: audiodev default parameter is deprecated, please
>> specify audiodev=alsa
>> $ qemu -audiodev alsa,id=alsa -soundhw ac97
>> audio: Device ac97: audiodev default parameter is deprecated, please
>> specify audiodev=alsa
>> 
>> Of course, trying to specify anything like "audiodev=alsa" anywhere
>> results in an error. And omitting either the -audiodev or the -soundhw
>> option results in no sound in the guest.
>> 
>> I'll have to either grit my teeth or use the "deprecated"
>> 
>> QEMU_AUDIO_DRV=alsa qemu -soundhw ac97
>> 
>> and try to forget about it.
>> 
>> Also, the documentation is as obtuse as humanly possible, and gives
>> no hints whatsoever to how to emulate multiple sound cards and direct
>> them to different backends.
>> 
> 
> From qemu's manpage:
> 
>   -audio-help
>   Will show the -audiodev equivalent of the currently specified
>   (deprecated) environment variables.
> 
> $ qemu-system-x86_64 -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=pa,driver=pa
> -audiodev id=alsa,driver=alsa
> -audiodev id=oss,driver=oss
> -audiodev id=none,driver=none
> 


Fwd: How am I supposed to use the -audiodev option?

2019-10-27 Thread _
this should've gone to the list, sorry

On Sun, Oct 27, 2019 at 1:23 PM Lukas Straub  wrote:
> > No matter what I try, it keeps slapping me on the face with a
> > "audiodev default parameter is deprecated, please specify
> > audiodev=foo" warning:
> >
> > $ qemu -soundhw ac97 -audiodev alsa,id=alsa
> > audio: Device ac97: audiodev default parameter is deprecated, please
> > specify audiodev=alsa
> From qemu's manpage:
...
> $ qemu-system-x86_64 -audio-help
...
> -audiodev id=alsa,driver=alsa

This is not answering the question: "-audiodev id=alsa,driver=alsa" is
absolutely identical to "-audiodev alsa,id=alsa" and

qemu -soundhw ac97  -audiodev id=alsa,driver=alsa

will generate the same spurious warning.

I'm using the latest git qemu, if this makes any difference.



Re: How am I supposed to use the -audiodev option?

2019-10-27 Thread Lukas Straub
On Sun, 27 Oct 2019 07:35:23 +0200
_  wrote:

> No matter what I try, it keeps slapping me on the face with a
> "audiodev default parameter is deprecated, please specify
> audiodev=foo" warning:
> 
> $ qemu -soundhw ac97 -audiodev alsa,id=alsa
> audio: Device ac97: audiodev default parameter is deprecated, please
> specify audiodev=alsa
> $ qemu -audiodev alsa,id=alsa -soundhw ac97
> audio: Device ac97: audiodev default parameter is deprecated, please
> specify audiodev=alsa
> 
> Of course, trying to specify anything like "audiodev=alsa" anywhere
> results in an error. And omitting either the -audiodev or the -soundhw
> option results in no sound in the guest.
> 
> I'll have to either grit my teeth or use the "deprecated"
> 
> QEMU_AUDIO_DRV=alsa qemu -soundhw ac97
> 
> and try to forget about it.
> 
> Also, the documentation is as obtuse as humanly possible, and gives
> no hints whatsoever to how to emulate multiple sound cards and direct
> them to different backends.
> 

From qemu's manpage:

   -audio-help
   Will show the -audiodev equivalent of the currently specified
   (deprecated) environment variables.

$ qemu-system-x86_64 -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=pa,driver=pa
-audiodev id=alsa,driver=alsa
-audiodev id=oss,driver=oss
-audiodev id=none,driver=none



How am I supposed to use the -audiodev option?

2019-10-27 Thread ""
No matter what I try, it keeps slapping me on the face with a
"audiodev default parameter is deprecated, please specify
audiodev=foo" warning:

$ qemu -soundhw ac97 -audiodev alsa,id=alsa
audio: Device ac97: audiodev default parameter is deprecated, please
specify audiodev=alsa
$ qemu -audiodev alsa,id=alsa -soundhw ac97
audio: Device ac97: audiodev default parameter is deprecated, please
specify audiodev=alsa

Of course, trying to specify anything like "audiodev=alsa" anywhere
results in an error. And omitting either the -audiodev or the -soundhw
option results in no sound in the guest.

I'll have to either grit my teeth or use the "deprecated"

QEMU_AUDIO_DRV=alsa qemu -soundhw ac97

and try to forget about it.

Also, the "documentation" is as obtuse as humanly possible, and gives
no hints whatsoever to how to emulate multiple sound cards and direct
them to different backends.



How am I supposed to use the -audiodev option?

2019-10-27 Thread _
No matter what I try, it keeps slapping me on the face with a
"audiodev default parameter is deprecated, please specify
audiodev=foo" warning:

$ qemu -soundhw ac97 -audiodev alsa,id=alsa
audio: Device ac97: audiodev default parameter is deprecated, please
specify audiodev=alsa
$ qemu -audiodev alsa,id=alsa -soundhw ac97
audio: Device ac97: audiodev default parameter is deprecated, please
specify audiodev=alsa

Of course, trying to specify anything like "audiodev=alsa" anywhere
results in an error. And omitting either the -audiodev or the -soundhw
option results in no sound in the guest.

I'll have to either grit my teeth or use the "deprecated"

QEMU_AUDIO_DRV=alsa qemu -soundhw ac97

and try to forget about it.

Also, the documentation is as obtuse as humanly possible, and gives
no hints whatsoever to how to emulate multiple sound cards and direct
them to different backends.