Discussion:
Can't get audio, host Debian, guest NetBSD, help!
(too old to reply)
Ottavio Caruso
2022-03-17 14:36:28 UTC
Permalink
Forwarded over to netbsd-users@, in case you can help.

---------- Forwarded message ---------
From: Ottavio Caruso <ottavio2006-***@yahoo.com>
Date: Thu, 17 Mar 2022 at 14:35
Subject: Can't get audio, host Debian, guest NetBSD, help!
To: qemu-discuss <qemu-***@nongnu.org>


I am playing with audio and I know that the syntax has changed.

I have a NetBSD 9.2/amd64 guest that I have tried launching like this:

#!/bin/sh
/home/oc/git/qemu/build/qemu-system-x86_64 \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image,index=0,media=disk \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image.old,index=1,media=disk \
-M q35,accel=kvm -m 500M -cpu host -smp $(nproc) \
-nic user,hostfwd=tcp:127.0.0.1:5555-:22,model=virtio-net-pci,ipv6=off \
-device intel-hda -device hda-duplex \
-serial mon:telnet:127.0.0.1:6665,server,nowait \
-pidfile /home/oc/VM/pid/netbsd-pid

See the " -device intel-hda -device hda-duplex " line? I am not sure
if this is enough, but I can see the audio device in the guest:

dmesg|grep -i audio

[ 1.040426] audio0 at eap0: playback, capture, full duplex
[ 1.040426] audio0: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for playback
[ 1.040426] audio0: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for recording
[ 1.040426] spkr0 at audio0: PC Speaker (synthesized)
[ 1.040426] hdaudio0 at pci0 dev 5 function 0: HD Audio Controller
[ 1.040426] hdaudio0: interrupting at msi0 vec 0
[ 1.040426] hdafg0 at hdaudio0: vendor 1af4 product 0022
[ 1.040426] audio1 at hdafg0: playback, capture, full duplex, independent
[ 1.040426] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for playback
[ 1.040426] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for recording
[ 1.040426] spkr1 at audio1: PC Speaker (synthesized)
[ 2.227379] audio2 at auich0: playback, capture, full duplex, independent
[ 2.227379] audio2: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for playback
[ 2.227379] audio2: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for recording
[ 2.244061] spkr3 at audio2: PC Speaker (synthesized)

I have also tried the old syntax:

-soundhw all

With similar output in dmesg but no audio forwarded to host.

Any help will be appreciated.

--
Ottavio Caruso

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
RVP
2022-03-17 20:50:50 UTC
Permalink
Post by Ottavio Caruso
See the " -device intel-hda -device hda-duplex " line? I am not sure
[...]
[ 1.040426] audio1 at hdafg0: playback, capture, full duplex, independent
[ 1.040426] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for playback
[ 1.040426] audio1: slinear_le:16 2ch 48000Hz, blk 1920 bytes
(10ms) for recording
[ 1.040426] spkr1 at audio1: PC Speaker (synthesized)
Looks like audio HW you want to use is at audio1 rather than audio0.
Does `audiocfg test 1' produce any output?

-RVP



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
RVP
2022-03-18 20:17:29 UTC
Permalink
It does not produce any sound through qemu but it generates an output on
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 4000, 48000 }
testing channel 0... done
testing channel 1... done
Strange that audio0 is index 1. You'll have to find out what index
corresponds to the HDA card to perform the test. Do:

audiocfg list

-RVP

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ottavio Caruso
2022-03-19 10:30:59 UTC
Permalink
Post by RVP
It does not produce any sound through qemu but it generates an output on
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 4000, 48000 }
testing channel 0... done
testing channel 1... done
Strange that audio0 is index 1. You'll have to find out what index
audiocfg list
$ audiocfg list
0: [ ] audio2 @ auich0: ICH AC97 0x01
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, 8000-48000Hz
1: [*] audio0 @ eap0: Ensoniq AudioPCI
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 4000, 48000 }
2: [ ] audio1 @ hdafg0: vendor 1af4 product 0022
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 16000, 22050, 32000, 44100,
48000, 88200, 96000 }


Any clue?


--
Ottavio Caruso

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
RVP
2022-03-19 12:09:33 UTC
Permalink
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 16000, 22050, 32000, 44100,
48000, 88200, 96000 }
Test 2--hdafg.

-RVP


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ottavio Caruso
2022-03-19 14:23:50 UTC
Permalink
Post by RVP
playback: 2ch, 48000Hz
record: 2ch, 48000Hz
(PR) slinear_le 16/16, 2ch, { 16000, 22050, 32000, 44100,
48000, 88200, 96000 }
Test 2--hdafg.
I'll do that in the future, as in a moment of extreme rage, I nuked the VM.

I also converted the qemu image into a .vdi image and tried to boot it
under Virtualbox, but it was spitting major errors, so this is
something that I'll have to put on hold.
Thanks for the help anyway.

PS: All of your emails go into the spam folder.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Michael van Elst
2022-03-19 17:42:12 UTC
Permalink
Post by Ottavio Caruso
#!/bin/sh
/home/oc/git/qemu/build/qemu-system-x86_64 \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image,index=0,media=disk \
-drive if=virtio,file=/home/oc/VM/img/netbsd.image.old,index=1,media=disk \
-M q35,accel=kvm -m 500M -cpu host -smp $(nproc) \
-nic user,hostfwd=tcp:127.0.0.1:5555-:22,model=virtio-net-pci,ipv6=off \
-device intel-hda -device hda-duplex \
-serial mon:telnet:127.0.0.1:6665,server,nowait \
-pidfile /home/oc/VM/pid/netbsd-pid
See the " -device intel-hda -device hda-duplex " line? I am not sure
The -audiodev option is missing that tells qemu how to talk to the
host audio system.

The NetBSD guide has a chapter about emulation and proposes the
'oss' backend, see:

https://www.netbsd.org/docs/guide/en/chap-virt.html#chap-virt-qemu-audio

'oss' and also the 'sdl' backend both seem to work somewhat,
but here qemu was much too slow to drive an audio stream,
the result was pretty noisy.

Also, audio usually requires proper timing. For a NetBSD
host this means that it needs to run a kernel with a higher
HZ value than the guest.



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...