aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/service.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/fix/service-auto-stub-report-once' into ↵Takoroka3 days1-8/+24
|\ | | | | | | | | | | | | test/linux-all-prs-plus # Conflicts: # src/core/hle/service/service.cpp
| * service: report each auto-stubbed command onceTakoroka5 days1-8/+24
| | | | | | | | | | | | | | | | Every call to an auto-stubbed command wrote a Critical report, and Critical flushes the log file. Mario Kart World polls nx2:camera 29 about 47 times a second, so the log flushed that often for the whole session. Each (service, command) pair is reported once; repeats answer success silently.
* | service: placeholder handlers for known but unimplemented commandsTakoroka3 days1-8/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add StubReplyZeroed, StubReplyEvent and StubReplyInterface to ServiceFrameworkBase: for Switch 2 callers they reply with zeroed data, with zeroed data and a copy handle to an event that never fires, or with an nx2: stub interface; other callers get the unimplemented-function path as before. Each command is logged once. Use them for the commands of the interfaces games open that had no handler or a nullptr one (hid, am, audio, aoc, caps, mii, set, lm, acc, ssl, bsd and the nx2 vi2/gsv/gpu/syncpt sessions): a command that returns an interface now returns one, a command that returns a handle returns an event, so callers no longer get handle 0 or object 0 back.
* | service: zero the reply of auto-stubbed commandsTakoroka3 days1-1/+8
|/ | | | | | | | | Switch 2 clients read the reply words they expect without checking the reply size, so an auto stub's result-only reply handed them the request's leftover words as data: Kirby Air Riders took them as an HDR output format, the GPU's CreateGraphicsDevice caller as a device id, and so on for every unimplemented or nullptr command. Reply with 32 zeroed words after the result instead.
* core: use the 12 GiB layout and auto-stub IPC for Switch 2 titlesTakoroka6 days1-2/+5
| | | | | | | | | Switch 2 titles size their heap from the total memory and stop at the first unimplemented command, so they only booted with the 12 GiB layout and EDEN_NX2_AUTO_STUB set by hand. Detect them from main.npdm before the kernel starts and apply the layout as a per-game value (the configured layout comes back once the game is closed), and auto-stub unknown commands from Switch 2 processes.
* nx2: video decoder service protocol (no decoding yet)Takoroka6 days1-1/+3
| | | | | | | | | | | | | | | | | Read from the SDK's nn::codec VP9 decoder: the decoder service session (vdec TIPC 1) takes 200 initialize (work buffer transfer memory), 101 configure (X: codec configuration, width, height), 3 its submission event (copy handle at word 3), 6/207/8 start/stop/flush, 115 finalize, 311/314/212 register/release/unregister an output image (reply a 16-byte NativeSyncHandle; all zero reads as signalled), 109 submit a frame (A: bitstream, u64 pts, u8 end of stream) and 213 the next finished frame (image id, size, colour space, pts, end of stream). Output images come from gsv 911, the same request as 429. The service completes each submitted frame at once into the next free image (no picture yet) and keeps its event signalled. Title 1 now sets the decoder up without aborting; in the runs so far it has not submitted frames yet. Auto-stubbed requests on nx2:vdec* sessions log 48 words.
* nx2: frame-locked input replay and quieter logsTakoroka7 days1-0/+57
| | | | | | | | | | | EDEN_NX2_KEY_RECORD records keyboard transitions as "f<frame>:code" against a global count of guest presents; EDEN_NX2_KEY_SCRIPT replays them on the same frames (or by seconds, as before), so a played session reproduces exactly. Debug aids: the PC/LR/SP of the first unmapped reads, NSO load addresses, EDEN_NX2_IPC_SUMMARY (request counts every 5 s), EDEN_NX2_FORCE_LOD0. Unmapped-access logging is rate limited and the per-draw/semaphore spam is demoted, so long sessions stay under the log size cap.
* Switch 2: native memory/images, GPU-accessible attribute, TSG subcontexts, ↵Takoroka7 days1-0/+6
| | | | | | | | | | | | | syncpoint shim - gsv 111/112/114/423/429/430/314/315/435 track native memory and images with real ids (meanings from changes.patch); 1510/435 use its block-linear layout. - svc 0x80 sets a real GpuAccessible (0x20) memory attribute (from changes.patch). - Characteristics report TSG subcontexts (flag 22, 64 per TSG at 0xb4); NvRm otherwise allows one subcontext and a second NVN queue fails its setup. - Syncpoint shim: flag 26, address-space ioctl 0xB, and GPU reads of the shim page return guest syncpoint values (scheme from changes.patch). - EDEN_NX2_IPC_TRACE also logs TIPC commands; gdbrsp.py watch/mem improvements.
* service: EDEN_NX2_IPC_TRACE and EDEN_NX2_AUTO_STUB switchesTakoroka8 days1-1/+23
| | | | | | IPC trace logs every dispatched command and non-zero result words. EDEN_NX2_AUTO_STUB auto-stubs unknown commands without relying on the use_auto_stub setting, which eden-cli's config rewrite resets.
* am: Switch 2 appletOE/IApplicationProxy entry pointsTakoroka8 days1-1/+2
| | | | | | | - appletOE command 10 opens the application proxy (same arguments as 0). - IApplicationProxy commands 40/50/.../90 are new getters; return an INx2StubInterface (nx2_stub_interface.h). Interfaces whose name starts with nx2: answer every call with an empty success and log it.
* [hle][core] Hang Freeze Fix - Video Fixes - Revert Microsleep (#4316) (#4525)John9 days1-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Credit: amicuchu Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - Fixes Mario Strikers Intro Freezing from legacy. - Microsleep no longer needed for Absolum Video freezing and other videos freezing. - Revert `[service, nvhost] added machinery to allow microsleep between nvdec read requests to avoid guest panic in some games #4316` - Tested with CPU/GPU decoding on Linux/Windows. Special thanks to xbzk <video src="/attachments/9f4a4494-78ee-4b65-ad26-628e83d5c83b" title="strikers" controls></video> Co-authored-by: Your Name <John@John.localdomain> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4525 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* Revert "[hle] constexpr handler dispatch maps, introduce version gating ↵PavelBARABANOV2026-10-151-40/+29
| | | | | | | | | | | | | | | | | (#4480)" (#4532) This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [hle] constexpr handler dispatch maps, introduce version gating (#4480)lizzie2026-10-131-29/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR primarily focuses on upbringing constexpr maps for handlers. Each time an HLE object of a service is construed, it registers it's own handlers, over and over. Regardless of whetever it needs them at the moment or not. Additionally we don't require to keep track of different function pointers amongst each object. This can be done by overriding the given function instead, as opposed to having a separate hash map for every given object. In other words: Remove handlers (and handlers_tipc) map for every instance then read from a static defined per-class. - [x] Migrate all HLE functions to new `frozen::map` constexpr time finder - [ ] Measure if this approach actually makes better codegen Optional: - [x] Properly gate all functions (that have versions commented next to them) - [x] Maybe store `HandlerFnP<>` and `const char*` separately, version gating can go in a different map as well Information such as name can be used on debug builds, but doesn't particularly help on release as one can consult an external reference (or have an annotated IPC map) Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4480 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [service, nvhost] added machinery to allow microsleep between nvdec read ↵xbzk2026-08-291-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requests to avoid guest panic in some games (#4316) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This one deserves a long story, but imma try to resume: During investigating Absolum 1.2 black screen of death upon loading intro video, i've discovered guest was aborting for failing to allocate room for the video. By logging everything prior to crash and decoding guest side instructions managed to confirm its media allocator was reading data faster than it was updating free available bucket list. Since the IStorage::Read was happening 247 times before the crash, i've decided to add a very small sleep there, and boom, not only Absolum but some other titles got the same issue fixed. But i was unsatisfied with the sleep and kept tracking guest instructions upstream in order to find a sync point for the read worker and the memory allocation update. But unfortunately the media allocator helpers live in guest, accessing memory directly via MMU, so any sync signaling would need to come from some dynarmic hack. It's been 6 days now, so i've decided to polish the sleep: Moved it upstream to where i could have access for proper predicate, and added machinery to service and nvhost to support that. Now the sleep is restricted only for nvdec istorage reads. Any other reads will flow normally. TL;DR: currently our code is so blazing async that guest is capable to request reads before its very self refresh it have freed room to do so. The sleep accepted as broadly stable was 600 us (MICROseconds), and it affects ONLY nvdec chunk reading. Reports confirm that now videos are smoother now. Code was polished at my knowledge limits. Mostly machinery to track when a request comes from a process with nvdec active, and is istorage read. I can provide more details if it comes to be needed. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4316 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Samuel <lizzie@eden-emu.dev>
* [fmt] use {#:x} instead of 0x{:#x} (#4170)lizzie2026-07-251-3/+3
| | | | | | | | | | continuation of #309 but applying to even more files than before :) also makes them lowercase because `0xfafafa` is better as `0XFAFAFA` Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4170 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [hle/services] use ankerl:: for Service's function handlers map, use const ↵lizzie2026-03-081-7/+9
| | | | | | | | | | | char* instead of std::string{} (#3671) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3671 Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/hle] implement Unknown330 and stub extra 20/15 missing funcs (#3269)lizzie2026-01-061-8/+5
| | | | | | | | | | | | stub for IApplicationFunctions::Unknown330; stubs for BSD sockets values Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3269 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [hle] stubbed extra services from (parental controls and stuff) fw21 (#3175)Maufeat2025-12-181-36/+22
| | | | | | | | | | | | | | Adds more Firmware 20+ related service commands. Renames existing service commands according to switchbrew docs, Unstubs new parental service stuff. Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3175 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [fmt] use {:#X} for format instead of 0x{:X} (#309)lizzie2025-08-271-3/+6
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/309 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Update fmt to allow for v11crueter2025-04-101-1/+1
| | | Signed-off-by: swurl <swurl@swurl.xyz>
* Always report command ID in log and implement LoadUserSetting stubdarktux2025-04-041-3/+3
|
* vi: manage resources independently of nvnflinger and refactorLiam2024-02-171-126/+0
|
* nvnflinger: convert to processLiam2024-02-171-15/+5
|
* am: move out omm interfaces to new moduleLiam2024-02-121-0/+2
|
* service: bcat: Address review issuesNarr the Reg2024-02-101-1/+1
|
* Rework time service to fix time passing offline.Kelebek12024-01-241-4/+3
|
* service: fetch objects from the client handle tableLiam2023-12-241-1/+1
|
* ro: add separate ro serviceLiam2023-12-091-0/+2
|
* ngc: implement serviceLiam2023-09-141-2/+2
|
* hle: rename legacy errors to ResultsLiam2023-03-061-1/+1
|
* nvnflinger: fix nameLiam2023-03-011-5/+5
|
* service: move hle_ipc from kernelLiam2023-03-011-5/+5
|
* service: refactor server architectureLiam2023-02-211-90/+61
| | | | Converts services to have their own processes
* service: remove deleted servicesLiam2023-02-141-2/+0
|
* Add break for default casesKyle Kienapfel2022-11-131-0/+1
| | | | | | | | | | | Visual Studio has an option to search all files in a solution, so I did a search in there for "default:" looking for any missing break statements. I've left out default statements that return something, and that throw something, even if via ThrowInvalidType. UNREACHABLE leads towards throw R_THROW macro leads towards a return
* sm:: avoid excessive port recreationLiam2022-10-311-4/+6
|
* kernel: fix port trackingLiam2022-10-311-1/+3
|
* kernel: invert session request handling flowLiam2022-10-311-5/+8
|
* core: barrier service thread shutdownLiam2022-10-231-0/+4
|
* Properly write out the command buffer when serving close requestNikita Strygin2022-07-311-2/+5
|
* service: ptm: Rewrite PSM and add TSgerman772022-06-281-2/+2
|
* core: Replace all instances of ResultCode with Resultgerman772022-06-261-2/+2
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* Merge pull request #8164 from liamwhite/jit-stubbunnei2022-04-061-0/+2
|\ | | | | service: jit: stub JIT service
| * service: jit: stub JIT serviceLiam2022-04-061-0/+2
| |
* | hle: service: Add option for service interfaces to create or use the default ↵bunnei2022-04-021-2/+3
|/ | | | thread.
* hle: vi: Integrate new NVFlinger and HosBinderDriverServer service.bunnei2022-03-241-2/+4
|
* service/mnpp: Stub mnpp_appNarr the Reg2022-02-101-0/+2
| | | | Used in Super Nintendo Entertainment System™ - Nintendo Switch Online
* core: Remove unused includesameerj2021-11-031-4/+0
|