target_devicehint(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

okay bestie, real talk: this one's from the Arcan Lua API and it's a whole multitasker πŸ’…

✨ NAME ✨

target_devicehint β€” change connection- and device- use for a frameserver connection πŸ¦‹

✨ SYNOPSIS ✨

nil
target_devicehint( vid:dsrv, number:device )
target_devicehint( vid:fsrv, string:target )
target_devicehint( vid:fsrv, string:target, bool:force(=false) )

✨ DESCRIPTION ✨

okay so this function literally serves several uses and honestly it's giving main character energy with how many hats it wears πŸ‘‘

Use case number one: forwarding a device handle to an accelerated client πŸŽ€ This happens when you pass the device argument and it matches a valid card identifier. If you hand it an invalid identifier tho? no big deal, the call just gets interpreted as a mode hint, periodt.

The mode argument can also be specified as a device-use hint. Bestie, previously this was used to indicate whether the client should produce a buffer for direct output on the device in question β€” but that's now done heuristically as part of map_video_display calls. So the valid values now are:

  • DEVICE_INDIRECT β€” for composed rendering πŸ’–
  • DEVICE_LOST β€” this one says the currently used GPU should be dropped and, if possible, revert to software-defined graphics πŸ’€

The other uses are with a string target. This is what you use to indicate a connection point to another arcan-shmif capable server ✨ The default vibe is to mark this as a hint: 'in the event of the main connection being lost, please go here' 🫢

If the force argument is also set, the connection may be forcibly severed to make the client switch to the specified connection point 😭 The target string is assumed to match the valid rules for a connection point, but if the association is not forced, an empty string is also valid and will be interpreted as disabling a previously set alternate connection. iconic.

There are two special forms to the target string:

  • the a12:// and a12s:// prefix β€” this will involve the arcan-net tool to connect to a server 🌈
  • the @ or @host suffix β€” like mytag@. This will use keystore tags to find outbound connection parameters πŸ”‘

These forms will also provide the fsrv vid access to a keystore capability πŸ‘‘


✨ NOTES ✨

  1. The keystore access is currently the same as the one handed to the arcan process. Bestie, this may be changed in the future πŸ‘€
  2. If the forced target migration mode is used on a frameserver launched in an authoritative mode via define_avfeed or similar functions, the process tracking will be disabled and the kill 'guarantee' on delete_image will be lost 😭 for real, keep that in mind.
lowkey important: note 2 is the one that'll bite you 🫢

✨ EXAMPLE ✨

function target_devicehint0()
      target_alloc("devicehint", function(source, status)
            if (status.kind == "connected") then
                  target_devicehint(source, "devicehint", true); -- send fallback path
                  target_devicehint(source, 0); -- send rendernode
            end
      end);
end

and that's the whole page, bestie πŸ’– this came to you from targetcontrol, dated October 2026, and it's all target_devicehint(3) energy. slay, go write some frameservers πŸŽ€βœ¨

πŸ“¦ where this page comes from