Difference between revisions of "QTM Services"

From 3dbrew
Jump to navigation Jump to search
(Undo revision 10960 by Yellows8 (talk))
(QTM documentation)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
[[Category:Services]]
 
[[Category:Services]]
  
QTM is the [[New_3DS]] system module in charge of handling head tracking. A maximum of two sessions can be opened for each QTM service.
+
QTM is the [[New_3DS]] system module in charge of handling head tracking. A maximum of three (only two until [[9.3.0-21]]) sessions for *all* QTM services combined.
 +
 
 +
Head tracking is not usable when any other process is using any of the cameras, QTM returns error 0xC8A18008 for this.
 +
 
 +
QTM only tracks the position of the user's two eyes, but does not track the area they are focusing at. Hence, "eye-tracking" is sometimes used to refer to this feature on 3DS, even though it means something else outside the 3DS hacking scene.
 +
 
 +
Refer to this libctru commit for more details: https://github.com/devkitPro/libctru/commit/8e55cdf05d1f2c07f350ec678d0f0d6a7a2df214
  
 
=QTM services=
 
=QTM services=
{| class="wikitable" border="1"
+
 
 +
= QTM user service "qtm:u" =
 +
{| class="wikitable"
 +
! Command ID !! Description
 
|-
 
|-
!  Command Header
+
| 0x00010080 || GetRawTrackingDataEx
!  Description
 
 
|-
 
|-
| 0x00010080
+
| 0x00020080 || GetTrackingDataEx
| (u64 input) Writes an 0x30-byte output structure to the data starting at cmdreply[2].
 
 
|-
 
|-
| 0x00020080
+
| 0x00030000 || EnableManualIrLedControl
| (u64 input) Writes an 0x40-byte output structure to the data starting at cmdreply[2].
 
 
|-
 
|-
| 0x00030000
+
| 0x00040000 || DisableManualIrLedControl
|  
 
 
|-
 
|-
| 0x00040000
+
| 0x00050040 || SetIrLedStatus
|  
 
 
|-
 
|-
| 0x00050040
+
| 0x00060000 || IsCurrentAppBlacklisted
| (u8 input)
 
|-
 
| 0x00060000
 
| Writes an output u8 to cmdreply[2].
 
 
|}
 
|}
  
The commands under this section are available for all QTM services except for "qtm:c".
+
= QTM system service "qtm:s" =
 
+
"qtm:s" has access to all "qtm:u" commands and more:
= QTM user service "qtm:u" =
 
The commands available for this are exactly the same as the commands listed under the "QTM services" section.
 
  
= QTM system service "qtm:s" =
+
{| class="wikitable"
{| class="wikitable" border="1"
+
! Command ID !! Description
|-
 
! Command Header
 
! Description
 
 
|-
 
|-
| 0x04010040
+
| 0x04010040 || SetCentralBarrierPosition
| (float input)
 
 
|-
 
|-
| 0x04020000
+
| 0x04020000 || GetCameraLuminance
| Writes float output to cmdreply[2].
 
 
|-
 
|-
| 0x04030000
+
| 0x04030000 || EnableAutoBarrierControl
|  
 
 
|-
 
|-
| 0x04040000
+
| 0x04040000 || DisableAutoBarrierControl
|  
 
 
|-
 
|-
| 0x04050040
+
| 0x04050040 || SetBarrierPosition
| (u8 input)
 
 
|-
 
|-
| 0x04060000
+
| 0x04060000 || GetCurrentBarrierPosition
| Writes an u8 to cmdreply[2].
 
 
|-
 
|-
| 0x04070040
+
| 0x04070040 || SetIrLedStatusOverride
| (u8 input)
 
 
|-
 
|-
| 0x040801C0
+
| 0x040801C0 || SetCalibrationData
|  
 
 
|-
 
|-
| 0x04090000
+
| 0x04090000 || GetQtmStatus
| Writes an u8 to cmdreply[2].
 
 
|-
 
|-
| 0x040A0040
+
| 0x040A0040 || SetQtmStatus
| (u8 input)
 
 
|}
 
|}
  
See also the "QTM services" section.
+
= QTM service "qtm:sp" =
 +
qtm:sp has access to all "qtm:u", "qtm:s" commands and more:
  
= QTM service "qtm:sp" =
+
{| class="wikitable"
{| class="wikitable" border="1"
+
! Command ID !! Description
|-
 
! Command Header
 
! Description
 
 
|-
 
|-
| 0x08010040
+
| 0x08010040 || NotifyTopLcdModeChange
| (u8 input)
 
 
|-
 
|-
| 0x08020000
+
| 0x08020000 || NotifyTopLcdPowerOn
|  
 
 
|-
 
|-
| 0x08030040
+
| 0x08030000 || IsExpanderInUse
| (u8 input)
 
 
|-
 
|-
| 0x08040000
+
| 0x08040000 || NotifyTopLcdPowerOff
|  
 
 
|}
 
|}
  
This service has all of the commands listed under the "QTM services" section and the "qtm:s" section, in addition to the above commands.
+
GSP always keeps an handle to this service open. NS sometimes uses this service (to blacklist some internal test applications, see [[NS_CFA]]), but when it does it opens then immediately closes the session thereafter.
 
 
This service is used by [[NS]] and [[GSP_Services|GSP]]-module, hence no other processes can use this service.
 
  
= QTM service "qtm:c" =
+
= QTM "hardware check" service "qtm:c" =
{| class="wikitable" border="1"
+
{| class="wikitable"
|-
+
! Command ID !! Description
! Command Header
 
! Description
 
|-
 
 
|-
 
|-
| 0x00010000
+
| 0x00010000 || StartHardwareCheck
|  
 
 
|-
 
|-
| 0x00020000
+
| 0x00020000 || StopHardwareCheck
|  
 
 
|-
 
|-
| 0x00030040
+
| 0x00030040 || SetBarrierPattern
|  
 
 
|-
 
|-
| 0x00040000
+
| 0x00040000 || WaitAndCheckExpanderWorking
| Writes an output u8 to cmdreply[2].
 
 
|-
 
|-
| 0x00050040
+
| 0x00050040 || SetIrLedStatusOverride
| (u8 input)
 
 
|}
 
|}
  
The commands for this service are separate from the commands under the "QTM services" section.
+
The commands for this service are separate from all the other services documented above.

Latest revision as of 19:43, 17 September 2024


QTM is the New_3DS system module in charge of handling head tracking. A maximum of three (only two until 9.3.0-21) sessions for *all* QTM services combined.

Head tracking is not usable when any other process is using any of the cameras, QTM returns error 0xC8A18008 for this.

QTM only tracks the position of the user's two eyes, but does not track the area they are focusing at. Hence, "eye-tracking" is sometimes used to refer to this feature on 3DS, even though it means something else outside the 3DS hacking scene.

Refer to this libctru commit for more details: https://github.com/devkitPro/libctru/commit/8e55cdf05d1f2c07f350ec678d0f0d6a7a2df214

QTM services[edit]

QTM user service "qtm:u"[edit]

Command ID Description
0x00010080 GetRawTrackingDataEx
0x00020080 GetTrackingDataEx
0x00030000 EnableManualIrLedControl
0x00040000 DisableManualIrLedControl
0x00050040 SetIrLedStatus
0x00060000 IsCurrentAppBlacklisted

QTM system service "qtm:s"[edit]

"qtm:s" has access to all "qtm:u" commands and more:

Command ID Description
0x04010040 SetCentralBarrierPosition
0x04020000 GetCameraLuminance
0x04030000 EnableAutoBarrierControl
0x04040000 DisableAutoBarrierControl
0x04050040 SetBarrierPosition
0x04060000 GetCurrentBarrierPosition
0x04070040 SetIrLedStatusOverride
0x040801C0 SetCalibrationData
0x04090000 GetQtmStatus
0x040A0040 SetQtmStatus

QTM service "qtm:sp"[edit]

qtm:sp has access to all "qtm:u", "qtm:s" commands and more:

Command ID Description
0x08010040 NotifyTopLcdModeChange
0x08020000 NotifyTopLcdPowerOn
0x08030000 IsExpanderInUse
0x08040000 NotifyTopLcdPowerOff

GSP always keeps an handle to this service open. NS sometimes uses this service (to blacklist some internal test applications, see NS_CFA), but when it does it opens then immediately closes the session thereafter.

QTM "hardware check" service "qtm:c"[edit]

Command ID Description
0x00010000 StartHardwareCheck
0x00020000 StopHardwareCheck
0x00030040 SetBarrierPattern
0x00040000 WaitAndCheckExpanderWorking
0x00050040 SetIrLedStatusOverride

The commands for this service are separate from all the other services documented above.