mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-21 12:29:43 -10:00
codex/android-native-streaming
314
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fd17192acb |
formats: no file I/O - image_texture's path loaders go through streams/
formats/image_texture.c loaded images by path through the data_transfer file adapter. Its four path loaders (image_texture_load, _load_ex, _load_request, _load_request_ex) move to streams/image_texture_file.c, declared in streams/image_texture_file.h, the same split data_transfer, cdfs and the DVD reader got. The names and behaviour are unchanged; callers include the new header. formats/image_texture.c keeps the buffer decoders and makes image_texture_load_buffer_probe public so the adapter can reach it. image_texture_load_set stays in formats/image_texture_set.c: it does no file I/O of its own, and gfx_surface_still tests it against a stubbed load_request. griffin, Makefile.common, the companion test scripts and the sample Makefiles that build the loaders add streams/image_texture_file.c; the overlay task sample, which stubs image loading, does not. |
||
|
|
68b07f6a1a |
formats: no file I/O - data_transfer, cdfs and the DVD file reader go through streams/
data_transfer reads only through its reader callback. The path entry points keep their names, data_transfer_open_prefix and data_transfer_open_window, in streams/data_transfer_file.c (<streams/data_transfer_file.h>), which opens the file through filestream, reads it at offsets and closes it with the transfer; data_transfer_open_prefix_reader and data_transfer_set_release are the core's side of that. cdfs reads only through the stream a track holds. cdfs_open_track, cdfs_open_data_track and cdfs_open_raw_track are in streams/cdfs_file.c (<streams/cdfs_file.h>); the length-based sector probe they use is cdfs_track_sector_size_from_length. rdvd_vfs, which binds files to the DVD source, and rdvd_stream, which drives it, are streams/rdvd_vfs.c and streams/rdvd_stream.c, their headers under <streams/>. cdfs_file_test covers the path openers: a cooked iso and a raw bin sized by length, a cue sheet resolving its bin beside it, an INDEX 01 offset, the data track, refusals. |
||
|
|
cec7ea5aae |
udev: fix touchscreen pointer press, release and slot handling
The touchscreen pointer is pressed while any contact is down and released when the last one lifts, and the pointer device answers X, Y and pressed. A multi-touch panel is read by its MT slots only: the kernel's single-touch emulation (ABS_X/ABS_Y/BTN_TOUCH) repeats the oldest contact and is ignored there. A single-touch panel keeps its contact in slot 0, the slot index starts at the kernel's unannounced slot 0, a slot resync recounts the held contacts, and panel positions are taken from the axis minimum. Regression lane: samples/input/udev_touch drives the real driver with an in-memory multi-touch and single-touch panel. Closes #20060 |
||
|
|
56952c9a25 |
Android: follow-up fixes for screens on other displays (gl and vulkan) (#20044)
* rgui: upload the menu again to the video driver a reinit makes Closing content with RGUI up left the screen black until a key press. The staged content load presents frames between its stages, so RGUI can upload its framebuffer to the old video driver and clear FB_DIRTY just before the driver stage replaces that driver. The new one has no menu texture, nothing in the menu changes, and RGUI never uploads again. command_event_reinit sets FB_DIRTY after its reinit, but the staged load and video-only resets reach the menu only through context_reset, so RGUI marks its framebuffer dirty there. The menu_icon_ownership harness gets an rgui lane that reinits the video driver and checks the next upload reaches the new one. * video: draw a frame queued before a view count shrink with its views Under threaded video the wrapper ran SET_VIEW_COUNT ahead of the frame it had already claimed, so a closing core's last queued frame drew after its view chains were gone: whole, both screens stacked, until the menu's first frame replaced it. The wrapper still answers at once, but a smaller count reaches the driver only once the frames queued before it have drawn. A grow applies at once as before, with the main thread waiting for the preset parse. Vulkan and glcore therefore build view chains only when the count grows, so a deferred shrink never parses a preset. They also keep the headset's whole-frame chain across a count change: it does not depend on the count, and with chains built only on a grow nothing would rebuild it after a shrink to 0. * android: don't make a second screen's EGL surface once Java took it back Java can take the second screen's surface back between the poll that hands it over and the frame that makes its EGL surface. Skip making one then; the screens go back to the main window as they do when a make fails. Java can still take the surface back during the make itself; the node's own ANativeWindow reference keeps the window alive through that. * android: ask a display move by display id and number it A move named its display by its place in the list, and Java looked that up later on the UI thread against whatever list was newest, so a display coming or going in between could send RetroArch elsewhere. Java now gets the display id and fails the move when that display is gone. Native code now counts the ids when it compares display lists, so a display unplugged and plugged back is a new list and its failures clear. A failure was a bare flag, so one move's failure could end the next move and mark its display unable. Each move now carries a number and a failure counts only for the move it names. The move code also loses two stores that were always overwritten. * android: end the refocus hold after a move only when it is done A move onto a display that is no longer valid now fails at once instead of waiting out its timeout. The hold that keeps RetroArch's window unfocusable after a move ends only on the focus loss Android answers it with, not on a gain that was already queued; an earlier hold ends only once the new move has started; and onStop() ends a running hold rather than leaving it to its timer. * video_windows: tell an external monitor by its display type Android lists the AYN Thor's two panels and a DP monitor with the same unknown connection type, so Auto took the monitor for a second panel: on a one-screen phone Game Screen 2 went to it. Java now reads the hidden Display.getType() by reflection where it can and passes internal or external with each display. A display typed internal is never a monitor; where the type is unknown, a non-default display with an unknown connection and a product name now counts as one. * video: give a Presentation on another display its own UI wait The menu waits up to a second for the Presentation it is laid out for to show, but the wait was only counted from the first one. Once a Presentation had shown, one made on another display had no wait left and the menu fell back to the main window at once. * input: keep the menu's mouse where it was while the menu is in a window With Mouse Support on, the menu moving into the Presentation read as a mouse move to (0,0) for a frame, which marks the pointer active there. The view keeps the main window's last mouse position instead. * input: match a window's touches only from a windowed publication A publication without windows after one with them left the old window ids in place, so a window's touch lookup could still match them. Only touches published in a window match now. No Android path publishes that way today. * vulkan: copy a waiting window's views on a new frame A screen window that was up but had no free image on a new frame did not get its views copied, so a later repeat that drew it, as a pause with the menu there does, left black areas where those views go. They are copied on every new frame now. * video: load the idle logo from the assets directory without widgets The idle logo's path came from the widgets, which only start with On-Screen Notifications on, so with them off the idle window stayed black. Without the widgets' path it is built from the assets directory the way the widgets build it. * android: hold the focus when Android moves RetroArch between displays When the display RetroArch is on, or moving to, goes away, Android moves the Activity to the default display and can send that display's focus gain before the removed display's loss. A task moved to another display and straight back gets no configuration change, and can read the old display's loss last too. With the loss last, RetroArch pauses while Android keeps it focused, and no later focus event wakes it. Count these as moves, as RetroArch's own moves are: a removal, and any change of RetroArch's display it did not ask for. From Android 10, with more than one display, so is losing and regaining the top-resumed place while focused, or regaining it unfocused within a second of losing it after a loss no hold asked for. The refocus hold that covers a move's late loss then covers these too: the window is made unfocusable until Android has taken the focus, then gets the gain again. A gain already on its way skips the hold, and a move marked while RetroArch is focused ends after a second with no focus event. * samples: close test gaps in video_windows and android_focus The is_default check set the flag and read it back, so it could not fail; Auto's fallback to the default display now shows the flag at work. Cover a display listed without an ordinal, and display keys at sizes 0 to 3, two unnamed displays and a 63-character name. Drop a stale note from android_focus_test's header. * video: fix wording left over from the display rows The Screen Display sublabel still named the Separate mode, a setting the display rows removed; it now says "when it has a window of its own". The warnings for a screen window that can't be drawn, or whose surface is gone, said its screens go back to the main window, but a window that shows only the menu reaches them too. They now read like the one for a window that can't be made: what it shows stays in the main window. Comments that no longer matched the code are reworded. pointer_frame's model of the driver before the publication is named was_* rather than today_*, and a wrong commit hash and a plan tag go from the tests. video_driver_free_internal() uses VIDEO_ANDROID_RELEASE_KEPT_WINDOWS() rather than open-coding it, with no change in behaviour. |
||
|
|
7ddff7122e |
input: the drivers with touches write them into the frontend's places
Raw input, DirectInput, Wayland, SDL3 and Android built their touches on the stack at each poll and the frontend copied them in, Wayland sixteen of them every poll whether or not any screen was touched. They write the places the frontend lends them now. |
||
|
|
a47190c550 |
input: a bind's capture reads a checked controller's buttons at once
The capture read a controller's 219 buttons one call at a time every frame. For a driver the snapshot bridge has checked to answer get_buttons() as it does button(), one call now writes them all where the capture keeps them; any other driver is read as before. |
||
|
|
6c08a56bd0 |
menu: a bind's capture reads the keys at once and keeps its state as bits
The capture asked the input driver about each key by itself, 315 calls a frame. It now asks once, through keys_down, which writes straight into the bits the capture keeps; a driver without keys_down is read as before. The keys, buttons and mouse buttons are bits now, so a port's state goes from 666 bytes to 148 and the two frames kept from 21.3 KB to 4.7 KB. A press is found a word at a time. |
||
|
|
801182903b |
input: the drivers with one mouse write it into the frontend's frame too
SDL, DirectInput, Wayland, win32 and Android built their mouse on the stack at each poll and the frontend copied it in. They write the frame it lends them now, as X11 and raw input do. |
||
|
|
917e193c96 |
input: X11 and raw input write their mice into the frontend's frames
The two drivers with several mice built them on the stack at each poll and the frontend copied them into its own. They now write the frontend's frames in place, lent by input_driver_pointers_lend(), and publishing them copies nothing. The drivers with one mouse keep their copy of it. |
||
|
|
8079860f4b |
samples: add bind_capture regression test
bind_capture_test runs the shipping capture from input_driver.c and menu_driver.c: mouse buttons from a published pointer frame and from a driver that keeps a mouse per pad, and a user on another user's controller slot binding with their mouse and pad. The hotkey-sharer case guards the controller-slot meaning of the bind state's port; it passes on master. |
||
|
|
0108ade537 |
input: a pointer read walks a port's users only while the laser points
With OpenXR built, every RETRO_DEVICE_POINTER and LIGHTGUN read walked the core port's users to gather their slots before asking the headset, which answers false at once whenever its laser does not drive a core's pointer - nearly always without a headset. The headset is now asked first whether it does, and the walk is skipped when not. openxr_input_test checks the answer with the laser off and on. |
||
|
|
188534011c |
input: the poll makes the Plays As join again only after a change
Every poll made the join - which user's controller plays as which player - for every user, and compared it with the last one. It is made from the Plays As entries, the controllers' claims and names, Max Users and the users' Device Index, none of which a frame changes. The poll now makes it only when one of them moved since it last did: input_plays_as_gen, which already moved for most changes to entries, also moves wherever a claim, an Auto player, a share or a controller's name is written, and the two settings are compared with what the poll last saw. mapped_port_test checks after each poll that the join kept is the one the poll would make; a poll that never makes it again fails there in 25 places, 52 with OpenXR. Callgrind, frontend_overhead input lane: the join's 3.7M instructions a run are gone. |
||
|
|
74eaf88787 |
input: a core port's rumble writes each pad once
With two users on the same pad (Device Index) and the same core port, the rumble flush wrote that pad's motor once for each user: two driver writes, an ioctl or a HID transfer each, for one frame's value. A mask of the pads written skips the repeat. mapped_port_test covers it. |
||
|
|
5756db8659 |
Input: Plays As, several controllers on one player, with hotkeys of their own (#19916)
* OpenXR: the controllers' slots are not read from the driver's view
A joypad driver that keeps its pads' state lends it to the snapshot
bridge through view(), and the bridge reads that in place of a copy
(
|
||
|
|
d94e1409cd |
android: publish the mouse and every touch to the frontend
The touches on the main window and on the second display go to the frontend's pointer publication each poll, raw, each with the window it is in, and the publication answers the pointer, the screen pointer, the second display's pointer and a lightgun aimed by touch. The mouse stays the driver's: its motion and wheel are taken by each read, as before. Every answer is as it was; the pointer_frame test checks each one the publication gives against the driver's own answers before this change. Three things differ. Binds to the mouse's left, right and middle buttons now work: they never fired on Android. And a touch is placed at the first read after the poll instead of as its event came, so a finger held still while the viewport changes follows the change at once. And a tap on a main window that shows no screen is on nothing: it fires no lightgun button there, while a tap in the letterbox still does. |
||
|
|
1e0f4db5d9 |
input: let a driver keep its own pointer answers
Android's input driver is to publish its touches and mouse through the frontend's pointer publication, so that each touch carries the window it came from, without changing any answer a core or the menu gets from it. Five flags let a driver ask for that, and change nothing for the drivers that publish today: a touch pressed only inside what it is read against; touches in a screen's own window as a second list; the mouse answered by the driver, whose motion and wheel go with each read; touch indices as slots that keep their place, with no mouse standing in; and pointer ids the frontend does not hold left to the driver. The publication also holds 32 touches, and gives the menu a touch in its own window over that window's client area. |
||
|
|
78dda5539e |
android: drop the second display's key relay and focus count
The second display's Presentation never has the focus now, so it never receives a key or a stick move and never reports a focus change. Its key and motion relay, the ring that carried them to native code, its focus commands and its part in the focus count go: RetroArch's focus is its Activity's, as before the second display existed. |
||
|
|
a9ac154855 |
windows_wine_smoke: move the focus with SetForegroundWindow
Both focus-lost lanes have failed since ubuntu-latest moved to 26.04 and Wine 10, and waiting longer for the release did not help: RetroArch's window never lost the focus. With no window manager, Wine 10 hands the activation straight back to the window it holds as the foreground when xdotool clicks another one, so RetroArch got no WM_KILLFOCUS and GetForegroundWindow() still named it. A front.exe helper now calls SetForegroundWindow() on the window being given the focus, alongside the click. On 26.04's Wine 10 the two lanes fail without it and pass with it, and the whole script passes. |
||
|
|
270c49dcbd |
windows_wine_smoke: wait for the release when the focus is lost
Both focus-lost lanes failed in one run with the core seeing B pressed and never released. The lane closed RetroArch 1.5 s after giving the other window the focus, and the release reaches the core only on its next poll after Wine hands the focus over, which a loaded runner can take past that. It now watches the log for the release, for at most 15 s, before closing. |
||
|
|
e78097a6ca |
Wii HID: the unplug lane waits for the whole reap
The reap closes the device after deinitialising the pad, so the lane waits for the close as well before checking it, rather than reading the close count while the worker is between the two. |
||
|
|
f8b15a976d |
joypad_connection: a retiring slot parks for its last reader
Retiring a pad's slot closes its gate and waits for the readers still inside; it waited by yielding in a loop. It now parks on an eventcount that the last reader out of a closed slot notifies, so the thread retiring a pad (a HID driver's worker, or the main thread at teardown) sleeps until the slot is empty. A live slot's readers never notify. samples/input/connection_gate holds a reader inside while the slot is retired and requires the retiring thread to park; a build without the eventcount must fail. |
||
|
|
261128405c |
Wii HID: the worker's wake count is atomic
Readers, control messages and teardown all bump the worker's futex word from their own threads; with a plain increment two of them could land as one and the worker would sleep through a wake until its next scan. The count is an atomic, and the futex waits on its word. samples/input/gekko_hid now runs in CI under ASan and TSan, which caught the plain increment. |
||
|
|
65225e1d2c |
Wii HID: take pads away without sleeping
A pad that leaves is asked to stop and its reader cancelled; the worker asks again on every pass, since a cancel only returns a transfer already waiting, and reaps the pad once the reader says it is done. No thread sleeps for it. A driver freed while a reader still waits leaves the pad to that reader, which frees it when its transfer returns. The driver itself is freed by the last of it and the readers still running, so a late reader no longer touches a freed driver. samples/input/gekko_hid runs the driver against os/gekko stand-ins: unplugging while the reader waits, with its cancel lost, and freeing the driver under a waiting reader; a build that asks only once must fail. |
||
|
|
6ebf66b643 |
OpenXR: per-screen placement for headset screens, and Edit Screens to arrange them by hand (#19945)
* video: per-screen geometry for the headset's floating screens Each floating screen, by the core's logical screen id, gets its own offsets, yaw, pitch, roll, scale and visibility (video_screen_xr_t), applied on top of where the layout puts it. video_views_xr_reset gives the defaults and video_views_xr_normalize clamps each value to its range: offsets to 10 m either way, angles to 180 degrees, scale from 0.1 to 10. A planner given no screens uses the defaults, so nothing moves until a setting does. * configuration: save per-screen headset geometry video_screen<N>_xr_x, _y, _z, _yaw, _pitch, _roll, _scale and _visible keep each floating screen's adjustments for screen ids 1 to 8, and survive configuration overrides like the other video settings. A minimal save writes only the values that differ from the defaults. The video_screens settings sample checks the round trip and the override cases, and runs in the OpenXR input and Wine views jobs. The defaults fixture now links video_views.c, which the reset uses. * menu: per-screen controls for the headset's floating screens Stereo 3D & Screens gains Screen, which picks a floating screen by its logical id among those in the current frame's map, and for it Horizontal, Vertical and Depth Offset, Yaw, Pitch, Roll, Scale and Visible, with Reset Screen and Reset All Screens. The rows apply live and are hidden where they cannot apply, such as a tracked projection's eyes. Stepping between screens reads one snapshot of the map and is bounded, so a tracking change mid-step cannot leave it walking an empty map. docs/openxr.md describes the controls; the video_screens sample drives them through the shipping menu actions. * video: apply per-screen headset geometry to the frame snapshots Each XR planner, Vulkan's and GL's, takes the normalized screen settings with the frame snapshot, so a screen moves, turns, scales or hides as its rows change, while paused too; recentering and tracked projections are unaffected. Screen images are kept between frames, so shader feedback survives a placement change. A retained XR target that cannot be allocated is skipped quietly, remembered by its size so it is not retried every frame; only the desktop UI and canvas targets log the failure. Covered by openxr_core_test, the video_screens sample, the e2e runner's feedback shader case and the new vulkan_views_target sample. * android: keep the OpenXR EGL context C89 gl_xr_egl_init declared its extension string after statements. * video: pose inverse, layout spots and grab maths for headset edit mode Each item's layout spot comes from one helper that placement uses and the quad set records per slot, so a shown pose turns back into the settings that placed it. Grab maths: the item follows the aim, level unless tilting, offsets clamped to the settings' range; the stick pushes along the ray and resizes. Edit picking sees every item and takes the menu by a handle bar under it. * video: a frame without a view map is screen 1 in the headset A core without a views map (SNES, say) had no screen to select, so its frame could not be moved. Its whole frame now takes screen 1's offsets, turn, scale and visibility, and the selector lists Screen 1. gl's window stays as laid out while the menu is open over it. * video: the headset's menu in front of screen 1, or where it was put The menu sat at a fixed spot, so moving screen 1 closer left the menu behind it. It now floats 10 cm in front of screen 1, facing as it does, at its default angular size and never nearer than 0.4 m, while screen 1 floats and shows, and is still submitted after the screens. A menu place (video_openxr_menu_xr_* with video_openxr_menu_placed) overrides that; it is saved like the per-screen keys, and Reset All Screens clears it. * input: Edit Headset Screens mode for the OpenXR controllers Edit Screens starts from a hotkey, a headset action, the HEADSET_EDIT_SCREENS command or a Stereo 3D & Screens row, and stops on the same, on opening the menu, on a video reinit or when the session ends. It syncs its own action set in place of the game's, points the lasers at every item whatever the Laser Pointer setting, keeps the menu's quad up while editing, and with While Editing Screens set to Pause pauses only content that was running. A runtime that refuses its bindings keeps the game's and leaves edit mode unavailable. The setting reaches the headset's poll with the others, and the pause and resume are asked of the frontend as platform requests, so the input driver issues no command and takes no settings itself. A Laser Pointer value past its choices, which a hand-edited config can hold, reads as Auto rather than as edit mode's. * input: grab, tilt, push and resize headset screens in edit mode A grip on an item takes it in the screens' frame: it keeps its pose relative to the hand, stays level unless the trigger is held, and the stick pushes it along the laser and resizes it, past a deadzone. Each poll writes the item's offsets, turn and scale where the menu's rows write them, through named frontend calls, clamped so it waits at a limit and resumes from there. The menu is taken by its handle; a menu that follows screen 1 is placed as large as it shows. The main button resets a free item as Reset Screen does, or puts the menu back in front of screen 1. A recenter, a screen leaving the map and leaving edit mode let go, counted for the frame snapshot; an untracked hand holds its item still. * openxr: held screens follow the hand at the headset's rate The main thread publishes what each hand holds through a seqlock; each headset frame re-places a held item, both eyes of a stereo screen, from that frame's own aim, so it no longer waits for the next video frame. An item let go stays where the hand left it until a quad set planned at or after its release (an edit count carried in the frame snapshot) shows it, even once the hand holds another item, so nothing steps back. Lazy Follow holds its glide while anything is held. Edit mode outlines every item, brightly the one under a laser, and draws the menu's handle bar under it, from the laser's image, now an atlas of the dot, two outlines and two handle bars. They take only the layers the screens leave after the dots. * openxr: edit mode end-to-end cases and documentation The test layer's aim can roll, and the e2e runner drives edit mode against Monado: grabs that follow the hand on every headset frame and stay where they are let go, level and tilt, the stick, resets of a screen and of the menu, the menu taken by its handle and following Screen 1 at its size, outlines and the handle, a no-map core, a views core's fallback frame, Follow Head, Lazy Follow, recentering, two hands, pausing, and what starts and ends edit mode, including the headset's hotkey bits with no command interface. The cases whose work is a host's or driver's own run on glcore and gl too. docs/openxr.md explains editing screens in the headset and where the menu goes. * openxr: a laser beam from each controller to its dot A thin strip runs from each hand's aim to its dot, or 1.5 m into nothing, turned about its own axis each headset frame to face the head so it never shows edge on. It comes from the laser's image, so it needs no new swapchain, and uses layers left after the dots and edit mode's outlines, so it is the first to go when the runtime has few. The new Laser Beam setting shows it in edit mode only (the default), always, or never; outside edit mode, Laser Pointer and its hotkey hide it with the dot. * openxr: edit mode outlines in three bands, outside the item A light band between two dark ones shows on white, black and busy borders alike. The rim now sits wholly outside its item, 5 mm clear of it even after filtering, so it never covers the picture; its region grows to keep two texels a band at about the old thickness. Screens' outlines are submitted before the screens, so a neighbour placed flush covers the part of a rim over its picture, while the menu's outline and handle bar stay on top. The handle bar moves 5 mm below the menu's outline, which it would otherwise cover, and gets the same bands, faint and bright. * input: choose a headset edit item with Select Next and Previous Edit mode steps from the laser through the screens it can move and the menu. A chosen item is the one lit, either hand's grip takes it from wherever the hand is, and Reset resets it, so a screen hidden behind another can be moved. Whatever a hand holds stays lit. A ray on the menu's handle bar takes the menu before any screen in front of it. Within 3 cm of the bar, a ray that came from the bar keeps the menu even over a screen, and one that came from elsewhere takes it only where no screen is hit. * openxr: snap a held headset screen to the screens near it Snap to Screens, on by default, turns a held screen parallel or square to a nearby screen and lines up its plane, edges or centre. Each pull is exact within 3 cm or 5 degrees and fades out over as far again, so the screen catches up with the hand rather than jumping, and snapping fades in over the first 5 cm or 10 degrees after a grab, so taking a screen never moves it. With several screens near, the snap that leaves the least error wins, so a near screen's exact pull beats a far one's fading pull whatever their order. One stateless function inside the grab serves the main thread and the headset's thread, so a screen is saved where it was shown. The holding hand buzzes as a snap takes hold, once, and not again until the screen has left that pull. * input: turn a held headset item with the free hand's stick A quarter turn of a held screen needed the controller turned a quarter turn, which swung the screen round the hand on its long reach, so a square snap could not be reached. Now the stick of the hand holding nothing turns what the other hand holds about the vertical through its middle, faster the further it is pushed, and snapping still catches it parallel or square. A carried item keeps its pitch and roll and its angle to the way the hand points across the floor, so raising, lowering or twisting the hand no longer tips or swivels it; the trigger lets it ride the hand rigidly. * openxr: smooth the controller aim in edit mode A screen held about 2 m out on the laser magnified every tremor of the hand. In edit mode each hand's aim now goes through a One Euro filter, which smooths a slow hand hard and a fast one little, with its rate taken from the headset frame's own time step. The headset's thread filters once a frame and hands the result to the main thread, which grabs, moves and lets go from it, so a screen is saved where it was shown. The new Edit Smoothing setting picks Off, Low, Medium (the default) or High; outside edit mode the lasers are never smoothed. * openxr: name the chosen edit item beside the controller Edit mode now shows a faint tag just above the hand that last pressed Select Next or Previous, reading Laser, Screen N or Menu, so what the grip will take is plain without a notice. The words are drawn once into the laser's image in the default font and the interface language, light over a dark halo like the outlines so they read on any background, and the tag is one more headset layer; when the runtime is short of layers the beams are dropped before it. On a runtime whose swapchains are too narrow for the words, the laser's image keeps its old width and there is no tag. * input: tilt a held headset item with the free hand's stick In edit mode the free hand's stick already turns the item the other hand holds. Its up and down now tilt that item too, about the item's own left-right line through its middle, at the turn's rate and with no limit: up tips the top back, as when pushing a monitor's top back. It works whether the item is carried or rides the hand with the trigger held, and snaps as the turn does. Within about 25 degrees of left or right the stick only turns, and within about 25 degrees of up or down it only tilts, so a push meant for one does not drift into the other. Edit mode's starting notice lists the turn and tilt and stays about 8 seconds. * input: snap a turned or tilted headset item to angle steps While the free hand's stick turns or tilts a held item in edit mode, the item clicks into steps of the new Snap to Angles setting (15 degrees by default; 30, 45, 90 or Off), so it is easy to set straight. The turn counts from facing the user's head across the floor, the tilt from upright. Within about 2 degrees of a step the item holds there and the holding hand buzzes once; the stick's own angle keeps adding up, so pushing on leaves the step. Only the stick steps: carrying an item or tilting it with the trigger never clicks, and a snap to another screen that would engage wins over a step. * openxr: show the back of a headset screen turned away Runtimes draw only the front of a quad layer, so a screen or the menu turned away from the head vanished. When the head is behind a quad's plane, the frame now submits a plain dark panel in that quad's place: a solid grey cell of the laser's image, at the quad's size, turned to face the head. It takes the quad's own layer, so the layer count and cap are unchanged. Edit mode picks either face, so an item turned away stays grabbable, and its outline, handle and dot turn with its back. * input: keep a screen snap's angle once the free stick lets go A snap to another screen shows a held screen square or parallel to it, but the item's own angle stays where the stick or the hand took it, up to several degrees off. The next turn with the free hand's stick started from that hidden angle, so the screen left the snap early on one side, late on the other, and caught up with a lurch. Now, as the free stick returns to its deadzone and as a push starts, a snap engaged on the turn becomes the item's own angle: the carried turn, or the orientation the trigger tilts. A snap still fading in never does, since that would hop the screen into it. The place is left to the hand, and carrying alone never keeps the angle, so pointing still pulls a screen out of a snap. Letting go of the grip leaves the item where it shows, as before. * openxr: hinge a held headset screen to a neighbour's edge Snap to Screens now also hinges a held screen to another along a shared edge at any angle between them, so a DS or 3DS pair can be opened at a slant: an edge within 5 degrees of parallel to one of the other's, within 3 cm of its line and sharing some length with it, turns exactly parallel and moves onto it, centres or ends level, its angle left free. The pull fades in over the first 3 cm of shared length, so a screen slides off the end of the other's edge without a jump, and a diagonal neighbour never hinges. Screens that would overlap do not hinge; the pull is whole from flat to square and fades out folded shut. Flat and square snap as before and report a hinge at 0 and 90. A turn to the same screen pivots on the shared edge, so the edge stays on the line as the screen leaves flat or square. The snap still keeps nothing between calls; its result carries a hinge bit, and video_xr_snap_hinge also says which edge and line, for the stick to swing about. * input: swing a hinged headset screen about the shared edge While a held screen is hinged to another, the free hand's stick axis that turns nearest the shared edge, the tilt for a top or bottom edge and the turn for a side one, now swings it about that edge, so it stays attached; the other axis still turns or tilts it and can pull it off. Where the swing leaves it, angle and place, it stays as the stick lets go. Snap to Angles counts a hinged screen's steps from flat with the other screen. A hinge counts only while the screen's own edge is within its range, not when other snaps alone hold it on the line, so a swing never carries a screen round a line it is far from. A square corner is a side hinge at 90 degrees, so the turn stick there now swings the screen about the corner's edge. Main thread only; nothing new reaches the frame loop, which still shows the grab through video_xr_grab_pose. * openxr: leave a gap between hinged headset screens Edges that meet in edit mode, side by side, at a corner or hinged at any angle, now click to a set gap from within 1 cm and otherwise keep the gap the hand gives them, still hinged, up to 10 cm (letting go by 13). Screens no longer have to touch, which made them overlap. Each grab carries the gap, so the edit poll and the frame loop snap alike; until a setting sets it, it is 0. Pushed past touching, a hinged edge stops there for the first centimetre of the push, the stop fading out by 3 cm, and ticks once per push. A swing pivots on the held screen's own edge, so the gap keeps through it, and a commit keeps the hand's gap unless the click holds it. After a swing lets go past square, that stick axis and its steps keep pivoting on the same edge until the edge leaves the hinge's reach, so a flick past square and back does not creep. Of two neighbours within the 5 degree turn snap, the nearer edge wins the turn and the hinge, by one measure for every screen, so a screen stacked behind, one off the ends of the edge or a side wall at a corner never outranks a hinge the turn holds. * menu: add Hinge Gap for headset screens Hinge Gap (0, 1, 2, 3, 5 or 10 cm, default 2) sets the gap edit mode's Snap to Screens leaves between screens that meet edge to edge, side by side, at a corner or hinged. Edit mode takes it as it starts and gives it to each grab; the click to it buzzes like the other snaps. * menu: put Edit Screens under Headset Output Stereo 3D & Screens now lists Edit Screens and its snaps right under the switch that reveals them, then the headset's own setup, then where the screens go, with the per-screen rows last and Visible first among them. * openxr: track each held screen's hinge on the frame loop The frame loop already re-snaps each held screen every frame. It now also keeps, per hand, the hinge that snap holds whole, until the edge leaves the hinge's 4.5 cm reach, where the frame draws it, so edit mode can mark it. A kept hinge whose target no longer matches is dropped. video_xr gains the hinge line's ends, along the overlap of the two real edges and midway across the gap, an outline cut that drops one edge's rim, and a green strip in the laser's image, before the tags. * openxr: mark a hinged headset screen with a green line While a held screen's hinge holds, the two edges that meet drop their outline rim and a 6 mm green line runs along the hinge where they overlap, midway across the gap, so it is clear when the hinge has taken hold. The line is drawn as the beam is, a centimetre nearer the eye than the edges, since SteamVR does not keep the order of overlapping quad layers, and comes after the outlines in the layer budget; hidden rims cost no layer. * input: buzz longer as a headset screen hinges A hinge taking hold now gets one 150 ms buzz at 0.8 on the hand carrying the screen, against the 20 ms snap tick, so the attach can be felt. It fires again only after the edge leaves the hinge's reach, hinges elsewhere, or the other hand takes the screen it hinges on, so a swing past square and back does not repeat it. Ticks due while it plays are skipped rather than cutting it short. * openxr: find headset screens resting in a hinge Two screens no hand holds rest in a hinge when their poses pass the test that engages a carried screen's hinge, with either one carried, and the hinge, held whole with nothing else pulling, leaves the carried one where it is. So a hinge found at rest stays hinged when its screen is taken. The engaged test moves into its own function so both use the same one, and one target can pull whole whatever the grab's fade. * openxr: keep a headset screen's hinge shown at rest In Edit Screens, two screens no hand holds that rest in a hinge keep the green line and their hidden rims, whether let go hinged or loaded that way. The main thread counts them only when a resting screen changes and sends them with the hands' record, so a release and its resting pair arrive together; the frame loop places each line from the screens it shows. A screen hinged at rest on two adjacent edges still keeps one of those rims. The hands' record now outgrows the quads, so the seqlock's copy is sized to the larger of the two. * openxr: pick up a hinged headset screen still hinged Taking up a screen that rests in a hinge starts the carry on that hinge, whole from the first poll, with no buzz and no jump, until it leaves the hinge's reach, another hinge takes hold, or the other hand takes the screen it hinges on. Until the grab's own snapping has faded in, the kept hinge's target still pulls whole, so a straight pull out does not hop. The grab carries the hinge so both threads hold it the same; of several, the one the snap ranks best carries over, and only where holding it moves nothing. While the other screens fade in, the hinge's screen also leads the turn, so a nearer one still fading does not take it. * openxr: end a headset screen's hinge where a push passes the stop Pushing a hinged screen into its neighbour holds the edge at touching for 3 cm of push, fading out by 5.5 cm. Where it stops holding, the hinge ends: the line goes, the rims come back, and the lid and buzz are cleared, so screens pushed into each other show no hinge that a let-go there would not rest in. Pulled back, the hinge takes hold again 5 mm short of where it ended, with the long buzz, so a tremor there does not flicker it. The grab carries that through flag, and the frame loop keeps its line until the main thread sets it, so the two threads never disagree for more than a poll. At Hinge Gap 1 a pair let go touching rests hinged and is taken up hinged, as at every other gap. A screen swung into a square corner gets the long buzz on arrival, and the other hand taking the target does not hop the carried screen by the push's depth. * input: let go of a headset screen where it was before the grip opened Opening the grip twitches the hand, and the poll that sees the grip open would move the screen by that twitched aim. Half a degree of pitch moves a screen 1.8 m out by 1.6 cm, enough to knock it off its hinge's gap or out of level, so it would not rest hinged. Each hand keeps a short trail of where, turned and as large as its screen showed, entries at least 10 ms apart, and a grip let go puts the screen as it showed 80 ms before (INPUT_OPENXR_EDIT_REWIND_US), or as it was taken if held for less. Edit mode's end and a recenter let go where the screen shows. * openxr: find where a let-go headset screen settles in its hinge A screen let go while its hinge shows should land exactly in that hinge, so the hinge still shows at rest and a pick-up is hinged. video_xr_hinge_settle holds the hinge whole from the hand's pose, then moves the edge to the set gap from within 3 cm of it (touching stays where the stop holds it) and levels it along the edge within the level pull's reach. Its result must pass the rest test, and it turns no further than a grab's hinge engages, which shares that test. A pair resting inside a settle band but off its point is no longer listed at rest, since a pick-up and let-go would move it. A touching rest is taken 5 mm deeper into the push stop, at every Hinge Gap, so a hand that drifts less than that apart before letting go settles touching rather than at the gap. * openxr: settle a let-go headset screen into its hinge A screen let go while its hinge shows now goes exactly into that hinge: to the set gap from within 3 cm of it, touching from the stop's hold, and level along the edge from within the level pull's reach. It then rests there, listed and green, in the same publish, and is saved there. Elsewhere it stays where it shows, as before. Each trail entry also records where the hand put the screen with no snap and whether a let-go there settles. At the let-go the rewound entry is settled again against the screens as they are now, at that entry's size, and put in one go. * openxr: let a hinged headset screen rest at any fold Snap to Screens' turn to flat, and its turn to square at a corner, is whole within 5 degrees and fades out by 10, so a hinged screen held there shows at twice its angle off less 10. No fold shown in that fade read as a rest: the pair was not listed, a let-go there did not settle into its hinge, and taking it up would have moved it. Where a hand takes a rest, it now holds the screen at the angle the turn's fade shows it from, the inverse of the turn's pull, so every fold rests, is listed and is taken up unmoved. Held snapping is unchanged. * input: keep a headset screen's hinge through a shaking hand Edit Screens' hinge buzz, lid and push stop followed the snap's own engage and reach on every poll. A hand shaking half a degree (1.6 cm at the screen) about a hinge's edge flipped them many times a second, each flip a long buzz. Each hold now keeps one mark: the hinge a let-go would settle into. It takes hold at once, with the long buzz, and lets go only once polls have seen the hand out of where a let-go would settle for 150 ms, each poll counting at most 50 ms, so a stalled main thread or a spell untracked never lets it go alone. The other hand taking its target, hinged elsewhere or not, the target leaving and the let-go end it at once. The lid waits for the mark to go, the push stop follows it, and a let-go while it shows settles into it from where the hand last would have, edit mode's end and a recenter included. * openxr: draw a held screen's hinge as the main thread marks it The grab carries the main thread's hinge mark, and the frame loop draws a held screen's green line and cuts its rims from that mark alone, through video_xr_grab_marked, while it snaps the screen every frame. A frame loop taking the hinge by itself between polls would flicker the line for a hand shaking at the edge of the hinge's range while the mark held. A mark whose target the frame does not show cuts no rim. The other hand taking the mark's target ends it, and the lid, on any poll, tracked or not, so a lost hand's line does not come back when that hand lets go. video_xr_grab_near_hinge loses its past argument, which only the frame loop's keep used. * openxr: keep edit mode's hinge layers in place SteamVR does not keep submission order for overlapping quad layers, so a layer added, dropped or moved to another index can pop the edit outlines in front of the screens, as a wobble at a hinge would do to its line's layer. The hinge lines are fixed slots: one for each hand holding a screen, hand 0 first, then one for each pair at rest. A slot with no line to show is drawn in place from its screen's middle, at rows of the laser image that are empty either way up. The layer count and every index change only at a grab, a let-go or a re-count of the pairs at rest; a mark only changes crops and which rows a slot shows. * input: date a let-go's trail by frame and stop it at a stall Each trail entry is dated by the frame its aims are from, one a frame and per hand, and the release poll records a new frame's aims first. The rewind stops at a stall, entries more than 2.5 frames apart, a frame counted as at least 20 ms so a fast headset's close entries never read as one. Under load a stall of 0.1 to 0.3 s can come just before the release; the entry from 80 ms back would then hold the pose from before it and step the let-go back across all the stall's motion. With Edit Smoothing on, which damps the twitch, a let-go that does not settle into a hinge stays where and as large as it shows: a rewind there would step back by what the smoothed aim still lags. The hinge decision and the settle use the trail either way. * openxr: cut edit outlines from cells instead of turning them Cutting a top or bottom rim from the one outline image turns both outline quads a quarter turn and swaps their width and height, and on SteamVR that can blink every edit outline as the hinge takes hold or lets go; side cuts, which never turn, do not. The laser's image carries twelve pre-cut outline cells after the tags, faint and bright, for a cut top, bottom, left, right, top and bottom, or left and right, so a cut only picks a cell and the quads keep their pose and size. The image is then 5582 texels wide. A runtime whose swapchains are narrower, or that does not say how wide they can be, keeps the turned and cropped outline at 2498 or 1208 wide. One log line at the laser's creation gives the width chosen and the runtime's limit. GL writes the top and bottom cells swapped for its bottom-up rows, and Android's copy of the image is allocated rather than static. The edit-hinge-3ds-narrow e2e case runs the turned cut at RA_XR_LAYER_MAX_WIDTH=4096, on Vulkan and the GL EGL lanes. * video: draw headset screens straight into the runtime's images Each headset screen was drawn into an image of the driver's own and copied from it into the runtime's on every new frame, Vulkan with a render pass and GL3 with a blit. Screens are now drawn into the runtime's image itself, as before per-screen placement, with no image of the driver's and no copy. A screen drawn again with no new frame - resized, made again or moved while paused - replays the last frame's final pass from the chain: build_viewport_pass_replay draws it at the new size from what it read then, the passes' outputs, their feedback and the history that frame saw, with that frame's count. Nothing else runs, feedback does not swap and history stays, so a feedback or history preset holds still while paused. A chain made to replay keeps one more history image, so the frame's end writes where the last frame did not read; the window's chains keep what they did. This also has movie frames reach the headset, which the copy held at the first one, and draws a screen resized while paused at its new size rather than stretching the old image. * openxr: leave what users who never edit see as it was Screens seen from behind turn to their grey backs only while Edit Screens is on, where screens are turned around; outside it nothing changes and no head is located for them. The grabs carry whether editing is on. The menu opens at its own spot, straight ahead of the anchor, as it did. Menu in Front of Screen 1, off by default, keeps it just in front of screen 1 and moving with it. The frame loop copies the main thread's grabs only once their stamp moves, so outside edit mode no frame copies them. A new session clears the frame loop's own copy and passes over what was published before it, rather than publishing itself: the main thread stays the grabs' one writer. On Touch, the left menu button that opens the menu from edit mode is spent until let go: held on as edit mode ends, it is no Start and does not toggle the menu again after a second. --------- Co-authored-by: libretroadmin <[email protected]> |
||
|
|
c30af2cd3e |
tests: tests-other/ into samples/
The widget and autosave harnesses become samples of their own - samples/gfx/widget_snapshot_ownership, samples/gfx/widget_task_lifetime and samples/runloop/autosave_snapshot - each built and run by make check like the rest, the task lifetime test with the widget defines its stubs build against. The autoconf suite, its .ratst scripts and test input configs move to samples/input/test_input; the workflows that ran them follow. The SPIRV-Cross MSL binding testbench, which nothing built or ran, goes. |
||
|
|
e63e6b5e8b |
tests: hold Wii U HID reads in flight at shutdown
Pause mock read completions and wait for both live pads to queue a read before deleting the HID client. Otherwise the deliberately broken IOS can have no reads to lose and spuriously pass the negative test. Free discarded mock requests so the negative test detects missing adapter teardown rather than leaking its own request records. |
||
|
|
4d702934db |
wiiu/hid: hand adapters between threads lock-free
The polling thread and the frontend shared one adapter list under an OSFastMutex, which the frontend took on every poll, and the HID attach callbacks queued events by swapping the list head out and back in. That swap pair is not atomic as a whole: two callbacks at once (the HID stack calls them from more than one thread) can each take the list and put theirs back over the other's, losing an attach or a detach. A lost detach leaves the pad registered for good. Each thread now keeps its own list and hands adapters across through the lock-free stacks of mpsc_stack.h: attach callbacks -> hid_events -> polling thread polling thread -> hid_new -> frontend: adapters to set up frontend -> hid_retired -> polling thread: to free An adapter's state is a retro_atomic_int_t, and each value is moved on by one thread only, so no two ever write it from the same state. The read completion runs the packet handler before it says READY, since READY is when the polling thread may start winding the adapter down; it used to say READY first. The frontend deregisters and deinitialises a pad as it retires the adapter, the polling thread frees the adapter, and at shutdown the polling thread tears down what is left, as before. No lock remains, and the frontend's poll no longer takes one. samples/input/wiiu_hid_threads runs the driver against stand-ins for Cafe OS on pthreads: two threads attach and detach devices while the frontend polls and an "IOS" thread completes the reads, and every pad must be registered, fed, deregistered and deinitialised in order, on the right threads, with nothing left at shutdown. Its negative build loses the reads in flight at shutdown and must fail. Against the old driver (32-bit PowerPC under qemu) it fails: a few hundred pads of detached devices are never torn down. |
||
|
|
80b3aefa35 |
input: a controller's sub-device sensors, from SDL's left-hand sensors
The frontend passes a core's sensor calls for a sub-device (RETRO_SENSOR_SUBDEVICE) on to the drivers with the index kept. It remembers which sub-device sensors the core enabled, as it does the controller's own, so one not enabled, or whose enable no driver took, reads 0 without asking a driver. The controller's own sensors are handled as before, and sensitivity and orientation apply to both; the profile's axis remap stays the controller's. The SDL2 (2.26 and up) and SDL3 joypad drivers answer sub-device 1 from SDL's _L sensors: a Wii Remote's Nunchuk accelerometer, the left Joy-Con of a pair. SDL3 restores it on a reconnect as it does the others. Every other driver already refuses an index it does not know. samples/input/sensor_subdevice runs the wrappers as they ship. |
||
|
|
1f91f7f876 | sdl3: keep input, exclusive in place, 32-bit uploads | ||
|
|
e2b460c617 | sdl3: drop the full-slot pad retry | ||
|
|
a6374b6928 | sdl3: performance, in-place modes and pad fixes | ||
|
|
45dc0a99c3 |
input: Dingux rumble through evdev and the output writer; drop libShake
libShake was used by one driver, sdl_dingux, for its vibration motor, and linked on webOS for nothing. What it did there is a few evdev calls: find the node that plays a periodic sine, upload a sine per motor, play and stop it, set the gain. input/common/linux_ff.h does those with no allocation (libShake scanned /dev/input with scandir and malloc'd a node per entry) and none of its bugs (an open that failed was taken as success). The uploads and plays now go out from the shared output writer, as udev's and XInput's rumble do, so a motor's driver never holds the frame; the frontend's thread notes the strengths, both in one word, and returns. A core asking the same strength each frame costs no call at all. On MIPS (-O2, mips32) that path is 15 to 19 instructions with no stack frame, where it was about 32 with a frame and four spills. Every SDL Dingux target gets the motor now, not only the three that built libShake; one without a motor finds none and has no rumble, as before. The output writer makes no syscall for a wake while one is still on its way, which every driver on it gains from. xinput_rumble_test says a call did not wait by the write not being done yet, not by a time a loaded runner can overrun. samples/input/dingux_rumble runs the real driver against a stand-in /dev/input and SDL, with threads and without. |
||
|
|
8f1ac4ad61 |
samples: compat_strl.c beside features_cpu.c
features_cpu.c copies the CPU's model name with strlcpy() on the architectures that read it from /proc/cpuinfo, so every sample that links it links compat_strl.c too; fast_cores_test includes it beside features_cpu.c. They link on PowerPC and ARM as well as x86. |
||
|
|
5c82bce0ed |
overlay: D-pad and face buttons read a finger's contact area (Android)
A touchscreen reports each finger as an ellipse, not a point; Android gives its axes and orientation (AMotionEvent_getTouchMajor/Minor and getOrientation). A thumb laid across up and right, or resting between two face buttons, covers both - and read by its centre alone presses one. After RetroArch-Lite's contact-area input. "D-Pad Input Method" and "ABXY Input Method" choose how each reads a touch: "Direction" - the way the centre lies, as always, and the default - "Contact Area", every way the contact covers, or "Both". Each tip of the ellipse's two axes presses the way it lies from the area's middle, past a small dead zone there. "Contact Area Size" scales how large a contact counts. Measured in pixels per axis against the pointer's own space; RetroArch-Lite measured both against the screen's height, which skews a contact on a wide screen. Android's reader keeps each pointer's contact beside its position, and the driver hands them to the frontend each poll (input_driver_publish_touch_contacts). A finger with no contact size, and every other driver, read by the centre's way. The rows show on Android, where an overlay has the area they apply to. overlay_contact_test holds the geometry: fingertips, thumbs across two ways, upright and level contacts, magnification, wide screens. |
||
|
|
226cec7da5 |
overlay: a movable stick follows the finger with Show Inputs off
With "Show Inputs" off, the overlay took each control's state from the physical controller, as for "Physical": a movable stick's image was set to the controller's stick - at rest - over where the finger had put it, every poll, and never moved. Only "Physical" reads the controller now; off reads the touches as "Touched" does, and shows nothing. overlay_stick_on_screen_test runs the real binary under Xvfb with a movable stick, drags it right and up, holds it and lets go, and looks at where it is drawn each time, threaded video off and on. |
||
|
|
a21637debe |
input: ignore a controller from Input Information
Some duplicates nothing can tell apart: a remapper (DS4Windows, reWASD, x360ce) reads a controller and shows a virtual one of it, and nothing in the virtual pad's identity says so. Only the user knows, so the user chooses. Information > Input Information has a row under each controller, "Ignore This Controller": that model is left out by every joypad driver that knows a controller's ids - raw input, DirectInput, the hybrid driver, udev and the HID drivers - the way the controllers Steam Input stands in for already are. The controller driver restarts so it goes at once. Each model left out is listed after the controllers, a row to read it again. The list is the input_ignore_devices setting, written as SDL's SDL_GAMECONTROLLER_IGNORE_DEVICES is, and read beside that variable. input_device_ignored() moves into input_driver.c, as it now reads the settings; the check itself stays in input_ignore_devices.h with the list's helpers, which ignore_devices_test covers. The driver tests that link a driver are given the frontend's function. |
||
|
|
40583200c8 |
dinput: one port for a pad on cable and Bluetooth at once
A DualShock 4 or DualSense on Bluetooth and plugged in to charge is two devices to DirectInput, and both the DirectInput driver and the hybrid driver's DirectInput pads gave it two ports. Raw input already told the links apart by the pad's Bluetooth address; DirectInput gives the device's HID path too (DIPROP_GUIDANDPATH), so the enumeration reads the address the same way and leaves a pad's second link out. The address read moves to win_pad_ident.h, shared by raw input and DirectInput. It finds HID's two calls in hid.dll, so a build that links no HID library has it, and it runs where a pad connects - on the enumeration's task for DirectInput - never on a frame. win_pad_ident_test now holds a pad on both links to one port under every Windows joypad driver. The raw input rumble test counted every library load as XInput's; it counts XInput's. |
||
|
|
9696bef97a |
udev: player lights through the pad's LED devices
The udev joypad driver lit nothing: it had no set_player, unlike the other desktop drivers. It now finds the LED class devices under each pad (its HID device, or an Xbox 360 pad's USB device) and lights them as each console does: a DualSense's five player lights, a DualShock 4's light bar in the player's colour, a DualShock 3's four, a Switch pad's four and an Xbox 360 pad's ring. A DualSense's light bar is left alone, as are lights it never lit; ones it lit go out when no port reads the pad. Four rings under one wireless receiver are not told apart, and are left. Writing a light can wait on the pad (a Switch pad answers a request), so the rumble writer's thread writes them: the lights are opened where a pad arrives and handed over through atomic slots, with the player wanted an atomic of its own. Without threads the caller writes them, as with rumble. A driver that adds a pad's lights just after its input nodes is looked at again a few times. The kernel makes these files root's. pkg/linux/70-retroarch-player-lights.rules makes them writable by the user; without it the pad is left as it is, and the log says so. samples/input/udev_player_lights runs the real driver against a directory laid out as /sys is, under ASan and TSan. |
||
|
|
561657acd9 |
tests: give the udev tests' pads no touchpad node
The DualShock 3 pressure and udev rumble tests zero a pad and set its sensor descriptor to -1, but not the touchpad's, added since: it stayed 0, and every poll read stdin as the pad's touchpad. With stdin an open pipe, as a CI step can have it, the read blocked until the 60 second timeout. |
||
|
|
17d8ad9f86 |
input: one port for a pad Windows shows more than once
Which of Windows' views reads a controller is now decided in one place
(input/common/win_pad_ident.h) instead of four copies that disagreed.
The XInput-hybrid driver matched "IG_" in capitals only, so an Xbox pad
whose raw input path came lower case ("ig_") was read through XInput
and DirectInput both: two ports. The check is now case-insensitive
everywhere, and Bluetooth paths are told the same way, classic and LE.
A DualShock 4 or DualSense on Bluetooth and plugged in to charge is two
devices to Windows. Raw input now reads the pad's Bluetooth address
from each link at connect (the serial string over Bluetooth, a feature
report over USB, on a handle opened with no access): the second link of
a pad already there is kept aside and not read; when the first goes,
it carries on in the same port with no disconnect. DirectInput gives
no path to tell them by, and is left as it was.
samples/input/win_pad_ident holds a table of real controllers - Xbox
pads on USB, Bluetooth and Bluetooth LE with paths in either case,
8BitDo X and D modes, Sony pads on one or both links, Switch Pro,
WinUSB pads, Steam Input's - to one port each under every Windows
joypad driver.
|
||
|
|
fac37bac1e |
input: leave the controllers Steam Input stands in for
Steam Input, starting a game with a controller it translates, makes a
virtual pad of it and puts the real one's USB ids in
SDL_GAMECONTROLLER_IGNORE_DEVICES ("0x054c/0x09cc,..."), so that the
game reads only the virtual pad. SDL's games honour it; RetroArch's own
drivers did not, and read the controller twice: once as itself, once
through Steam.
The drivers that know a controller's ids at connect now pass over one
that is listed: winraw, DirectInput, the XInput and DirectInput driver,
udev, and the hid layer under every HID backend. A user can set the
variable too, for a controller another program mirrors. It is read
when a controller connects, never on a frame. ignore_devices_test holds
the list to how Steam writes it and SDL reads it.
|
||
|
|
e160e2ab67 |
udev joypad: a pad's other nodes, listed once under its HID device
A DualShock 4, a DualSense or a Wii Remote comes out of the kernel as several nodes beside the pad's: motion sensors, a touchpad, raw reports. At each connect the driver searched every input or hidraw device on the system for each of them in turn - up to four scans - and kept those whose HID parent was the pad's. It now lists the pad's HID device's own nodes once, and a table (linux_pad_members.h) gives each its role: the node tagged as an accelerometer for the sensors, else the untagged ones in order, as for a Wii Remote; the one tagged as a touchpad for the touchpad, never tried as the sensors; the hidraw node for a DualShock 3's pressures. The pad's own node takes none. linux_pad_members_test holds the choice to that. |
||
|
|
b92a874a90 |
input: device groups, and Android's built-in controllers as rules
Some controllers reach the OS as more than one input device: the Xperia Play's pad is two, the SHIELD keeps its NVIDIA button apart, the GPD XD its back button, the ARCHOS GamePad its sticks. The Android driver merged them with two global ids, pad_id1 and pad_id2, in a chain of special cases: one such device at a time, two members at most, and nothing done when one went away. A device group (input/input_group.h) is one pad made of several OS devices. The first member to arrive has the slot, later ones are read as it, in either order. A member leaving keeps the pad; the lead leaving hands the slot to the next member; the last leaving ends the group. Several groups stand at once. A rule names the model, the members' names and each one's role: part of the pad, the controller proper (a second controller is a pad of its own), or a part that only joins, like the NVIDIA button. The Android driver's special cases are now a rule table (android_groups.h) and the two globals are gone. input_group_test holds the table to the old chain on every model and name it tries, and the groups to join orders, members leaving, two groups at once and roles. |
||
|
|
71944e29df |
input: read the original Xbox pad, and move it to WinUSB on Windows
An original Xbox pad, or an adapter for one, is an XID device (USB class 0x58), not a HID one, and no driver of Windows' runs it. A new handler reads its 20-byte report: the D-pad, Start, Back and the stick clicks as bits, the six face buttons and both triggers as a pressure each, and the sticks. A face button or trigger counts as pressed past a third of its travel; its pressure is an axis, which the built-in profile binds, so a core that reads pressure has it. Rumble goes out as output report 0 from the packet handler, when it changes. On Windows the WinUSB scan takes such a pad by its interface class, whoever made it, except the DVD remote's receiver and Steel Battalion's controller. One with no driver at all is said once on screen, and Information > Input Information offers to move it to WinUSB, as for the Wii U GameCube adapter; one on XBCD or libusb is left where it is. |
||
|
|
c6046da20f |
Android: read the input queue on a thread of its own (#19923)
* Android: read the input queue on a thread of its own Android sends a window its next key only once the window has finished the last one, and a NativeActivity gets every key twice: before the IME, marked AKEY_EVENT_FLAG_PREDISPATCH, and after it. Read on the main thread once a frame, with the first copy finished unhandled for the IME, each key took two polls, about 30 keys a second at 60 Hz. A pad mashed faster than that queued up in the system, and its presses kept arriving seconds after it was let go. A thread with its own looper now reads the queue. It copies each event into an SPSC ring and finishes it at once, so Android sends the next one straight away. The copy before the IME is the one read, unless the system keyboard is open, when keys still go by the IME first. Volume keys are left to the system and read once, after the IME. Until the first input driver starts, events are finished unread. With the ring full, the reader leaves events in the queue until the poll makes room. The poll applies the copies in order through the same handlers. A key, a finger or a mouse button can now go down and back up between two polls, so the poll stops at the first event that would undo what an earlier one did in the same poll and leaves the rest for the next (android_poll_changes.h): a press shorter than a frame is still seen for one. Mouse moves in one poll are summed. The reader answers APP_CMD_INPUT_CHANGED once it has let go of the old queue. The AMotionEvent calls looked up with dlsym are looked up once, before the reader starts, since it reads them too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YTBjv1trXRxAXvNwCt89Ka * Android input reader: records of their own size, read where they lie Each event went through the input reader's ring as a 312-byte record, whatever it was, built on the reader's stack, copied into the ring and copied out again by the poll. A key needs 44 bytes of it and a stick's move 88. A record is now as long as its event: a key ends before the stick axes, a stick's move before the touch fields, and a touch, mouse or pen carries only the pointers it has. The reader builds each where the poll will read it, and the poll applies it there (android_input_ring.h); nothing is copied after the event leaves the input queue. A record never crosses the ring's end: the rest of a lap is a pad the poll steps over. The ring is 64 KiB, some 1500 keys. A stick's moves are its state: the poll keeps only the last of a frame. The reader publishes what it writes once the queue is empty, and a stick's move written over its unpublished move before it, as long as the hat stays where it was, so a fast pad no longer fills the ring and holds back keys behind it. A hat, the D-pad of many pads, tapped between two polls was lost: the poll's hold-back covered keys, fingers and mouse buttons only. Its four directions are kept back the same way now. android_input_ring_test holds the ring to reading in place, records whole across laps, merging only unpublished moves, and two threads; android_poll_changes_test has a hat lane. --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: LibretroAdmin <[email protected]> |
||
|
|
d0490c9c1f |
winraw: drop RETROARCH_RAWINPUT_POLL and the window-thread path
Keyboard, mouse and controllers are always read in bulk by the poll, on a window the first poll makes on the polling thread. The switch only kept the earlier path, with its window made by init and its reports taken by that thread's pump, and the =2 sink registration, for comparison; both go, with the pump's staleness measurement that only that path used. |
||
|
|
c6a81d0348 | wiiu test: use the relocated SDK headers | ||
|
|
dbcb4d7cf2 |
udev joypad: a pad's touchpad, from its own evdev node
On Linux a DualShock 4's or DualSense's touchpad is an input device of its own beside the pad. The driver finds the one with ID_INPUT_TOUCHPAD under the pad's HID parent, when the pad connects or when the node comes after it, and reads its first two multitouch slots and its click into the pad's view, which it lends. RETRO_DEVICE_TOUCHPAD and the Controller Touchpad setting work on it; the node goes with the pad or by itself. udev_checked_test feeds it a DualSense's events. |
||
|
|
edf873fa57 |
net_retropad: show the controller touchpad, read as RETRO_DEVICE_TOUCHPAD
A Controller Touchpad option (off by default) has the core read port 1's touchpad itself: each finger down is a dot where it is, the screen standing for the touchpad, green for the first and magenta for the second. A core author has a working reader to look at, and the device can be tried on a pad. Read by the core, the touchpad leaves the port's Controller Touchpad mapping, which the Pointer setting shows otherwise. It is not sent to the receiver. |
||
|
|
9e597e9d5f |
SDL2 joypad: controller touchpads
The sdl2 driver hands a pad's touchpad over through get_touchpad(), as sdl3 does: up to two fingers of the first touchpad and its press, read from SDL once a poll and only when asked. RETRO_DEVICE_TOUCHPAD and the Controller Touchpad setting work on it with SDL 2.0.14 and later. The SDL3 bridge test gives SDL a virtual pad with a touchpad and holds get_touchpad() to where SDL has the fingers and the press. |