Friday, November 24, 2023

xmlrpc on rtorrent

rotorrent could use xmlrpc to send command remotely without any ui interface.

  • how to setup xmlrpc support (link, link2 )
    • configure scgi port on rtorrent.rc
    • install nginx and setup location for scgi and configure same scgi port from rtorrent.rc
    • rtorrent from Archlinux has dependency (libxmlrpc from http://xmlrpc-c.sourceforge.net/). there is binary application in this package to send xmlrpc command to rtorrent
  • xmlrpc basic
    • xmlrpc is specification for request sent to client (link)
    • xmlrpc has scalar (int,boolean, string, double), struct (dictionary), array. 
    • xmlrpc binary command convert command parameter into request. Different binary command has different command parameter but request is same.
    • for xmlrpc (http://xmlrpc-c.sourceforge.net/), it need to escape ":" as "\:" since ":" is separator for struct. (link ). The parenthesis, brace, comma, colon, and backslash characters are special. If you want to include one in a string value, escape it with a backslash.
  • usag
    • "2838954B0BBB1A87A668308DCC08AAF56D83D20D" is infohask for one rtorrent.
    • "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t0" is tracker1 for one rtorrent.

    • xmlrpc localhost system.listMethods
    • xmlrpc localhost system.methodHelp t.id
    • xmlrpc localhost load.normal "magnet:?xt=urn:btih:59066769B9AD42DA2E508611C33D7C4480B3857B&dn=ubuntu-17.04-desktop-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce"

    • xmlrpc localhost download_list
    • xmlrpc localhost d.is_open 2938964B0BAB1A87A668308DCC08AAF56D83C20D
    • xmlrpc localhost d.state <hash>
    • xmlrpc localhost d.chunk_size 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.size_files  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.size_chunks  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.size_bytes  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.completed_chunks  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"
    • xmlrpc localhost d.complete 2838954B0BBB1A87A668308DCC08AAF56D83D20D

    • xmlrpc localhost d.ratio 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.down.total 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.down.rate 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.up.total 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost d.up.rate 2838954B0BBB1A87A668308DCC08AAF56D83D20D

    • xmlrpc localhost p.multicall 2838954B0BBB1A87A668308DCC08AAF56D83D20D p.id

    • xmlrpc localhost d.tracker.insert 2838954B0BBB1A87A668308DCC08AAF56D83D20D 0 "udp\://tracker.openbittorrent.com\:80"
    • xmlrpc localhost d.tracker.insert 2838954B0BBB1A87A668308DCC08AAF56D83D20D 1 "udp\://tracker.opentrackr.org\:1337/announce"
    • xmlrpc localhost d.tracker_size 2838954B0BBB1A87A668308DCC08AAF56D83D20D
    • xmlrpc localhost t.id <hash>
    • xmlrpc localhost t.is_open "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t1"
    • xmlrpc localhost t.id "2838954B0BBB1A87A668308DCC08AAF56D83D20D\:t0"

    • xmlrpc localhost f.multicall  "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B"  "*"  f.path=
    • xmlrpc localhost f.frozen_path "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"
    • xmlrpc localhost f.path "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f3"
    • xmlrpc localhost f.completed_chunks "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"
    • xmlrpc localhost f.size_bytes "BBAB39AF48A4BD6FD23F1CCA39246A3E9D22F76B\:f2"

WSL with gpu accelerator and webgpu

GPU accelerator on WSL need WDDM 2.9 (link ). Windows 10 support WDDM from 20H2 (link) but Intel driver only support WDDM > 2.9 from Windows 11 (link). You could use "dxdiag" to check WDDM version on your windows.

My laptop is Intel GPU + Windows 10. Intel driver doesn't support WDDM v2.9 or later on Windows 10 but it is OK on Windows 11. It means WSL couldn't support GPU accelerator on Windows 10.

If you want to use webgpu under wsl2, use following chrome command since webgpu on chrome only support vulkan now according to Chrome ships WebGPU

  • "--enable-unsafe-webgpu --enable-features=Vulkan --use-vulkan=swiftshader" 
  • "This initial release of WebGPU is available in Chrome 113 on ChromeOS devices with Vulkan support, Windows devices with Direct3D 12 support, and macOS. Linux, Android, and expanded support for existing platforms will come soon."