您尚未登录。

#1 2020-03-03 17:56:35

yorks.yang
会员
注册时间: 2013-01-26
帖子: 31

qemu-kvm+spice guest(win10) 声音怎么用弄的?

Host的环境
OS archlinux

yorks /data/vms/win10 $ qemu-system-x86_64 --version
QEMU emulator version 4.2.0
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

yorks /data/vms/win10 $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

启动的脚本

qemu-system-x86_64 -enable-kvm \
    -machine type=pc,accel=kvm -smp 1,cores=1,threads=1  \
	-drive file=${sysIMG},index=0,media=disk,format=qcow2,if=virtio \
    -boot order=c \
    -net nic,model=virtio -net user,smb=/tmp/swap/ \
    -usb -device usb-tablet \
    -rtc base=localtime \
    -m 1024M \
    -device qxl-vga,max_outputs=1 \
    -spice port=7001,password=***** -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent \
    -device ich9-usb-ehci1,id=usb \
    -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on \
    -device ich9-usb-uhci2,masterbus=usb.0,firstport=2 \
    -device ich9-usb-uhci3,masterbus=usb.0,firstport=4 \
    -chardev spicevmc,name=usbredir,id=usbredirchardev1 \
    -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
    -chardev spicevmc,name=usbredir,id=usbredirchardev2 \
    -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
    -chardev spicevmc,name=usbredir,id=usbredirchardev3 \
    -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 \
    -soundhw ac97 \
    -audiodev spice,id=snd0 \
    -daemonize  

现在的问题是,每次在guest里面 播放声音 remote-view 就直接coredump

(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.054: New spice channel 0x564ced33c4b0 SpiceDisplayChannel 0
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.054: New spice channel 0x564ced88c3e0 SpiceCursorChannel 0
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.054: New spice channel 0x564ced8922d0 SpiceRecordChannel 0
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.054: New spice channel 0x564ced892500 SpicePlaybackChannel 0
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.055: new audio channel
(remote-viewer:13788): GSpice-WARNING **: 17:38:37.060: PulseAudio context failed Connection refused
(remote-viewer:13788): GSpice-WARNING **: 17:38:37.060: pa_context_connect() failed: Connection refused
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.060: New spice channel 0x564ced88c600 SpiceInputsChannel 0
(remote-viewer:13788): virt-viewer-DEBUG: 17:38:37.061: new inputs channel
...

(remote-viewer:13788): GSpice-WARNING **: 17:44:31.429: Failed to create pipeline: no element "autoaudiosink"
Segmentation fault (core dumped)

离线

页脚