Re: [Spice-devel] How to check if the spice-streaming-agent workscorrectly
hi, @lhrazky host: qemu-kvm: 1.5.3 spice-server: 0.13.3 spcie-protocol: 0.12.12 client: remote-view: Virtual Machine Viewer 5.0-256(run in win7) ./src/spice-streaming-agent.ccp:static int have_something_to_read(int timeout) { struct pollfd pollfd = {streamfd, POLLIN, 0}; if (poll(, 1, timeout) < 0) { printf("have_something_to_read return -1\n"); return -1; } if (pollfd.revents == POLLIN) { printf("have_something_to_read return 1\n"); return 1; } printf("have_something_to_read return 0\n"); return 0; } debug info: spice-server(0.13.3) , have_something_to_read alway return 0, "printf("have_something_to_read return 0\n");" Lastest git master, have_something_to_read does not return anything, It seems that cannot continue to execute。 @uril > Try adding an id to the virtio-serial-pci device, e.g. > -device virtio-serial-pci,id=virtio-serial0 I add an id to the virtio-serial-pci device, it can fix "Bus 'virtio-serial0.0' not found" BR. -- Original -- From: "Lukáš Hrázký"<lhra...@redhat.com>; Date: Mon, Apr 23, 2018 05:15 PM To: "孙得霖"<kong.de...@embedway.com>; "spice-devel"<spice-devel@lists.freedesktop.org>; Subject: Re: [Spice-devel] How to check if the spice-streaming-agent workscorrectly On Mon, 2018-04-23 at 15:48 +0800, 孙得霖 wrote: > Hello, I have some difficulties with spice-streaming-agent, can you help me. > > > when I run spice-streaming-agent, it can not > read_command(have_something_to_read always return 0). > ./src/spice-streaming-agent.ccp:static int have_something_to_read(int timeout) > { > struct pollfd pollfd = {streamfd, POLLIN, 0}; > > > if (poll(, 1, timeout) < 0) { > syslog(LOG_ERR, "poll FAILED\n"); > return -1; > } > > > if (pollfd.revents == POLLIN) { > return 1; > } > > > return 0; > } > > > system(centOS-7.2): > # uname -a > Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 > UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > cpuinfo:Intel(R) Xeon(R) CPU E3-1245 v6 @ 3.70GHz > > > > > Steps as follows: > 1.host command line: > /usr/libexec/qemu-kvm -m 1024 -name f15 -drive > file=/root/centos-base.img,if=virtio -vga qxl -spice > port=5900,disable-ticketing -net nic,macaddr=00:A1:00:00:00:1A -net > tap,script=/etc/qemu-ifup \ > -device virtio-serial-pci -device > virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 > -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 > > > Bus 'virtio-serial0.0' not found, So I delete "bus=virtio-serial0.0"(is it > right?) > /usr/libexec/qemu-kvm -m 1024 -name f15 -drive > file=/root/centos-base.img,if=virtio -vga qxl -spice > port=5900,disable-ticketing -net nic,macaddr=00:A1:00:00:00:1A -net > tap,script=/etc/qemu-ifup \ > -device virtio-serial-pci -device > virtserialport,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 > -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 > > > 2.start VM and install spice-streaming-agent: > ./autogen > make -j 8 > make install > > > # ls /dev/virtio-ports/ > org.spice-space.stream.0 > > > 3.run spice-streaming-agent > > > Have some questions: > 1.spice-streaming-agent can not read_command, I don't know the reason for the > failure. > 2.How to check if the spice-streaming-agent works correctly(encode stream and > send it to client) Seems like nothing is writing to the port on the other side. Are you sure you are using a version of spice-server that supports the streaming agent? Lastest git master would probably be the best. Cheers, Lukas > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] How to check if the spice-streaming-agent works correctly
Hello, I have some difficulties with spice-streaming-agent, can you help me. when I run spice-streaming-agent, it can not read_command(have_something_to_read always return 0). ./src/spice-streaming-agent.ccp:static int have_something_to_read(int timeout) { struct pollfd pollfd = {streamfd, POLLIN, 0}; if (poll(, 1, timeout) < 0) { syslog(LOG_ERR, "poll FAILED\n"); return -1; } if (pollfd.revents == POLLIN) { return 1; } return 0; } system(centOS-7.2): # uname -a Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux cpuinfo:Intel(R) Xeon(R) CPU E3-1245 v6 @ 3.70GHz Steps as follows: 1.host command line: /usr/libexec/qemu-kvm -m 1024 -name f15 -drive file=/root/centos-base.img,if=virtio -vga qxl -spice port=5900,disable-ticketing -net nic,macaddr=00:A1:00:00:00:1A -net tap,script=/etc/qemu-ifup \ -device virtio-serial-pci -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 Bus 'virtio-serial0.0' not found, So I delete "bus=virtio-serial0.0"(is it right?) /usr/libexec/qemu-kvm -m 1024 -name f15 -drive file=/root/centos-base.img,if=virtio -vga qxl -spice port=5900,disable-ticketing -net nic,macaddr=00:A1:00:00:00:1A -net tap,script=/etc/qemu-ifup \ -device virtio-serial-pci -device virtserialport,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 2.start VM and install spice-streaming-agent: ./autogen make -j 8 make install # ls /dev/virtio-ports/ org.spice-space.stream.0 3.run spice-streaming-agent Have some questions: 1.spice-streaming-agent can not read_command, I don't know the reason for the failure. 2.How to check if the spice-streaming-agent works correctly(encode stream and send it to client)___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] not clear how to use streaming agent
Hello, Thanks for your response, you are right,I am using Intel vGPU and running a Windows7 guest. So I am not clear how to using streaming-agent in Window 7 guest. Next I will try linux as the guest. Intel provides a dma-buf of the host at 30ms intervals(the dma-buf is full-screen size), spice-server's commands tree is used for video stream detection. My idea is capture guest video stream(use plugin) and send to client direct, do not use spice-server's commands tree for video stream detection.At present, it is in the pre-research stage. BR. -- Original -- From: "Uri Lublin"<u...@redhat.com>; Date: Mon, Apr 16, 2018 07:45 PM To: "孙得霖"<kong.de...@embedway.com>; "spice-devel"<spice-devel@lists.freedesktop.org>; Subject: Re: [Spice-devel] not clear how to use streaming agent On 04/12/2018 05:37 AM, 孙得霖 wrote: > hi, > I use spice for remote view, I want to captures the guest video > output, encodes it and send through, so I choose streaming agent, how to > build and run it is not clear, can you help me? > > 1.host environment and Software version: > centOS(Mini install) > GVT-g kernel: https://github.com/intel/gvt-linux/ (branch: > topic/dmabuf) > QEMU: https://github.com/intel/igvtg-qemu (branch: qa/dma_buf) > streming agent:https://gitlab.com/spice/spice-streaming-agent > spice-server version:0.13.3 > spice-protocol version:0.12.12 > > 2.build info > kernel: > make -j 8 > make modules_install && make install > reboot > > qemu: > ./configure --prefix=/usr --enable-kvm --disable-xen --enable-debug-info > --enable-debug --enable-sdl --enable-vhost-net --enable-spice > --disable-debug-tcg --enable-numa --enable-libusb --enable-curl > --enable-usb-redir --enable-linux-aio --target-list=x86_64-softmmu > --enable-gtk --with-gtkabi=3.0 > make -j 8 > cd roms/seabios > make -j 8 > cd - > make install > cp roms/seabios/out/bios.bin /usr/bin/bios.bin > > spice-protocol: > ./configure --prefix=/usr > make -j 8 > make install > > spice-service: > ./configure --prefix=/usr --enable-manual=no --disable-silent-rules > --disable-smartcard --disable-celt051 --enable-client CFLAGS="-g -O0" > CXXFLAGS="-g -O0" > make -j 8 > make install > > streming agent > ./autogen.sh > make -j 8 > make install > > 3.run qemu > /usr/bin/qemu-system-x86_64 \ > -m 8192 \ > -smp 4,sockets=1,cores=4,threads=1 \ > -M pc \ > -name win71 \ > -hda /Image/vm/win7_base.img \ > -bios /usr/bin/bios.bin -enable-kvm \ > -k en-us \ > -vga none \ > -display egl-headless \ > -spice disable-ticketing,port=6901,streaming-video=off \ > -machine kernel_irqchip=on,usb=on \ > -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 \ > -cpu host -device usb-tablet \ > -device > vfio-pci,sysfsdev=/sys/bus/pci/devices/:00:02.0/5b8d581a-2dc9-11e8-8238-000906258002,x-display=on,x-igd-opregion=on > -device > virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 > > -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 > > questions: > I am not clear How to use streaming agent and validate it, can you help me? Hello, So, you are using Intel vGPU and running a Windows 7 guest. Theoretically, spice-streaming-agent can do what you want, run on the guest to capture the video and send it via SPICE to the client. But, currently spice-streaming-agent is written for Linux guests. So first you'd need to make it work on Windows (for example the virtio-serial port name is different on Windows guests, cursor handling is different (can be disabled at first)). Also you need a spice-streaming-agent-plugin. The mjpeg plugin is one example (it too is written for Linux). Look at Snir's experimental gst-plugin [1] as another example. Possibly there exists a gstreamer src to capture windows screen and x264 would work on Windows too. You may want to use hardware encoding if possible. If Intel provides a dma-buf of the host, it may be even better to do it from the spice-server somehow, similar to what's done with virgl (requires code-modifications). When you have these written, you'd need We'll be happy to know if you make progress or if you need more help (and of course if you send patches :-) Uri.___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Spice-devel] not clear how to use streaming agent
Thank you for the compliment. "[1] https://www.linux-kvm.org/page/SPICE; is what I want. At first, I running Windows 7 as the guest, not clear how to use streaming agent. Next I will try CentOS as the guest. now spice-server deal with stream like In the future, I want to send video stream to client direct, and decode in client side. Thank you so much for all the help that you had given me! BR. -- Original -- From: "Lukáš Hrázký"<lhra...@redhat.com>; Date: Mon, Apr 16, 2018 04:20 PM To: "孙得霖"<kong.de...@embedway.com>; "spice-devel"<spice-devel@lists.freedesktop.org>; Subject: Re: [Spice-devel] not clear how to use streaming agent On Mon, 2018-04-16 at 10:33 +0800, 孙得霖 wrote: > Hi, > Thanks for your response.it is first time to communicate in English,to be > frank, my English is not very good and there may be points expressed poorly > in my reply. I hope you will pardon me for this. Your english is very good, don't worry (比我汉语更好 ;)). However, the information you provide is not what I asked, see below. > I want to capute guest video stream(encode it) and to client with spice > protocol direct (like above figure ),at present, it is in the stage of > technical pre-research. > So my question is, can i use streaming agent to capture guest video stream > and encode it? That you want to capture the video and send it to the client is too vague and low-level. What do you want to use it for, the high-level use case? SPICE alone without the streaming agent can do what you are describing, you should probably start with that: Install SPICE from your distribution packages, follow a guide like [1], there are some more information in [2]. If you know you need more than regular SPICE can offer, please describe it. Cheers, Lukas [1] https://www.linux-kvm.org/page/SPICE [2] https://www.spice-space.org/spice-user-manual.html > > -- Original -- > From: "Lukáš Hrázký"<lhra...@redhat.com>; > Date: Fri, Apr 13, 2018 07:24 PM > To: "孙得霖"<kong.de...@embedway.com>; > "spice-devel"<spice-devel@lists.freedesktop.org>; > > Subject: Re: [Spice-devel] not clear how to use streaming agent > > > Hello Delin, > > On Thu, 2018-04-12 at 10:37 +0800, 孙得霖 wrote: > > hi, > > I use spice for remote view, I want to captures the guest video output, > > encodes it and send through, so I choose streaming agent, how to build and > > run it is not clear, can you help me? > > Sure, first off, what exactly do you want to achieve? If you just want > to remotely access your VM (see the graphical desktop and interact with > it), you don't need the streaming agent for that, SPICE can do that for > a long time without it. > > Streaming agent is designed for a very specific case of capturing and > encoding the desktop from within the guest, which only has an advantage > to the regular old SPICE approach if you have a physical GPU or a vGPU > assigned to the guest to accelerate the process. > > If you still think streaming agent is what you need, please describe in > detail what is your use case. > > > 1.host environment and Software version: > > centOS(Mini install) > > GVT-g kernel: https://github.com/intel/gvt-linux/ (branch: > > topic/dmabuf) > > QEMU: https://github.com/intel/igvtg-qemu (branch: qa/dma_buf) > > streming agent:https://gitlab.com/spice/spice-streaming-agent > > spice-server version:0.13.3 > > spice-protocol version:0.12.12 > > > > > > 2.build info > > kernel: > > make -j 8 > > make modules_install && make install > > reboot > > > > > > qemu: > > ./configure --prefix=/usr --enable-kvm --disable-xen --enable-debug-info > > --enable-debug --enable-sdl --enable-vhost-net --enable-spice > > --disable-debug-tcg --enable-numa --enable-libusb --enable-curl > > --enable-usb-redir --enable-linux-aio --target-list=x86_64-softmmu > > --enable-gtk --with-gtkabi=3.0 > > make -j 8 > > cd roms/seabios > > make -j 8 > > cd - > > make install > > cp roms/seabios/out/bios.bin /usr/bin/bios.bin > > > > > > spice-protocol: > > ./configure --prefix=/usr > > make -j 8 > > make install > > > > > > spice-service: > > ./configure --prefix=/usr --enable-manual=no --disable-silent-rules > > --disable-smartcard --disable-celt051 --enable-client CFLAGS="-g -O0" > > CXXFLAGS="-g -O0" > > make -j 8 > > make install > > > > > > streming agent > > ./autoge
Re: [Spice-devel] not clear how to use streaming agent
Hi, Thanks for your response.it is first time to communicate in English,to be frank, my English is not very good and there may be points expressed poorly in my reply. I hope you will pardon me for this. I want to capute guest video stream(encode it) and to client with spice protocol direct (like above figure ),at present, it is in the stage of technical pre-research. So my question is, can i use streaming agent to capture guest video stream and encode it? -- Original -- From: "Lukáš Hrázký"<lhra...@redhat.com>; Date: Fri, Apr 13, 2018 07:24 PM To: "孙得霖"<kong.de...@embedway.com>; "spice-devel"<spice-devel@lists.freedesktop.org>; Subject: Re: [Spice-devel] not clear how to use streaming agent Hello Delin, On Thu, 2018-04-12 at 10:37 +0800, 孙得霖 wrote: > hi, > I use spice for remote view, I want to captures the guest video output, > encodes it and send through, so I choose streaming agent, how to build and > run it is not clear, can you help me? Sure, first off, what exactly do you want to achieve? If you just want to remotely access your VM (see the graphical desktop and interact with it), you don't need the streaming agent for that, SPICE can do that for a long time without it. Streaming agent is designed for a very specific case of capturing and encoding the desktop from within the guest, which only has an advantage to the regular old SPICE approach if you have a physical GPU or a vGPU assigned to the guest to accelerate the process. If you still think streaming agent is what you need, please describe in detail what is your use case. > 1.host environment and Software version: > centOS(Mini install) > GVT-g kernel: https://github.com/intel/gvt-linux/ (branch: topic/dmabuf) > QEMU: https://github.com/intel/igvtg-qemu (branch: qa/dma_buf) > streming agent:https://gitlab.com/spice/spice-streaming-agent > spice-server version:0.13.3 > spice-protocol version:0.12.12 > > > 2.build info > kernel: > make -j 8 > make modules_install && make install > reboot > > > qemu: > ./configure --prefix=/usr --enable-kvm --disable-xen --enable-debug-info > --enable-debug --enable-sdl --enable-vhost-net --enable-spice > --disable-debug-tcg --enable-numa --enable-libusb --enable-curl > --enable-usb-redir --enable-linux-aio --target-list=x86_64-softmmu > --enable-gtk --with-gtkabi=3.0 > make -j 8 > cd roms/seabios > make -j 8 > cd - > make install > cp roms/seabios/out/bios.bin /usr/bin/bios.bin > > > spice-protocol: > ./configure --prefix=/usr > make -j 8 > make install > > > spice-service: > ./configure --prefix=/usr --enable-manual=no --disable-silent-rules > --disable-smartcard --disable-celt051 --enable-client CFLAGS="-g -O0" > CXXFLAGS="-g -O0" > make -j 8 > make install > > > streming agent > ./autogen.sh > make -j 8 > make install > > > 3.run qemu > /usr/bin/qemu-system-x86_64 \ > -m 8192 \ > -smp 4,sockets=1,cores=4,threads=1 \ > -M pc \ > -name win71 \ > -hda /Image/vm/win7_base.img \ > -bios /usr/bin/bios.bin -enable-kvm \ > -k en-us \ > -vga none \ > -display egl-headless \ > -spice disable-ticketing,port=6901,streaming-video=off \ > -machine kernel_irqchip=on,usb=on \ > -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 \ > -cpu host -device usb-tablet \ > -device > vfio-pci,sysfsdev=/sys/bus/pci/devices/:00:02.0/5b8d581a-2dc9-11e8-8238-000906258002,x-display=on,x-igd-opregion=on > -device > virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 > -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 Are you running Windows 7 as the guest? The streaming agent is designed to run in the guest and only supports Linux atm. Cheers, Lukas > questions: > I am not clear How to use streaming agent and validate it, can you help me? > > thank you! > ___ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/spice-devel 36F9F50A@027AA01A.8E0BD45A Description: Binary data ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] not clear how to use streaming agent
hi, I use spice for remote view, I want to captures the guest video output, encodes it and send through, so I choose streaming agent, how to build and run it is not clear, can you help me? 1.host environment and Software version: centOS(Mini install) GVT-g kernel: https://github.com/intel/gvt-linux/ (branch: topic/dmabuf) QEMU: https://github.com/intel/igvtg-qemu (branch: qa/dma_buf) streming agent:https://gitlab.com/spice/spice-streaming-agent spice-server version:0.13.3 spice-protocol version:0.12.12 2.build info kernel: make -j 8 make modules_install && make install reboot qemu: ./configure --prefix=/usr --enable-kvm --disable-xen --enable-debug-info --enable-debug --enable-sdl --enable-vhost-net --enable-spice --disable-debug-tcg --enable-numa --enable-libusb --enable-curl --enable-usb-redir --enable-linux-aio --target-list=x86_64-softmmu --enable-gtk --with-gtkabi=3.0 make -j 8 cd roms/seabios make -j 8 cd - make install cp roms/seabios/out/bios.bin /usr/bin/bios.bin spice-protocol: ./configure --prefix=/usr make -j 8 make install spice-service: ./configure --prefix=/usr --enable-manual=no --disable-silent-rules --disable-smartcard --disable-celt051 --enable-client CFLAGS="-g -O0" CXXFLAGS="-g -O0" make -j 8 make install streming agent ./autogen.sh make -j 8 make install 3.run qemu /usr/bin/qemu-system-x86_64 \ -m 8192 \ -smp 4,sockets=1,cores=4,threads=1 \ -M pc \ -name win71 \ -hda /Image/vm/win7_base.img \ -bios /usr/bin/bios.bin -enable-kvm \ -k en-us \ -vga none \ -display egl-headless \ -spice disable-ticketing,port=6901,streaming-video=off \ -machine kernel_irqchip=on,usb=on \ -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 \ -cpu host -device usb-tablet \ -device vfio-pci,sysfsdev=/sys/bus/pci/devices/:00:02.0/5b8d581a-2dc9-11e8-8238-000906258002,x-display=on,x-igd-opregion=on -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel1,id=channel1,name=org.spice-space.stream.0 -chardev spiceport,name=org.spice-space.stream.0,id=charchannel1 questions: I am not clear How to use streaming agent and validate it, can you help me? thank you!___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel