2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
vr_module 구조체 참조
#include <
vr.h
>
이 HAL을 구현하여 가상 현실 (VR) 애플리케이션이 사용될 때 콜백을 수신합니다. VR 애플리케이션은 다음과 같은 여러 가지 특별한 디스플레이 및 성능 요구사항이 있습니다.
-
센서 지연 시간 짧음 - IMU, 가속도계, 자이로스코프에서 애플리케이션에 표시되는 콜백까지의 총 엔드 투 엔드 지연 시간은 매우 짧아야 합니다(일반적으로 5ms 미만). HIFI 센서 지원을 위해 필요합니다.
-
디스플레이 지연 시간 짧음 - GPU 그리기 호출에서 실제 디스플레이 업데이트까지의 총 엔드 투 엔드 지연 시간은 최대한 짧아야 합니다. 이는 단일 버퍼 모드에서 SurfaceFlinger를 사용하고 그리기 호출이 디스플레이 스캔아웃과 올바르게 동기화되도록 하여 달성됩니다. 이 동작은 EGL 확장 프로그램을 통해 애플리케이션에 노출됩니다. 이에 필요한 EGL 확장 프로그램은 아래를 참고하세요.
-
낮은 대기 시간 디스플레이 - 적절한 밝기를 유지하면서 디스플레이 대기 시간 설정을 최대한 낮게 설정해야 합니다. 60Hz로 실행되는 일반적인 디스플레이의 경우 픽셀이 3.5ms 이하 동안만 조명되어야 낮은 대기 시간으로 간주됩니다. 이렇게 하면 VR 설정에서 움직임 중에 고스트 현상이 방지되며 BRIGHTNESS_MODE_LOW_PERSISTENCE가 설정된 경우
lights.h
HAL에서 사용 설정해야 합니다.
-
GPU 및 CPU의 일관된 성능 - 프레임마다 정기적으로 여러 번 작업이 급증하는 VR 애플리케이션의 혼합 GPU/CPU 워크로드가 주어지면 CPU 예약은 애플리케이션 렌더링 스레드 작업이 예약된 시점으로부터 1ms 이내에 일관되게 실행되고 그리기 창이 끝나기 전에 완료되도록 해야 합니다. 이를 위해 VR 모드에서 현재 실행 중인 VR 애플리케이션의 렌더링 스레드 전용으로 단일 CPU 코어를 예약하고 'top-app' cpuset에서 사용할 수 있어야 합니다. 마찬가지로 기기가 열적으로 제한되지 않는 VR 모드에서
power.h
HAL에 POWER_HINT_SUSTAINED_PERFORMANCE 플래그가 설정된 경우 각 프레임을 렌더링하는 데 할당된 시간 내에 렌더링 워크로드가 완료되도록 적절한 CPU, GPU, 버스 클록레이트를 유지해야 합니다.
-
필수 EGL 확장자가 있어야 함 - EGL 확장자(EGL_ANDROID_create_native_client_buffer, EGL_ANDROID_front_buffer_auto_refresh, EGL_EXT_protected_content, EGL_KHR_mutable_render_buffer, EGL_KHR_reusable_sync, EGL_KHR_wait_sync)를 포함하여 위 기능을 사용 설정하는 데 필요한 모든 GPU 설정이 필요합니다.
-
정확한 열 보고 - 정확한 열 온도 및 한도는
thermal.h
HAL에 보고되어야 합니다. 특히 DEVICE_TEMPERATURE_SKIN에 현재 피부 온도가 정확하게 보고되어야 하며 이 기기에 보고된 vr_throttling_threshold는 기기의 열 관리자가 CPU, GPU 또는 버스 클록 레이트를 일관된 성능에 필요한 최솟값 미만으로 제한하는 온도 한도를 정확하게 보고해야 합니다 (이전 글머리기호 참고).
일반적으로 이 HAL을 구현하는 공급업체는 set_vr_mode를 힌트로 사용하여 위 요구사항에 필요한 VR 관련 성능 조정을 사용 설정하고 VR 디스플레이 모드에 최적화된 기기 기능을 사용 설정해야 합니다. 위의 요구사항을 충족하기 위해 사용할 수 있는 최적화가 없거나 최적화가 필요하지 않은 경우 set_vr_mode 호출은 아무것도 하지 않을 수 있습니다.
이 HAL의 메서드는 Android 프레임워크에서 동시에 호출되지 않습니다.
vr.h
파일의
82
줄에 있는 정의입니다.
HAL 구현이 런타임 시작 시 필요한 상태를 설정하기 위한 편의 메서드입니다. 이 메서드는 부팅 단계에서 VrManagerService에서 한 번 호출됩니다. init 전에 이 HAL의 메서드는 호출되지 않습니다.
vr.h
파일의
96
번 라인에 있는 정의입니다.
void(* set_vr_mode)(struct
vr_module
*module, bool enabled)
|
VR 모드 상태를 설정합니다. 사용 설정된 매개변수의 가능한 상태는 다음과 같습니다. false: VR 모드가 사용 중지되어 모든 VR 관련 설정이 사용 중지됩니다. true: VR 모드가 사용 설정되어 모든 VR 관련 설정이 사용 설정됩니다.
Android 시스템이 VR 모드로 전환되거나 이 모드에서 나올 때마다 호출됩니다. 이는 일반적으로 사용자가 입체 렌더링을 실행하는 VR 애플리케이션으로 전환하거나 전환할 때 발생합니다.
vr.h
FILE의
107
라인에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
vr.h
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# Android Hardware Abstraction Layer: vr_module Struct Reference\n\nvr_module Struct Reference\n==========================\n\n[Data Fields](#pub-attribs) \nvr_module Struct Reference \n\n`\n#include \u003c\n`[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)`\n\u003e\n`\n\n|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_module_t](/reference/hal/structhw__module__t) | [common](/reference/hal/structvr__module#a71ea01183b3998cad6a2301a37a42fc7) |\n| ||\n| void(\\* | [init](/reference/hal/structvr__module#a1621887a15b003a1ba7be81d52b0abb0) )(struct [vr_module](/reference/hal/structvr__module) \\*module) |\n| ||\n| void(\\* | [set_vr_mode](/reference/hal/structvr__module#a8c9e8990b6b65b068703cd615be68fb5) )(struct [vr_module](/reference/hal/structvr__module) \\*module, bool enabled) |\n| ||\n| void \\* | [reserved](/reference/hal/structvr__module#aa1a42885ba14c2168dc14d3f219b5e99) \\[8-2\\] |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nImplement this HAL to receive callbacks when a virtual reality (VR) application is being used. VR applications characteristically have a number of special display and performance requirements, including:\n\n- Low sensor latency - Total end-to-end latency from the IMU, accelerometer, and gyro to an application-visible callback must be extremely low (\\\u003c5ms typically). This is required for HIFI sensor support.\n- Low display latency - Total end-to-end latency from the GPU draw calls to the actual display update must be as low as possible. This is achieved by using SurfaceFlinger in a single-buffered mode, and assuring that draw calls are synchronized with the display scanout correctly. This behavior is exposed via an EGL extension to applications. See below for the EGL extensions needed for this.\n- Low-persistence display - Display persistence settings must be set as low as possible while still maintaining a reasonable brightness. For a typical display running at 60Hz, pixels should be illuminated for \\\u003c=3.5ms to be considered low-persistence. This avoids ghosting during movements in a VR setting, and should be enabled from the [lights.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/lights.h) HAL when BRIGHTNESS_MODE_LOW_PERSISTENCE is set.\n- Consistent performance of the GPU and CPU - When given a mixed GPU/CPU workload for a VR application with bursts of work at regular intervals several times a frame, the CPU scheduling should ensure that the application render thread work is run consistently within 1ms of when scheduled, and completed before the end of the draw window. To this end, a single CPU core must be reserved for solely for the currently running VR application's render thread while in VR mode, and made available in the \"top-app\" cpuset. Likewise, an appropriate CPU, GPU, and bus clockrate must be maintained to ensure that the rendering workload finishes within the time allotted to render each frame when the POWER_HINT_SUSTAINED_PERFORMANCE flag has been set in the [power.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/power.h) HAL while in VR mode when the device is not being thermally throttled.\n- Required EGL extensions must be present - Any GPU settings required to allow the above capabilities are required, including the EGL extensions: EGL_ANDROID_create_native_client_buffer, EGL_ANDROID_front_buffer_auto_refresh, EGL_EXT_protected_content, EGL_KHR_mutable_render_buffer, EGL_KHR_reusable_sync, and EGL_KHR_wait_sync.\n- Accurate thermal reporting - Accurate thermal temperatures and limits must be reported in the [thermal.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/thermal.h) HAL. Specifically, the current skin temperature must accurately be reported for DEVICE_TEMPERATURE_SKIN and the vr_throttling_threshold reported for this device must accurately report the temperature limit above which the device's thermal governor throttles the CPU, GPU, and/or bus clockrates below the minimum necessary for consistent performance (see previous bullet point).\n\n\nIn general, vendors implementing this HAL are expected to use set_vr_mode as a hint to enable VR-specific performance tuning needed for any of the above requirements, and to turn on any device features optimal for VR display modes. The set_vr_mode call may simply do nothing if no optimizations are available or necessary to meet the above requirements.\n\n\nNo methods in this HAL will be called concurrently from the Android framework.\n\n\nDefinition at line\n[82](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\nof file\n[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_module_t](/reference/hal/structhw__module__t) common |\n\n\nCommon methods of the module. This\n*must*\nbe the first member of\n[vr_module](/reference/hal/structvr__module)\nas users of this structure may cast a\n[hw_module_t](/reference/hal/structhw__module__t)\nto a\n[vr_module](/reference/hal/structvr__module)\npointer in contexts where it's known that the\n[hw_module_t](/reference/hal/structhw__module__t)\nreferences a\n[vr_module](/reference/hal/structvr__module)\n.\n\n\nDefinition at line\n[89](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\nof file\n[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\n.\n\n|-----------------------------------------------------------------------------|\n| void(\\* init)(struct [vr_module](/reference/hal/structvr__module) \\*module) |\n\n\nConvenience method for the HAL implementation to set up any state needed at runtime startup. This is called once from the VrManagerService during its boot phase. No methods from this HAL will be called before init.\n\n\nDefinition at line\n[96](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\nof file\n[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\n.\n\n|------------------------|\n| void\\* reserved\\[8-2\\] |\n\n\nDefinition at line\n[110](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\nof file\n[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\n.\n\n|--------------------------------------------------------------------------------------------------|\n| void(\\* set_vr_mode)(struct [vr_module](/reference/hal/structvr__module) \\*module, bool enabled) |\n\n\nSet the VR mode state. Possible states of the enabled parameter are: false - VR mode is disabled, turn off all VR-specific settings. true - VR mode is enabled, turn on all VR-specific settings.\n\n\nThis is called whenever the the Android system enters or leaves VR mode. This will typically occur when the user switches to or from a VR application that is doing stereoscopic rendering.\n\n\nDefinition at line\n[107](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\nof file\n[vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [vr.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vr.h)"]]