diff --git a/BoardConfig.mk b/BoardConfig.mk index a2a4223..13969f1 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -4,6 +4,8 @@ TARGET_BOARD_PLATFORM := android-x86 +LOCAL_COMMON_TREE := device/generic/common + ## Switch to EROFS image instead of Squashfs USE_SQUASHFS := 0 USE_EROFS := 1 @@ -18,21 +20,14 @@ AB_OTA_UPDATER := true AB_OTA_PARTITIONS += \ system \ initrd \ - kernel + kernel \ + ramdisk-recovery # Rootfs -BOARD_ROOT_EXTRA_FOLDERS := grub - -# A/B -AB_OTA_UPDATER := true +BOARD_ROOT_EXTRA_FOLDERS := boot -AB_OTA_PARTITIONS += \ - system \ - initrd \ - kernel - -# Rootfs -BOARD_ROOT_EXTRA_FOLDERS := grub +# Full treble +PRODUCT_FULL_TREBLE_OVERRIDE := true # Some framework code requires this to enable BT BOARD_HAVE_BLUETOOTH := true @@ -55,12 +50,11 @@ endif # the following variables could be overridden TARGET_PRELINK_MODULE := false TARGET_NO_KERNEL ?= false -TARGET_NO_RECOVERY ?= true +#TARGET_NO_RECOVERY ?= true TARGET_EXTRA_KERNEL_MODULES := ifneq ($(filter efi_img,$(MAKECMDGOALS)),) TARGET_KERNEL_ARCH ?= x86_64 endif -TARGET_USES_64_BIT_BINDER := true BOARD_USES_GENERIC_AUDIO ?= false BOARD_USES_ALSA_AUDIO := true @@ -104,8 +98,12 @@ TARGET_USES_HWC2 ?= true USE_CAMERA_STUB ?= false # This enables the wpa wireless driver -BOARD_WPA_SUPPLICANT_DRIVER ?= NL80211 -WPA_SUPPLICANT_VERSION ?= VER_2_1_DEVEL +# and hostapd tool +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +WPA_SUPPLICANT_VERSION := VER_0_8_X +WIFI_HIDL_FEATURE_DUAL_INTERFACE := true +WIFI_HIDL_FEATURE_AWARE := true BOARD_GPU_DRIVERS ?= crocus i915 iris freedreno panfrost nouveau r300g r600g radeonsi virgl vmwgfx ifneq ($(strip $(BOARD_GPU_DRIVERS)),) @@ -115,13 +113,14 @@ endif #BOARD_MESA3D_USES_MESON_BUILD := true #BOARD_MESA3D_CLASSIC_DRIVERS := i965 BOARD_MESA3D_BUILD_LIBGBM := true -BOARD_MESA3D_GALLIUM_DRIVERS := crocus iris i915 nouveau r600 radeonsi svga virgl zink swrast -BOARD_MESA3D_VULKAN_DRIVERS := amd intel intel_hasvk virtio +BOARD_MESA3D_GALLIUM_DRIVERS := crocus iris i915 nouveau r600 radeonsi svga virgl zink softpipe llvmpipe +BOARD_MESA3D_VULKAN_DRIVERS := amd intel intel_hasvk virtio swrast nouveau BOARD_MESA3D_GALLIUM_VA := enabled -BOARD_MESA3D_VIDEO_CODECS := h264dec h264enc h265dec h265enc vc1dec +BOARD_MESA3D_VIDEO_CODECS := h264dec h265dec vc1dec av1dec +BOARD_MESA3D_MESON_ARGS := -Dallow-kcmp=enabled BUILD_EMULATOR_OPENGL := true -BOARD_KERNEL_CMDLINE := root=/dev/ram0$(if $(filter x86_64,$(TARGET_ARCH) $(TARGET_KERNEL_ARCH)),, vmalloc=192M) +BOARD_KERNEL_CMDLINE := $(if $(filter x86_64,$(TARGET_ARCH) $(TARGET_KERNEL_ARCH)),, vmalloc=192M) TARGET_KERNEL_DIFFCONFIG := device/generic/common/selinux_diffconfig # Atom specific @@ -159,21 +158,29 @@ ifeq ($(BOARD_IS_GO_BUILD), true) MALLOC_SVELTE := true endif +KERNEL_DIR ?= kernel/x86/common + # Surface specific ifeq ($(BOARD_IS_SURFACE_BUILD),true) -KERNEL_DIR := kernel-surface +KERNEL_DIR := kernel/x86/surface endif # Zenith ifeq ($(BOARD_IS_ZENITH_BUILD),true) -KERNEL_DIR := kernel-zenith +KERNEL_DIR := kernel/x86/zenith endif +TARGET_KERNEL_SOURCE := $(KERNEL_DIR) COMPATIBILITY_ENHANCEMENT_PACKAGE := true PRC_COMPATIBILITY_PACKAGE := true ZIP_OPTIMIZATION_NO_INTEGRITY := true -DEVICE_MANIFEST_FILE := device/generic/common/manifest.xml +DEVICE_MANIFEST_FILE := $(LOCAL_COMMON_TREE)/manifest.xml +ifneq ($(TARGET_SUPPORTS_32_BIT_APPS),false) +DEVICE_MANIFEST_FILE += $(LOCAL_COMMON_TREE)/manifest_omx.xml +endif + +DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE := $(LOCAL_COMMON_TREE)/manifest_framework.xml #BOARD_SEPOLICY_DIRS += device/generic/common/sepolicy/nonplat \ # system/bt/vendor_libs/linux/sepolicy \ @@ -182,10 +189,13 @@ DEVICE_MANIFEST_FILE := device/generic/common/manifest.xml # vendor/intel/proprietary/houdini/sepolicy \ # vendor/google/proprietary/widevine-prebuilt/sepolicy # -BOARD_PLAT_PRIVATE_SEPOLICY_DIR := device/generic/common/sepolicy/plat_private +SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(LOCAL_COMMON_TREE)/sepolicy/plat_private +SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(LOCAL_COMMON_TREE)/sepolicy/public +BOARD_VENDOR_SEPOLICY_DIRS += $(LOCAL_COMMON_TREE)/sepolicy/vendor -BOARD_BUILD_SYSTEM_ROOT_IMAGE := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4394967290 +TARGET_FLATTEN_APEX := true +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 5000000000 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 100663296 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_USES_OEMIMAGE := true BUILD_BROKEN_USES_NETWORK := true @@ -195,6 +205,8 @@ BUILD_BROKEN_DUP_RULES := true BUILD_BROKEN_USES_BUILD_HOST_EXECUTABLE := true BUILD_BROKEN_USES_BUILD_HOST_STATIC_LIBRARY := true BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true +BUILD_BROKEN_PLUGIN_VALIDATION := soong-llvm19 +BUILD_BROKEN_INCORRECT_PARTITION_IMAGES := true #ifeq ($(ANDROID_USE_INTEL_HOUDINI),true) #include vendor/intel/proprietary/houdini/board/native_bridge_arm_on_x86.mk @@ -204,9 +216,16 @@ STAGEFRIGHT_AVCENC_CFLAGS := -DANDROID_GCE # Properties BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true -TARGET_VENDOR_PROP += device/generic/common/props/vendor.prop -TARGET_SYSTEM_PROP += device/generic/common/system.prop +TARGET_VENDOR_PROP += $(LOCAL_COMMON_TREE)/properties/vendor.prop +TARGET_SYSTEM_PROP += $(LOCAL_COMMON_TREE)/properties/system.prop + +# Recovery +TARGET_RECOVERY_FSTAB := $(LOCAL_COMMON_TREE)/recovery.fstab +TARGET_RECOVERY_UI_LIB := librecovery_ui_x86 + +# Init +$(call soong_config_set,libinit,vendor_init_lib,//$(LOCAL_COMMON_TREE):init_x86) +TARGET_RECOVERY_DEVICE_MODULES ?= init_x86 # Include GloDroid components include device/generic/common/glodroid/BoardConfig_glodroid.mk - diff --git a/alsa/bytcrrt5640.state b/alsa/bytcrrt5640.state deleted file mode 100644 index 944edbb..0000000 --- a/alsa/bytcrrt5640.state +++ /dev/null @@ -1,3082 +0,0 @@ -state.bytcrrt5640 { - control.1 { - iface MIXER - name 'media0_out mix 0 media0_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.2 { - iface MIXER - name 'media0_out mix 0 media1_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.3 { - iface MIXER - name 'media0_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.4 { - iface MIXER - name 'media0_out mix 0 media3_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.5 { - iface MIXER - name 'media1_out mix 0 media0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.6 { - iface MIXER - name 'media1_out mix 0 media1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.7 { - iface MIXER - name 'media1_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.8 { - iface MIXER - name 'media1_out mix 0 media3_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.9 { - iface MIXER - name 'pcm0_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.10 { - iface MIXER - name 'pcm0_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.11 { - iface MIXER - name 'pcm0_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.12 { - iface MIXER - name 'pcm0_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.13 { - iface MIXER - name 'pcm0_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.14 { - iface MIXER - name 'pcm0_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.15 { - iface MIXER - name 'pcm0_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.16 { - iface MIXER - name 'pcm0_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.17 { - iface MIXER - name 'pcm1_out mix 0 modem_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.18 { - iface MIXER - name 'pcm1_out mix 0 codec_in0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.19 { - iface MIXER - name 'pcm1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.20 { - iface MIXER - name 'pcm1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.21 { - iface MIXER - name 'pcm1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.22 { - iface MIXER - name 'pcm1_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.23 { - iface MIXER - name 'pcm1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.24 { - iface MIXER - name 'pcm1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.25 { - iface MIXER - name 'pcm2_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.26 { - iface MIXER - name 'pcm2_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.27 { - iface MIXER - name 'pcm2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.28 { - iface MIXER - name 'pcm2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.29 { - iface MIXER - name 'pcm2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.30 { - iface MIXER - name 'pcm2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.31 { - iface MIXER - name 'pcm2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.32 { - iface MIXER - name 'pcm2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.33 { - iface MIXER - name 'sprot_loop_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.34 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.35 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.36 { - iface MIXER - name 'sprot_loop_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.37 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.38 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.39 { - iface MIXER - name 'sprot_loop_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.40 { - iface MIXER - name 'sprot_loop_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.41 { - iface MIXER - name 'media_loop1_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.42 { - iface MIXER - name 'media_loop1_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.43 { - iface MIXER - name 'media_loop1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.44 { - iface MIXER - name 'media_loop1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.45 { - iface MIXER - name 'media_loop1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.46 { - iface MIXER - name 'media_loop1_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.47 { - iface MIXER - name 'media_loop1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.48 { - iface MIXER - name 'media_loop1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.49 { - iface MIXER - name 'media_loop2_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.50 { - iface MIXER - name 'media_loop2_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.51 { - iface MIXER - name 'media_loop2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.52 { - iface MIXER - name 'media_loop2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.53 { - iface MIXER - name 'media_loop2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.54 { - iface MIXER - name 'media_loop2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.55 { - iface MIXER - name 'media_loop2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.56 { - iface MIXER - name 'media_loop2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.57 { - iface MIXER - name 'codec_out0 mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.58 { - iface MIXER - name 'codec_out0 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.59 { - iface MIXER - name 'codec_out0 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.60 { - iface MIXER - name 'codec_out0 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.61 { - iface MIXER - name 'codec_out0 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.62 { - iface MIXER - name 'codec_out0 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.63 { - iface MIXER - name 'codec_out0 mix 0 pcm0_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.64 { - iface MIXER - name 'codec_out0 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.65 { - iface MIXER - name 'codec_out1 mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.66 { - iface MIXER - name 'codec_out1 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.67 { - iface MIXER - name 'codec_out1 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.68 { - iface MIXER - name 'codec_out1 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.69 { - iface MIXER - name 'codec_out1 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.70 { - iface MIXER - name 'codec_out1 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.71 { - iface MIXER - name 'codec_out1 mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.72 { - iface MIXER - name 'codec_out1 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.73 { - iface MIXER - name 'modem_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.74 { - iface MIXER - name 'modem_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.75 { - iface MIXER - name 'modem_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.76 { - iface MIXER - name 'modem_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.77 { - iface MIXER - name 'modem_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.78 { - iface MIXER - name 'modem_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.79 { - iface MIXER - name 'modem_out mix 0 pcm0_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.80 { - iface MIXER - name 'modem_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.81 { - iface MIXER - name 'media0_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.82 { - iface MIXER - name 'media0_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.83 { - iface MIXER - name 'media0_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.84 { - iface MIXER - name 'media1_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.85 { - iface MIXER - name 'media1_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.86 { - iface MIXER - name 'media1_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.87 { - iface MIXER - name 'media2_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.88 { - iface MIXER - name 'media2_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.89 { - iface MIXER - name 'media2_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.90 { - iface MIXER - name 'media3_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.91 { - iface MIXER - name 'media3_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.92 { - iface MIXER - name 'media3_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.93 { - iface MIXER - name 'pcm0_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.94 { - iface MIXER - name 'pcm0_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.95 { - iface MIXER - name 'pcm0_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.96 { - iface MIXER - name 'pcm1_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.97 { - iface MIXER - name 'pcm1_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.98 { - iface MIXER - name 'pcm1_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.99 { - iface MIXER - name 'pcm1_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.100 { - iface MIXER - name 'pcm1_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.101 { - iface MIXER - name 'pcm1_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.102 { - iface MIXER - name 'pcm2_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.103 { - iface MIXER - name 'pcm2_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.104 { - iface MIXER - name 'pcm2_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.105 { - iface MIXER - name 'codec_in0 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.106 { - iface MIXER - name 'codec_in0 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.107 { - iface MIXER - name 'codec_in0 Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.108 { - iface MIXER - name 'codec_in1 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.109 { - iface MIXER - name 'codec_in1 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.110 { - iface MIXER - name 'codec_in1 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.111 { - iface MIXER - name 'codec_out0 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.112 { - iface MIXER - name 'codec_out0 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.113 { - iface MIXER - name 'codec_out0 Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.114 { - iface MIXER - name 'codec_out1 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.115 { - iface MIXER - name 'codec_out1 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.116 { - iface MIXER - name 'codec_out1 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.117 { - iface MIXER - name 'media_loop1_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.118 { - iface MIXER - name 'media_loop1_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.119 { - iface MIXER - name 'media_loop1_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.120 { - iface MIXER - name 'media_loop2_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.121 { - iface MIXER - name 'media_loop2_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.122 { - iface MIXER - name 'media_loop2_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.123 { - iface MIXER - name 'sprot_loop_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.124 { - iface MIXER - name 'sprot_loop_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.125 { - iface MIXER - name 'sprot_loop_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.126 { - iface MIXER - name 'media0_in Volume 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.127 { - iface MIXER - name 'media0_in Volume 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.128 { - iface MIXER - name 'media0_in Volume 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.129 { - iface MIXER - name 'modem_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.130 { - iface MIXER - name 'modem_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.131 { - iface MIXER - name 'modem_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.132 { - iface MIXER - name 'modem_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.133 { - iface MIXER - name 'modem_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.134 { - iface MIXER - name 'modem_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.135 { - iface MIXER - name 'media_loop1_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.136 { - iface MIXER - name 'media_loop1_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.137 { - iface MIXER - name 'media_loop1_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.138 { - iface MIXER - name 'media_loop2_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.139 { - iface MIXER - name 'media_loop2_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.140 { - iface MIXER - name 'media_loop2_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.141 { - iface MIXER - name 'sprot_loop_out lpro 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 194 - } - } - control.142 { - iface MIXER - name 'codec_in0 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.143 { - iface MIXER - name 'codec_in1 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.144 { - iface MIXER - name 'codec_out tx interleaver slot 0' - value codec_out0_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.145 { - iface MIXER - name 'codec_out tx interleaver slot 1' - value codec_out0_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.146 { - iface MIXER - name 'codec_out tx interleaver slot 2' - value codec_out1_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.147 { - iface MIXER - name 'codec_out tx interleaver slot 3' - value codec_out1_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.148 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_0' - value 'slot 0' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.149 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_1' - value 'slot 1' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.150 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_0' - value 'slot 2' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.151 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_1' - value 'slot 3' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.152 { - iface MIXER - name 'Mono Playback Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.153 { - iface MIXER - name 'Mono DAC Playback Volume' - value.0 175 - value.1 175 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 175' - dbmin -65625 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.154 { - iface MIXER - name 'Speaker Channel Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.155 { - iface MIXER - name 'Speaker Playback Volume' - value.0 29 - value.1 29 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 -300 - dbvalue.1 -300 - } - } - control.156 { - iface MIXER - name 'HP Channel Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.157 { - iface MIXER - name 'HP Playback Volume' - value.0 29 - value.1 29 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 -300 - dbvalue.1 -300 - } - } - control.158 { - iface MIXER - name 'OUT Playback Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.159 { - iface MIXER - name 'OUT Channel Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.160 { - iface MIXER - name 'OUT Playback Volume' - value.0 31 - value.1 31 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.161 { - iface MIXER - name 'DAC2 Playback Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.162 { - iface MIXER - name 'DAC1 Playback Volume' - value.0 175 - value.1 175 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 175' - dbmin -65625 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.163 { - iface MIXER - name 'IN1 Boost' - value 0 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 8' - dbmin 0 - dbmax 5200 - dbvalue.0 0 - } - } - control.164 { - iface MIXER - name 'IN2 Boost' - value 0 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 8' - dbmin 0 - dbmax 5200 - dbvalue.0 0 - } - } - control.165 { - iface MIXER - name 'IN3 Boost' - value 8 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 8' - dbmin 0 - dbmax 5200 - dbvalue.0 5200 - } - } - control.166 { - iface MIXER - name 'IN Capture Volume' - value.0 23 - value.1 23 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 31' - dbmin -3450 - dbmax 1200 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.167 { - iface MIXER - name 'ADC Capture Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.168 { - iface MIXER - name 'ADC Capture Volume' - value.0 47 - value.1 47 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 127' - dbmin -17625 - dbmax 30000 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.169 { - iface MIXER - name 'Mono ADC Capture Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.170 { - iface MIXER - name 'Mono ADC Capture Volume' - value.0 47 - value.1 47 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 127' - dbmin -17625 - dbmax 30000 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.171 { - iface MIXER - name 'ADC Boost Gain' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.172 { - iface MIXER - name 'Class D SPK Ratio Control' - value '2.77x' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 '1.66x' - item.1 '1.83x' - item.2 '1.94x' - item.3 '2x' - item.4 '2.11x' - item.5 '2.22x' - item.6 '2.33x' - item.7 '2.44x' - item.8 '2.55x' - item.9 '2.66x' - item.10 '2.77x' - } - } - control.173 { - iface MIXER - name 'ADC IF1 Data Switch' - value Normal - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Normal - item.1 Swap - item.2 'left copy to right' - item.3 'right copy to left' - } - } - control.174 { - iface MIXER - name 'DAC IF1 Data Switch' - value Normal - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Normal - item.1 Swap - item.2 'left copy to right' - item.3 'right copy to left' - } - } - control.175 { - iface MIXER - name 'ADC IF2 Data Switch' - value Normal - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Normal - item.1 Swap - item.2 'left copy to right' - item.3 'right copy to left' - } - } - control.176 { - iface MIXER - name 'DAC IF2 Data Switch' - value Normal - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Normal - item.1 Swap - item.2 'left copy to right' - item.3 'right copy to left' - } - } - control.177 { - iface MIXER - name 'Headphone Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.178 { - iface MIXER - name 'Headset Mic Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.179 { - iface MIXER - name 'Internal Mic Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.180 { - iface MIXER - name 'Speaker Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.181 { - iface MIXER - name 'RECMIXL HPOL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.182 { - iface MIXER - name 'RECMIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.183 { - iface MIXER - name 'RECMIXL BST3 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.184 { - iface MIXER - name 'RECMIXL BST2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.185 { - iface MIXER - name 'RECMIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.186 { - iface MIXER - name 'RECMIXL OUT MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.187 { - iface MIXER - name 'RECMIXR HPOR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.188 { - iface MIXER - name 'RECMIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.189 { - iface MIXER - name 'RECMIXR BST3 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.190 { - iface MIXER - name 'RECMIXR BST2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.191 { - iface MIXER - name 'RECMIXR BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.192 { - iface MIXER - name 'RECMIXR OUT MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.193 { - iface MIXER - name 'Stereo ADC2 Mux' - value DMIC1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 DMIC1 - item.1 DMIC2 - item.2 'DIG MIX' - } - } - control.194 { - iface MIXER - name 'Stereo ADC1 Mux' - value ADC - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DIG MIX' - item.1 ADC - } - } - control.195 { - iface MIXER - name 'Mono ADC L2 Mux' - value 'DMIC L1' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DMIC L1' - item.1 'DMIC L2' - item.2 'Mono DAC MIXL' - } - } - control.196 { - iface MIXER - name 'Mono ADC L1 Mux' - value ADCL - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXL' - item.1 ADCL - } - } - control.197 { - iface MIXER - name 'Mono ADC R1 Mux' - value ADCR - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXR' - item.1 ADCR - } - } - control.198 { - iface MIXER - name 'Mono ADC R2 Mux' - value 'DMIC R1' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DMIC R1' - item.1 'DMIC R2' - item.2 'Mono DAC MIXR' - } - } - control.199 { - iface MIXER - name 'Stereo ADC MIXL ADC1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.200 { - iface MIXER - name 'Stereo ADC MIXL ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.201 { - iface MIXER - name 'Stereo ADC MIXR ADC1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.202 { - iface MIXER - name 'Stereo ADC MIXR ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.203 { - iface MIXER - name 'Mono ADC MIXL ADC1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.204 { - iface MIXER - name 'Mono ADC MIXL ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.205 { - iface MIXER - name 'Mono ADC MIXR ADC1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.206 { - iface MIXER - name 'Mono ADC MIXR ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.207 { - iface MIXER - name 'DAI select' - value '1:1|2:2' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 '1:1|2:2' - item.1 '1:2|2:1' - item.2 '1:1|2:1' - item.3 '1:2|2:2' - } - } - control.208 { - iface MIXER - name 'SDI select' - value IF1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 IF1 - item.1 IF2 - } - } - control.209 { - iface MIXER - name 'DAC MIXL Stereo ADC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.210 { - iface MIXER - name 'DAC MIXL INF1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.211 { - iface MIXER - name 'DAC MIXR Stereo ADC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.212 { - iface MIXER - name 'DAC MIXR INF1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.213 { - iface MIXER - name 'Mono DAC MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.214 { - iface MIXER - name 'Mono DAC MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.215 { - iface MIXER - name 'Mono DAC MIXL DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.216 { - iface MIXER - name 'Mono DAC MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.217 { - iface MIXER - name 'Mono DAC MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.218 { - iface MIXER - name 'Mono DAC MIXR DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.219 { - iface MIXER - name 'DIG MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.220 { - iface MIXER - name 'DIG MIXL DAC L2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.221 { - iface MIXER - name 'DIG MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.222 { - iface MIXER - name 'DIG MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.223 { - iface MIXER - name 'SPK MIXL REC MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.224 { - iface MIXER - name 'SPK MIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.225 { - iface MIXER - name 'SPK MIXL DAC L1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.226 { - iface MIXER - name 'SPK MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.227 { - iface MIXER - name 'SPK MIXL OUT MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.228 { - iface MIXER - name 'SPK MIXR REC MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.229 { - iface MIXER - name 'SPK MIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.230 { - iface MIXER - name 'SPK MIXR DAC R1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.231 { - iface MIXER - name 'SPK MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.232 { - iface MIXER - name 'SPK MIXR OUT MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.233 { - iface MIXER - name 'SPOL MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.234 { - iface MIXER - name 'SPOL MIX DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.235 { - iface MIXER - name 'SPOL MIX SPKVOL R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.236 { - iface MIXER - name 'SPOL MIX SPKVOL L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.237 { - iface MIXER - name 'SPOL MIX BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.238 { - iface MIXER - name 'SPOR MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.239 { - iface MIXER - name 'SPOR MIX SPKVOL R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.240 { - iface MIXER - name 'SPOR MIX BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.241 { - iface MIXER - name 'LOUT MIX DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.242 { - iface MIXER - name 'LOUT MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.243 { - iface MIXER - name 'LOUT MIX OUTVOL L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.244 { - iface MIXER - name 'LOUT MIX OUTVOL R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.245 { - iface MIXER - name 'Speaker L Playback Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.246 { - iface MIXER - name 'Speaker R Playback Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.247 { - iface MIXER - name 'HP L Playback Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.248 { - iface MIXER - name 'HP R Playback Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.249 { - iface MIXER - name 'DAC L2 Mux' - value IF2 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 IF2 - item.1 'Base L/R' - } - } - control.250 { - iface MIXER - name 'DAC R2 Mux' - value IF2 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 IF2 - } - } - control.251 { - iface MIXER - name 'Stereo DAC MIXL DAC L1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.252 { - iface MIXER - name 'Stereo DAC MIXL DAC L2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.253 { - iface MIXER - name 'Stereo DAC MIXL ANC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.254 { - iface MIXER - name 'Stereo DAC MIXR DAC R1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.255 { - iface MIXER - name 'Stereo DAC MIXR DAC R2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.256 { - iface MIXER - name 'Stereo DAC MIXR ANC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.257 { - iface MIXER - name 'OUT MIXL SPK MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.258 { - iface MIXER - name 'OUT MIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.259 { - iface MIXER - name 'OUT MIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.260 { - iface MIXER - name 'OUT MIXL REC MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.261 { - iface MIXER - name 'OUT MIXL DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.262 { - iface MIXER - name 'OUT MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.263 { - iface MIXER - name 'OUT MIXL DAC L1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.264 { - iface MIXER - name 'OUT MIXR SPK MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.265 { - iface MIXER - name 'OUT MIXR BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.266 { - iface MIXER - name 'OUT MIXR BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.267 { - iface MIXER - name 'OUT MIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.268 { - iface MIXER - name 'OUT MIXR REC MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.269 { - iface MIXER - name 'OUT MIXR DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.270 { - iface MIXER - name 'OUT MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.271 { - iface MIXER - name 'OUT MIXR DAC R1 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.272 { - iface MIXER - name 'HPO MIX DAC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.273 { - iface MIXER - name 'HPO MIX DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.274 { - iface MIXER - name 'HPO MIX HPVOL Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.275 { - iface MIXER - name 'Mono MIX DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.276 { - iface MIXER - name 'Mono MIX DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.277 { - iface MIXER - name 'Mono MIX OUTVOL R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.278 { - iface MIXER - name 'Mono MIX OUTVOL L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.279 { - iface MIXER - name 'Mono MIX BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } -} diff --git a/alsa/chtcx2072x.state b/alsa/chtcx2072x.state deleted file mode 100644 index 5170b5a..0000000 --- a/alsa/chtcx2072x.state +++ /dev/null @@ -1,2370 +0,0 @@ -state.chtcx2072x { - control.1 { - iface MIXER - name 'media0_out mix 0 media0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.2 { - iface MIXER - name 'media0_out mix 0 media1_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.3 { - iface MIXER - name 'media0_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.4 { - iface MIXER - name 'media0_out mix 0 media3_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.5 { - iface MIXER - name 'media1_out mix 0 media0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.6 { - iface MIXER - name 'media1_out mix 0 media1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.7 { - iface MIXER - name 'media1_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.8 { - iface MIXER - name 'media1_out mix 0 media3_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.9 { - iface MIXER - name 'pcm0_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.10 { - iface MIXER - name 'pcm0_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.11 { - iface MIXER - name 'pcm0_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.12 { - iface MIXER - name 'pcm0_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.13 { - iface MIXER - name 'pcm0_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.14 { - iface MIXER - name 'pcm0_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.15 { - iface MIXER - name 'pcm0_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.16 { - iface MIXER - name 'pcm0_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.17 { - iface MIXER - name 'pcm1_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.18 { - iface MIXER - name 'pcm1_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.19 { - iface MIXER - name 'pcm1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.20 { - iface MIXER - name 'pcm1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.21 { - iface MIXER - name 'pcm1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.22 { - iface MIXER - name 'pcm1_out mix 0 media_loop2_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.23 { - iface MIXER - name 'pcm1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.24 { - iface MIXER - name 'pcm1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.25 { - iface MIXER - name 'pcm2_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.26 { - iface MIXER - name 'pcm2_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.27 { - iface MIXER - name 'pcm2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.28 { - iface MIXER - name 'pcm2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.29 { - iface MIXER - name 'pcm2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.30 { - iface MIXER - name 'pcm2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.31 { - iface MIXER - name 'pcm2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.32 { - iface MIXER - name 'pcm2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.33 { - iface MIXER - name 'sprot_loop_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.34 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.35 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.36 { - iface MIXER - name 'sprot_loop_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.37 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.38 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.39 { - iface MIXER - name 'sprot_loop_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.40 { - iface MIXER - name 'sprot_loop_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.41 { - iface MIXER - name 'media_loop1_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.42 { - iface MIXER - name 'media_loop1_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.43 { - iface MIXER - name 'media_loop1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.44 { - iface MIXER - name 'media_loop1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.45 { - iface MIXER - name 'media_loop1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.46 { - iface MIXER - name 'media_loop1_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.47 { - iface MIXER - name 'media_loop1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.48 { - iface MIXER - name 'media_loop1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.49 { - iface MIXER - name 'media_loop2_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.50 { - iface MIXER - name 'media_loop2_out mix 0 codec_in0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.51 { - iface MIXER - name 'media_loop2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.52 { - iface MIXER - name 'media_loop2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.53 { - iface MIXER - name 'media_loop2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.54 { - iface MIXER - name 'media_loop2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.55 { - iface MIXER - name 'media_loop2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.56 { - iface MIXER - name 'media_loop2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.57 { - iface MIXER - name 'codec_out0 mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.58 { - iface MIXER - name 'codec_out0 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.59 { - iface MIXER - name 'codec_out0 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.60 { - iface MIXER - name 'codec_out0 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.61 { - iface MIXER - name 'codec_out0 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.62 { - iface MIXER - name 'codec_out0 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.63 { - iface MIXER - name 'codec_out0 mix 0 pcm0_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.64 { - iface MIXER - name 'codec_out0 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.65 { - iface MIXER - name 'codec_out1 mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.66 { - iface MIXER - name 'codec_out1 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.67 { - iface MIXER - name 'codec_out1 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.68 { - iface MIXER - name 'codec_out1 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.69 { - iface MIXER - name 'codec_out1 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.70 { - iface MIXER - name 'codec_out1 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.71 { - iface MIXER - name 'codec_out1 mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.72 { - iface MIXER - name 'codec_out1 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.73 { - iface MIXER - name 'modem_out mix 0 modem_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.74 { - iface MIXER - name 'modem_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.75 { - iface MIXER - name 'modem_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.76 { - iface MIXER - name 'modem_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.77 { - iface MIXER - name 'modem_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.78 { - iface MIXER - name 'modem_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.79 { - iface MIXER - name 'modem_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.80 { - iface MIXER - name 'modem_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.81 { - iface MIXER - name 'media0_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.82 { - iface MIXER - name 'media0_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.83 { - iface MIXER - name 'media0_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.84 { - iface MIXER - name 'media1_in Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.85 { - iface MIXER - name 'media1_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.86 { - iface MIXER - name 'media1_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.87 { - iface MIXER - name 'media2_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.88 { - iface MIXER - name 'media2_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.89 { - iface MIXER - name 'media2_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.90 { - iface MIXER - name 'media3_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.91 { - iface MIXER - name 'media3_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.92 { - iface MIXER - name 'media3_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.93 { - iface MIXER - name 'pcm0_in Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.94 { - iface MIXER - name 'pcm0_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.95 { - iface MIXER - name 'pcm0_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.96 { - iface MIXER - name 'pcm1_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.97 { - iface MIXER - name 'pcm1_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.98 { - iface MIXER - name 'pcm1_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.99 { - iface MIXER - name 'pcm1_out Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.100 { - iface MIXER - name 'pcm1_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.101 { - iface MIXER - name 'pcm1_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.102 { - iface MIXER - name 'pcm2_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.103 { - iface MIXER - name 'pcm2_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.104 { - iface MIXER - name 'pcm2_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.105 { - iface MIXER - name 'codec_in0 Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.106 { - iface MIXER - name 'codec_in0 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.107 { - iface MIXER - name 'codec_in0 Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.108 { - iface MIXER - name 'codec_in1 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.109 { - iface MIXER - name 'codec_in1 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.110 { - iface MIXER - name 'codec_in1 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.111 { - iface MIXER - name 'codec_out0 Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.112 { - iface MIXER - name 'codec_out0 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.113 { - iface MIXER - name 'codec_out0 Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.114 { - iface MIXER - name 'codec_out1 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.115 { - iface MIXER - name 'codec_out1 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.116 { - iface MIXER - name 'codec_out1 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.117 { - iface MIXER - name 'media_loop1_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.118 { - iface MIXER - name 'media_loop1_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.119 { - iface MIXER - name 'media_loop1_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.120 { - iface MIXER - name 'media_loop2_out Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.121 { - iface MIXER - name 'media_loop2_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.122 { - iface MIXER - name 'media_loop2_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.123 { - iface MIXER - name 'sprot_loop_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.124 { - iface MIXER - name 'sprot_loop_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.125 { - iface MIXER - name 'sprot_loop_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.126 { - iface MIXER - name 'media0_in Volume 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.127 { - iface MIXER - name 'media0_in Volume 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.128 { - iface MIXER - name 'media0_in Volume 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.129 { - iface MIXER - name 'modem_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.130 { - iface MIXER - name 'modem_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.131 { - iface MIXER - name 'modem_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.132 { - iface MIXER - name 'modem_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.133 { - iface MIXER - name 'modem_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.134 { - iface MIXER - name 'modem_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.135 { - iface MIXER - name 'media_loop1_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.136 { - iface MIXER - name 'media_loop1_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.137 { - iface MIXER - name 'media_loop1_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.138 { - iface MIXER - name 'media_loop2_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.139 { - iface MIXER - name 'media_loop2_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.140 { - iface MIXER - name 'media_loop2_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.141 { - iface MIXER - name 'sprot_loop_out lpro 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 194 - } - } - control.142 { - iface MIXER - name 'codec_in0 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.143 { - iface MIXER - name 'codec_in1 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.144 { - iface MIXER - name 'codec_out tx interleaver slot 0' - value codec_out0_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.145 { - iface MIXER - name 'codec_out tx interleaver slot 1' - value codec_out0_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.146 { - iface MIXER - name 'codec_out tx interleaver slot 2' - value codec_out1_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.147 { - iface MIXER - name 'codec_out tx interleaver slot 3' - value codec_out1_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.148 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_0' - value 'slot 0' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.149 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_1' - value 'slot 1' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.150 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_0' - value 'slot 2' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.151 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_1' - value 'slot 3' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.152 { - iface MIXER - name 'PortD Boost Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.153 { - iface MIXER - name 'PortC Boost Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.154 { - iface MIXER - name 'PortB Boost Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.155 { - iface MIXER - name 'PortD ADC1 Volume' - value.0 74 - value.1 74 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 74' - dbmin -7400 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.156 { - iface MIXER - name 'PortC ADC1 Volume' - value.0 74 - value.1 74 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 74' - dbmin -7400 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.157 { - iface MIXER - name 'PortB ADC1 Volume' - value.0 74 - value.1 74 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 74' - dbmin -7400 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.158 { - iface MIXER - name 'DAC1 Volume' - value.0 74 - value.1 74 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 74' - dbmin -7400 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.159 { - iface MIXER - name 'DAC1 Mute Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.160 { - iface MIXER - name 'DAC2 Volume' - value.0 74 - value.1 74 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 74' - dbmin -7400 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.161 { - iface MIXER - name 'EQ Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.162 { - iface MIXER - name 'DRC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.163 { - iface MIXER - name 'DACL EQ 0' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.164 { - iface MIXER - name 'DACL EQ 1' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.165 { - iface MIXER - name 'DACL EQ 2' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.166 { - iface MIXER - name 'DACL EQ 3' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.167 { - iface MIXER - name 'DACL EQ 4' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.168 { - iface MIXER - name 'DACL EQ 5' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.169 { - iface MIXER - name 'DACL EQ 6' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.170 { - iface MIXER - name 'DACR EQ 0' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.171 { - iface MIXER - name 'DACR EQ 1' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.172 { - iface MIXER - name 'DACR EQ 2' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.173 { - iface MIXER - name 'DACR EQ 3' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.174 { - iface MIXER - name 'DACR EQ 4' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.175 { - iface MIXER - name 'DACR EQ 5' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.176 { - iface MIXER - name 'DACR EQ 6' - value '0040000000000000000003' - comment { - access 'read write volatile' - type BYTES - count 11 - } - } - control.177 { - iface MIXER - name DRC - value '000000000000000000' - comment { - access 'read write' - type BYTES - count 9 - } - } - control.178 { - iface MIXER - name 'HPF Freq' - value 4 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 63' - dbmin 30 - dbmax 1890 - dbvalue.0 120 - } - } - control.179 { - iface MIXER - name 'HPF Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.180 { - iface MIXER - name 'Class-D Output Level' - value '000000000000' - comment { - access 'read write' - type BYTES - count 6 - } - } - control.181 { - iface MIXER - name 'PortA HP Amp Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.182 { - iface CARD - name 'Headset Mic Jack' - value false - comment { - access read - type BOOLEAN - count 1 - } - } - control.183 { - iface CARD - name 'Headphone Jack' - value false - comment { - access read - type BOOLEAN - count 1 - } - } - control.184 { - iface MIXER - name 'Headphone Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.185 { - iface MIXER - name 'Headset Mic Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.186 { - iface MIXER - name 'Int Mic Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.187 { - iface MIXER - name 'Ext Spk Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.188 { - iface MIXER - name 'I2S DAC1L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.189 { - iface MIXER - name 'I2S DAC1R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.190 { - iface MIXER - name 'I2S DAC2L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.191 { - iface MIXER - name 'I2S DAC2R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.192 { - iface MIXER - name 'PortA Mux' - value 'DAC1 Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC1 Switch' - item.1 'DAC2 Switch' - } - } - control.193 { - iface MIXER - name 'PortG Mux' - value 'DAC1 Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC1 Switch' - item.1 'DAC2 Switch' - } - } - control.194 { - iface MIXER - name 'PortE Mux' - value 'DAC1 Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC1 Switch' - item.1 'DAC2 Switch' - } - } - control.195 { - iface MIXER - name 'PortM Mux' - value 'DAC1 Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC1 Switch' - item.1 'DAC2 Switch' - } - } - control.196 { - iface MIXER - name 'PortA Out En Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.197 { - iface MIXER - name 'PortE Out En Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.198 { - iface MIXER - name 'PortG Out En Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.199 { - iface MIXER - name 'PortM Out En Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.200 { - iface MIXER - name 'I2S ADC1L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.201 { - iface MIXER - name 'I2S ADC1R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.202 { - iface MIXER - name 'I2S ADC2L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.203 { - iface MIXER - name 'I2S ADC2R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.204 { - iface MIXER - name 'ADC1 Mux' - value 'PortB Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'PortB Switch' - item.1 'PortD Switch' - item.2 'PortC Switch' - item.3 'Widget15 Switch' - item.4 'PortE Switch' - item.5 'PortF Switch' - item.6 'PortH Switch' - } - } - control.205 { - iface MIXER - name 'ADC2 Mux' - value 'PortC Switch' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'PortC Switch' - item.1 'Widget15 Switch' - item.2 'PortH Switch' - } - } - control.206 { - iface MIXER - name 'Widget15 Mixer DAC1L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.207 { - iface MIXER - name 'Widget15 Mixer DAC1R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.208 { - iface MIXER - name 'Widget15 Mixer DAC2L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.209 { - iface MIXER - name 'Widget15 Mixer DAC2R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.210 { - iface MIXER - name 'PortB In En Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.211 { - iface MIXER - name 'PortC In En Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.212 { - iface MIXER - name 'PortD In En Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.213 { - iface MIXER - name 'PortE In En Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } -} diff --git a/alsa/chtrt5645.state b/alsa/chtrt5645.state deleted file mode 100644 index b0c2fec..0000000 --- a/alsa/chtrt5645.state +++ /dev/null @@ -1,2949 +0,0 @@ -state.chtrt5645 { - control.1 { - iface MIXER - name 'media0_out mix 0 media0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.2 { - iface MIXER - name 'media0_out mix 0 media1_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.3 { - iface MIXER - name 'media0_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.4 { - iface MIXER - name 'media0_out mix 0 media3_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.5 { - iface MIXER - name 'media1_out mix 0 media0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.6 { - iface MIXER - name 'media1_out mix 0 media1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.7 { - iface MIXER - name 'media1_out mix 0 media2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.8 { - iface MIXER - name 'media1_out mix 0 media3_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.9 { - iface MIXER - name 'pcm0_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.10 { - iface MIXER - name 'pcm0_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.11 { - iface MIXER - name 'pcm0_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.12 { - iface MIXER - name 'pcm0_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.13 { - iface MIXER - name 'pcm0_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.14 { - iface MIXER - name 'pcm0_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.15 { - iface MIXER - name 'pcm0_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.16 { - iface MIXER - name 'pcm1_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.17 { - iface MIXER - name 'pcm1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.18 { - iface MIXER - name 'pcm1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.19 { - iface MIXER - name 'pcm1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.20 { - iface MIXER - name 'pcm1_out mix 0 media_loop2_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.21 { - iface MIXER - name 'pcm1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.22 { - iface MIXER - name 'pcm1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.23 { - iface MIXER - name 'pcm2_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.24 { - iface MIXER - name 'pcm2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.25 { - iface MIXER - name 'pcm2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.26 { - iface MIXER - name 'pcm2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.27 { - iface MIXER - name 'pcm2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.28 { - iface MIXER - name 'pcm2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.29 { - iface MIXER - name 'pcm2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.30 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.31 { - iface MIXER - name 'sprot_loop_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.32 { - iface MIXER - name 'sprot_loop_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.33 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.34 { - iface MIXER - name 'sprot_loop_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.35 { - iface MIXER - name 'sprot_loop_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.36 { - iface MIXER - name 'sprot_loop_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.37 { - iface MIXER - name 'media_loop1_out mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.38 { - iface MIXER - name 'media_loop1_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.39 { - iface MIXER - name 'media_loop1_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.40 { - iface MIXER - name 'media_loop1_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.41 { - iface MIXER - name 'media_loop1_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.42 { - iface MIXER - name 'media_loop1_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.43 { - iface MIXER - name 'media_loop1_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.44 { - iface MIXER - name 'media_loop2_out mix 0 codec_in0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.45 { - iface MIXER - name 'media_loop2_out mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.46 { - iface MIXER - name 'media_loop2_out mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.47 { - iface MIXER - name 'media_loop2_out mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.48 { - iface MIXER - name 'media_loop2_out mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.49 { - iface MIXER - name 'media_loop2_out mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.50 { - iface MIXER - name 'media_loop2_out mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.51 { - iface MIXER - name 'codec_out0 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.52 { - iface MIXER - name 'codec_out0 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.53 { - iface MIXER - name 'codec_out0 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.54 { - iface MIXER - name 'codec_out0 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.55 { - iface MIXER - name 'codec_out0 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.56 { - iface MIXER - name 'codec_out0 mix 0 pcm0_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.57 { - iface MIXER - name 'codec_out0 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.58 { - iface MIXER - name 'codec_out1 mix 0 codec_in0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.59 { - iface MIXER - name 'codec_out1 mix 0 codec_in1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.60 { - iface MIXER - name 'codec_out1 mix 0 sprot_loop_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.61 { - iface MIXER - name 'codec_out1 mix 0 media_loop1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.62 { - iface MIXER - name 'codec_out1 mix 0 media_loop2_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.63 { - iface MIXER - name 'codec_out1 mix 0 pcm0_in Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.64 { - iface MIXER - name 'codec_out1 mix 0 pcm1_in Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.65 { - iface MIXER - name 'media0_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.66 { - iface MIXER - name 'media0_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.67 { - iface MIXER - name 'media0_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.68 { - iface MIXER - name 'media1_in Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.69 { - iface MIXER - name 'media1_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.70 { - iface MIXER - name 'media1_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.71 { - iface MIXER - name 'media2_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.72 { - iface MIXER - name 'media2_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.73 { - iface MIXER - name 'media2_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.74 { - iface MIXER - name 'media3_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.75 { - iface MIXER - name 'media3_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.76 { - iface MIXER - name 'media3_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.77 { - iface MIXER - name 'pcm0_in Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.78 { - iface MIXER - name 'pcm0_in Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.79 { - iface MIXER - name 'pcm0_in Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.80 { - iface MIXER - name 'pcm1_in Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.81 { - iface MIXER - name 'pcm1_in Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.82 { - iface MIXER - name 'pcm1_in Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.83 { - iface MIXER - name 'pcm1_out Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.84 { - iface MIXER - name 'pcm1_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.85 { - iface MIXER - name 'pcm1_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.86 { - iface MIXER - name 'pcm2_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.87 { - iface MIXER - name 'pcm2_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.88 { - iface MIXER - name 'pcm2_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.89 { - iface MIXER - name 'codec_in0 Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.90 { - iface MIXER - name 'codec_in0 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.91 { - iface MIXER - name 'codec_in0 Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.92 { - iface MIXER - name 'codec_in1 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.93 { - iface MIXER - name 'codec_in1 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.94 { - iface MIXER - name 'codec_in1 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.95 { - iface MIXER - name 'codec_out0 Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.96 { - iface MIXER - name 'codec_out0 Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.97 { - iface MIXER - name 'codec_out0 Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.98 { - iface MIXER - name 'codec_out1 Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.99 { - iface MIXER - name 'codec_out1 Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.100 { - iface MIXER - name 'codec_out1 Gain 0 Volume' - value.0 -180 - value.1 -180 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -1800 - dbvalue.1 -1800 - } - } - control.101 { - iface MIXER - name 'media_loop1_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.102 { - iface MIXER - name 'media_loop1_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.103 { - iface MIXER - name 'media_loop1_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.104 { - iface MIXER - name 'media_loop2_out Gain 0 Ramp Delay' - value 50 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.105 { - iface MIXER - name 'media_loop2_out Gain 0 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.106 { - iface MIXER - name 'media_loop2_out Gain 0 Volume' - value.0 0 - value.1 0 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.107 { - iface MIXER - name 'sprot_loop_out Gain 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.108 { - iface MIXER - name 'sprot_loop_out Gain 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.109 { - iface MIXER - name 'sprot_loop_out Gain 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.110 { - iface MIXER - name 'media0_in Volume 0 Ramp Delay' - value 5 - comment { - access 'read write' - type INTEGER - count 1 - range '5 - 5000' - } - } - control.111 { - iface MIXER - name 'media0_in Volume 0 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.112 { - iface MIXER - name 'media0_in Volume 0 Volume' - value.0 -1440 - value.1 -1440 - comment { - access 'read write' - type INTEGER - count 2 - range '-1440 - 360' - dbmin -14400 - dbmax 3600 - dbvalue.0 -14400 - dbvalue.1 -14400 - } - } - control.113 { - iface MIXER - name 'media_loop1_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.114 { - iface MIXER - name 'media_loop1_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.115 { - iface MIXER - name 'media_loop1_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.116 { - iface MIXER - name 'media_loop2_out fir 0 params' - value '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 274 - } - } - control.117 { - iface MIXER - name 'media_loop2_out iir 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 302 - } - } - control.118 { - iface MIXER - name 'media_loop2_out mdrp 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 288 - } - } - control.119 { - iface MIXER - name 'sprot_loop_out lpro 0 params' - value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 194 - } - } - control.120 { - iface MIXER - name 'codec_in0 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.121 { - iface MIXER - name 'codec_in1 dcr 0 params' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 54 - } - } - control.122 { - iface MIXER - name 'codec_out tx interleaver slot 0' - value codec_out0_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.123 { - iface MIXER - name 'codec_out tx interleaver slot 1' - value codec_out0_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.124 { - iface MIXER - name 'codec_out tx interleaver slot 2' - value codec_out1_0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.125 { - iface MIXER - name 'codec_out tx interleaver slot 3' - value codec_out1_1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 codec_out0_0 - item.2 codec_out0_1 - item.3 codec_out1_0 - item.4 codec_out1_1 - } - } - control.126 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_0' - value 'slot 0' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.127 { - iface MIXER - name 'codec_in rx deinterleaver codec_in0_1' - value 'slot 1' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.128 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_0' - value 'slot 2' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.129 { - iface MIXER - name 'codec_in rx deinterleaver codec_in1_1' - value 'slot 3' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 none - item.1 'slot 0' - item.2 'slot 1' - item.3 'slot 2' - item.4 'slot 3' - } - } - control.130 { - iface MIXER - name 'Speaker Channel Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.131 { - iface MIXER - name 'Speaker Playback Volume' - value.0 39 - value.1 39 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 1200 - dbvalue.1 1200 - } - } - control.132 { - iface MIXER - name 'Speaker ClassD Playback Volume' - value 4 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 7' - dbmin -600 - dbmax 228 - dbvalue.0 0 - } - } - control.133 { - iface MIXER - name 'Headphone Channel Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.134 { - iface MIXER - name 'Headphone Playback Volume' - value.0 17 - value.1 17 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 -2100 - dbvalue.1 -2100 - } - } - control.135 { - iface MIXER - name 'OUT Playback Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.136 { - iface MIXER - name 'OUT Channel Switch' - value.0 false - value.1 false - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.137 { - iface MIXER - name 'OUT Playback Volume' - value.0 31 - value.1 31 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 39' - dbmin -4650 - dbmax 1200 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.138 { - iface MIXER - name 'DAC2 Playback Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.139 { - iface MIXER - name 'DAC1 Playback Volume' - value.0 87 - value.1 87 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 87' - dbmin -6525 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.140 { - iface MIXER - name 'Mono DAC Playback Volume' - value.0 87 - value.1 87 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 87' - dbmin -6525 - dbmax 0 - dbvalue.0 0 - dbvalue.1 0 - } - } - control.141 { - iface MIXER - name 'IN1 Boost' - value 0 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 12' - dbmin 0 - dbmax 5200 - dbvalue.0 0 - } - } - control.142 { - iface MIXER - name 'IN2 Boost' - value 0 - comment { - access 'read write' - type INTEGER - count 1 - range '0 - 8' - dbmin 0 - dbmax 5200 - dbvalue.0 0 - } - } - control.143 { - iface MIXER - name 'IN Capture Volume' - value.0 31 - value.1 31 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 31' - dbmin -3450 - dbmax 1200 - dbvalue.0 1200 - dbvalue.1 1200 - } - } - control.144 { - iface MIXER - name 'ADC Capture Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.145 { - iface MIXER - name 'ADC Capture Volume' - value.0 31 - value.1 31 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 63' - dbmin -1725 - dbmax 3000 - dbvalue.0 600 - dbvalue.1 600 - } - } - control.146 { - iface MIXER - name 'Mono ADC Capture Switch' - value.0 true - value.1 true - comment { - access 'read write' - type BOOLEAN - count 2 - } - } - control.147 { - iface MIXER - name 'Mono ADC Capture Volume' - value.0 63 - value.1 63 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 63' - dbmin -1725 - dbmax 3000 - dbvalue.0 3000 - dbvalue.1 3000 - } - } - control.148 { - iface MIXER - name 'ADC Boost Capture Volume' - value.0 3 - value.1 3 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 3600 - dbvalue.1 3600 - } - } - control.149 { - iface MIXER - name 'Mono ADC Boost Capture Volume' - value.0 2 - value.1 2 - comment { - access 'read write' - type INTEGER - count 2 - range '0 - 3' - dbmin 0 - dbmax 3600 - dbvalue.0 2400 - dbvalue.1 2400 - } - } - control.150 { - iface MIXER - name 'I2S2 Func Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.151 { - iface MIXER - name 'Speaker HWEQ' - value '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - comment { - access 'read write' - type BYTES - count 228 - } - } - control.152 { - iface CARD - name 'Headphone Jack' - value true - comment { - access read - type BOOLEAN - count 1 - } - } - control.153 { - iface CARD - name 'Headset Mic Jack' - value true - comment { - access read - type BOOLEAN - count 1 - } - } - control.154 { - iface MIXER - name 'Headphone Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.155 { - iface MIXER - name 'Headset Mic Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.156 { - iface MIXER - name 'Int Mic Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.157 { - iface MIXER - name 'Ext Spk Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.158 { - iface MIXER - name 'RECMIXL HPOL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.159 { - iface MIXER - name 'RECMIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.160 { - iface MIXER - name 'RECMIXL BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.161 { - iface MIXER - name 'RECMIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.162 { - iface MIXER - name 'RECMIXL OUT MIXL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.163 { - iface MIXER - name 'RECMIXR HPOR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.164 { - iface MIXER - name 'RECMIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.165 { - iface MIXER - name 'RECMIXR BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.166 { - iface MIXER - name 'RECMIXR BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.167 { - iface MIXER - name 'RECMIXR OUT MIXR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.168 { - iface MIXER - name 'Stereo1 DMIC Mux' - value DMIC1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 DMIC1 - item.1 DMIC2 - } - } - control.169 { - iface MIXER - name 'Stereo1 ADC2 Mux' - value 'DAC MIX' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC MIX' - item.1 DMIC - } - } - control.170 { - iface MIXER - name 'Stereo1 ADC1 Mux' - value ADC - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'DAC MIX' - item.1 ADC - } - } - control.171 { - iface MIXER - name 'Mono DMIC L Mux' - value DMIC1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 DMIC1 - item.1 DMIC2 - } - } - control.172 { - iface MIXER - name 'Mono DMIC R Mux' - value DMIC1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 DMIC1 - item.1 DMIC2 - } - } - control.173 { - iface MIXER - name 'Mono ADC L2 Mux' - value 'Mono DAC MIXL' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXL' - item.1 DMIC - } - } - control.174 { - iface MIXER - name 'Mono ADC L1 Mux' - value ADC - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXL' - item.1 ADC - } - } - control.175 { - iface MIXER - name 'Mono ADC R1 Mux' - value ADC - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXR' - item.1 ADC - } - } - control.176 { - iface MIXER - name 'Mono ADC R2 Mux' - value 'Mono DAC MIXR' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC MIXR' - item.1 DMIC - } - } - control.177 { - iface MIXER - name 'Sto1 ADC MIXL ADC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.178 { - iface MIXER - name 'Sto1 ADC MIXL ADC2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.179 { - iface MIXER - name 'Sto1 ADC MIXR ADC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.180 { - iface MIXER - name 'Sto1 ADC MIXR ADC2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.181 { - iface MIXER - name 'Mono ADC MIXL ADC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.182 { - iface MIXER - name 'Mono ADC MIXL ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.183 { - iface MIXER - name 'Mono ADC MIXR ADC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.184 { - iface MIXER - name 'Mono ADC MIXR ADC2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.185 { - iface MIXER - name 'IF2 ADC Mux' - value IF_ADC2 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 IF_ADC1 - item.1 IF_ADC2 - item.2 VAD_ADC - } - } - control.186 { - iface MIXER - name 'VAD ADC Mux' - value 'Sto1 ADC L' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Sto1 ADC L' - item.1 'Mono ADC L' - item.2 'Mono ADC R' - } - } - control.187 { - iface MIXER - name 'DAC1 MIXL Stereo ADC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.188 { - iface MIXER - name 'DAC1 MIXL DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.189 { - iface MIXER - name 'DAC1 MIXR Stereo ADC Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.190 { - iface MIXER - name 'DAC1 MIXR DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.191 { - iface MIXER - name 'DAC L2 Mux' - value 'IF1 DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'IF1 DAC' - item.1 'IF2 DAC' - item.2 'IF3 DAC' - item.3 'Mono ADC' - item.4 VAD_ADC - } - } - control.192 { - iface MIXER - name 'DAC R2 Mux' - value 'IF1 DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'IF1 DAC' - item.1 'IF2 DAC' - item.2 'IF3 DAC' - item.3 'Mono ADC' - item.4 Haptic - } - } - control.193 { - iface MIXER - name 'DAC1 L Mux' - value 'IF1 DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'IF1 DAC' - item.1 'IF2 DAC' - item.2 'IF3 DAC' - } - } - control.194 { - iface MIXER - name 'DAC1 R Mux' - value 'IF1 DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'IF1 DAC' - item.1 'IF2 DAC' - item.2 'IF3 DAC' - } - } - control.195 { - iface MIXER - name 'Stereo DAC MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.196 { - iface MIXER - name 'Stereo DAC MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.197 { - iface MIXER - name 'Stereo DAC MIXL DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.198 { - iface MIXER - name 'Stereo DAC MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.199 { - iface MIXER - name 'Stereo DAC MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.200 { - iface MIXER - name 'Stereo DAC MIXR DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.201 { - iface MIXER - name 'Mono DAC MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.202 { - iface MIXER - name 'Mono DAC MIXL DAC L2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.203 { - iface MIXER - name 'Mono DAC MIXL DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.204 { - iface MIXER - name 'Mono DAC MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.205 { - iface MIXER - name 'Mono DAC MIXR DAC R2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.206 { - iface MIXER - name 'Mono DAC MIXR DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.207 { - iface MIXER - name 'DAC MIXL Sto DAC Mix L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.208 { - iface MIXER - name 'DAC MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.209 { - iface MIXER - name 'DAC MIXL DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.210 { - iface MIXER - name 'DAC MIXR Sto DAC Mix R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.211 { - iface MIXER - name 'DAC MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.212 { - iface MIXER - name 'DAC MIXR DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.213 { - iface MIXER - name 'SPK MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.214 { - iface MIXER - name 'SPK MIXL DAC L2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.215 { - iface MIXER - name 'SPK MIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.216 { - iface MIXER - name 'SPK MIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.217 { - iface MIXER - name 'SPK MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.218 { - iface MIXER - name 'SPK MIXR DAC R2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.219 { - iface MIXER - name 'SPK MIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.220 { - iface MIXER - name 'SPK MIXR BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.221 { - iface MIXER - name 'OUT MIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.222 { - iface MIXER - name 'OUT MIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.223 { - iface MIXER - name 'OUT MIXL DAC L2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.224 { - iface MIXER - name 'OUT MIXL DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.225 { - iface MIXER - name 'OUT MIXR BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.226 { - iface MIXER - name 'OUT MIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.227 { - iface MIXER - name 'OUT MIXR DAC R2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.228 { - iface MIXER - name 'OUT MIXR DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.229 { - iface MIXER - name 'SPKVOL L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.230 { - iface MIXER - name 'SPKVOL R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.231 { - iface MIXER - name 'HPOVOL MIXL DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.232 { - iface MIXER - name 'HPOVOL MIXL DAC2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.233 { - iface MIXER - name 'HPOVOL MIXL INL Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.234 { - iface MIXER - name 'HPOVOL MIXL BST1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.235 { - iface MIXER - name 'HPOVOL MIXR DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.236 { - iface MIXER - name 'HPOVOL MIXR DAC2 Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.237 { - iface MIXER - name 'HPOVOL MIXR INR Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.238 { - iface MIXER - name 'HPOVOL MIXR BST2 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.239 { - iface MIXER - name 'HPOVOL L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.240 { - iface MIXER - name 'HPOVOL R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.241 { - iface MIXER - name 'SPOL MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.242 { - iface MIXER - name 'SPOL MIX DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.243 { - iface MIXER - name 'SPOL MIX SPKVOL R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.244 { - iface MIXER - name 'SPOL MIX SPKVOL L Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.245 { - iface MIXER - name 'SPOR MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.246 { - iface MIXER - name 'SPOR MIX SPKVOL R Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.247 { - iface MIXER - name 'HPO MIX DAC1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.248 { - iface MIXER - name 'HPO MIX HPVOL Switch' - value true - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.249 { - iface MIXER - name 'LOUT MIX DAC L1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.250 { - iface MIXER - name 'LOUT MIX DAC R1 Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.251 { - iface MIXER - name 'LOUT MIX OUTMIX L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.252 { - iface MIXER - name 'LOUT MIX OUTMIX R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.253 { - iface MIXER - name 'PDM1 L Mux' - value 'Mono DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC' - item.1 'Stereo DAC' - } - } - control.254 { - iface MIXER - name 'PDM1 R Mux' - value 'Mono DAC' - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 'Mono DAC' - item.1 'Stereo DAC' - } - } - control.255 { - iface MIXER - name 'PDM1 L Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.256 { - iface MIXER - name 'PDM1 R Switch' - value false - comment { - access 'read write' - type BOOLEAN - count 1 - } - } - control.257 { - iface MIXER - name 'RT5645 IF1 DAC1 L Mux' - value Slot0 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Slot0 - item.1 Slot1 - item.2 Slot2 - item.3 Slot3 - } - } - control.258 { - iface MIXER - name 'RT5645 IF1 DAC1 R Mux' - value Slot1 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Slot0 - item.1 Slot1 - item.2 Slot2 - item.3 Slot3 - } - } - control.259 { - iface MIXER - name 'RT5645 IF1 DAC2 L Mux' - value Slot2 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Slot0 - item.1 Slot1 - item.2 Slot2 - item.3 Slot3 - } - } - control.260 { - iface MIXER - name 'RT5645 IF1 DAC2 R Mux' - value Slot3 - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 Slot0 - item.1 Slot1 - item.2 Slot2 - item.3 Slot3 - } - } - control.261 { - iface MIXER - name 'RT5645 IF1 ADC Mux' - value IF_ADC1/IF_ADC2/VAD_ADC - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 IF_ADC1/IF_ADC2/VAD_ADC - item.1 IF_ADC2/IF_ADC1/VAD_ADC - item.2 VAD_ADC/IF_ADC1/IF_ADC2 - item.3 VAD_ADC/IF_ADC2/IF_ADC1 - } - } - control.262 { - iface MIXER - name 'RT5645 IF1 ADC1 Swap Mux' - value L/R - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 L/R - item.1 R/L - item.2 L/L - item.3 R/R - } - } - control.263 { - iface MIXER - name 'RT5645 IF1 ADC2 Swap Mux' - value L/R - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 L/R - item.1 R/L - item.2 L/L - item.3 R/R - } - } - control.264 { - iface MIXER - name 'RT5645 IF1 ADC3 Swap Mux' - value L/R - comment { - access 'read write' - type ENUMERATED - count 1 - item.0 L/R - item.1 R/L - item.2 L/L - item.3 R/R - } - } -} diff --git a/bootctrl/Android.bp b/bootctrl/Android.bp index f5374d8..a920670 100644 --- a/bootctrl/Android.bp +++ b/bootctrl/Android.bp @@ -24,12 +24,13 @@ cc_library_shared { relative_install_path: "hw", vendor: true, recovery_available: true, - srcs: ["BootControl.cpp", "grub_boot_control.cpp"], + srcs: ["BootControl.cpp", "x86_boot_control.cpp"], cppflags: ["-Wno-unused-variable"], cflags: ["-Wno-unused-variable"], header_libs: ["generated_kernel_headers"], shared_libs: [ + "libbase", "liblog", "libhidlbase", "libhardware", diff --git a/bootctrl/BootControl.cpp b/bootctrl/BootControl.cpp index 118dabc..92a4152 100644 --- a/bootctrl/BootControl.cpp +++ b/bootctrl/BootControl.cpp @@ -22,7 +22,7 @@ #include #include "BootControl.h" -#include "grub_boot_control_private.h" +#include "x86_boot_control_private.h" #include "boot_control_definition.h" namespace android { @@ -64,7 +64,7 @@ Return BootControl::setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb struct CommandResult cr; const char* new_suffix = impl_.GetSuffix(slot); - if (impl_.SetActiveBootSlot(slot) && implext_.SetGrubBootSlot(new_suffix)) { + if (impl_.SetActiveBootSlot(slot) && implext_.SetBootSlot(new_suffix)) { cr.success = true; cr.errMsg = "Success"; } else { diff --git a/bootctrl/BootControl.h b/bootctrl/BootControl.h index 9540048..932c0b5 100644 --- a/bootctrl/BootControl.h +++ b/bootctrl/BootControl.h @@ -20,7 +20,7 @@ #include #include #include -#include "grub_boot_control_private.h" +#include "x86_boot_control_private.h" namespace android { namespace hardware { diff --git a/bootctrl/grub_boot_control.cpp b/bootctrl/x86_boot_control.cpp similarity index 83% rename from bootctrl/grub_boot_control.cpp rename to bootctrl/x86_boot_control.cpp index 1e0701b..35ce710 100644 --- a/bootctrl/grub_boot_control.cpp +++ b/bootctrl/x86_boot_control.cpp @@ -5,7 +5,7 @@ #include #include -#include "grub_boot_control_private.h" +#include "x86_boot_control_private.h" namespace android { namespace bootable { @@ -21,9 +21,14 @@ static void findAndReplace(std::string& content, const std::string& findStr, con } } -bool BootControlExt::SetGrubBootSlot(const char* new_suffix) { - std::string filename = "/grub/android.cfg"; - std::string texts[] = { "kernel", "initrd", "androidboot.slot_suffix=" }; +bool BootControlExt::SetBootSlot(const char* new_suffix) { + std::string filename = android::base::GetProperty("ro.boot.bootctrl_bootcfg", ""); + std::string texts[] = { "kernel", "initrd", "androidboot.slot_suffix=", "SLOT=" }; + + // If the property is not set, use default filename + if (filename.empty()) { + filename = "/boot/grub/android.cfg"; + } std::string old_suffix = android::base::GetProperty("ro.boot.slot_suffix", ""); if (old_suffix.empty()) { diff --git a/bootctrl/grub_boot_control_private.h b/bootctrl/x86_boot_control_private.h similarity index 65% rename from bootctrl/grub_boot_control_private.h rename to bootctrl/x86_boot_control_private.h index 4ce9ae3..74331ff 100644 --- a/bootctrl/grub_boot_control_private.h +++ b/bootctrl/x86_boot_control_private.h @@ -4,7 +4,7 @@ namespace android { namespace bootable { class BootControlExt { public: - bool SetGrubBootSlot(const char* new_suffix); + bool SetBootSlot(const char* new_suffix); }; } } diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index ed1717a..5899964 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -8,7 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # -TARGET_CLANG_PATH := prebuilts/clang/host/linux-x86/clang-r498229b/bin +TARGET_CLANG_PATH := prebuilts/clang/host/linux-x86/clang-r536225/bin ifneq ($(TARGET_NO_KERNEL),true) @@ -17,7 +17,7 @@ INSTALLED_KERNELIMAGE_TARGET := $(PRODUCT_OUT)/kernel.img ifeq ($(TARGET_PREBUILT_KERNEL),) ifneq ($(filter x86%,$(TARGET_ARCH)),) -KERNEL_DIR ?= kernel +KERNEL_DIR ?= kernel/x86/common SOF_FIRMWARE_DIR := vendor/intel/proprietary/sof-bin COPY_FIRMWARE_SCRIPT := device/generic/firmware/copy-firmware.sh COPY_FIRMWARE_SILEAD_SCRIPT := vendor/silead/proprietary/firmware/firmware/linux/copy-firmware.sh @@ -89,7 +89,9 @@ $(BUILT_KERNEL_TARGET): $(KERNEL_DOTCONFIG_FILE) $(M4) $(LEX) $(BISON) $(if $(TARGET_HAS_SILEAD_FIRMWARE), $(COPY_FIRMWARE_SILEAD_SCRIPT) --zstd -v $(FIRMWARE_DEST)) $(if $(TARGET_HAS_SOF_FIRMWARE), FW_DEST=$(FIRMWARE_DEST)/intel FW_LOCATION=$(SOF_FIRMWARE_DIR) $(COPY_FIRMWARE_SOF_SCRIPT) $(SOF_FIRMWARE_VERSION)) $(if $(FIRMWARE_ENABLED),$(mk_kernel) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) firmware_install) - $(hide) cp $@ $(INSTALLED_KERNELIMAGE_TARGET) + +$(INSTALLED_KERNELIMAGE_TARGET): $(BUILT_KERNEL_TARGET) + $(hide) cp $(BUILT_KERNEL_TARGET) $(INSTALLED_KERNELIMAGE_TARGET) ifneq ($(MOD_ENABLED),) KERNEL_MODULES_DEP := $(firstword $(wildcard $(TARGET_OUT)/lib/modules/*/modules.dep)) diff --git a/device.mk b/device.mk index d9022f6..bf9668a 100644 --- a/device.mk +++ b/device.mk @@ -16,6 +16,12 @@ PRODUCT_DIR := $(dir $(lastword $(filter-out device/common/%,$(filter device/%,$(ALL_PRODUCTS))))) +# Don't ship with dynamic partition +PRODUCT_USE_DYNAMIC_PARTITIONS := false + +# No Compressed APEXes +OVERRIDE_PRODUCT_COMPRESSED_APEX := false + # A/B PRODUCT_BUILD_GENERIC_OTA_PACKAGE := true AB_OTA_POSTINSTALL_CONFIG += \ @@ -31,11 +37,6 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES_DEBUG += \ bootctl -PRODUCT_PACKAGES += \ - android.hardware.boot@1.2-x86impl \ - android.hardware.boot@1.2-x86impl.recovery \ - android.hardware.boot@1.2-service - # Update engine PRODUCT_PACKAGES += \ update_engine \ @@ -59,20 +60,15 @@ PRODUCT_PROPERTY_OVERRIDES := \ audio.safemedia.bypass=true \ persist.device_config.mglru_native.lru_gen_config=all \ persist.sys.zram_enabled=1 \ - ro.setupwizard.mode=DISABLED - -# LMKd -ifneq ($(BOARD_IS_GO_BUILD),true) -PRODUCT_PRODUCT_PROPERTIES += \ - ro.lmk.critical_upgrade=true \ - ro.lmk.use_minfree_levels=true \ - ro.lmk.use_psi=true \ - ro.lmk.use_new_strategy=false -endif + ro.setupwizard.mode=DISABLED \ + external_storage.casefold.enabled=1 \ + external_storage.projid.enabled=1 PRODUCT_COPY_FILES := \ $(if $(wildcard $(PRODUCT_DIR)init.rc),$(PRODUCT_DIR)init.rc:root/init.rc) \ $(if $(wildcard $(PRODUCT_DIR)init.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.sh:system/etc/init.sh \ + $(if $(wildcard $(PRODUCT_DIR)init.fstab.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.fstab.sh:$(TARGET_COPY_OUT_VENDOR)/etc/init.fstab.sh \ + $(if $(wildcard $(PRODUCT_DIR)init.zram.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.zram.sh:$(TARGET_COPY_OUT_VENDOR)/etc/init.zram.sh \ $(if $(wildcard $(PRODUCT_DIR)modules.blocklist),$(PRODUCT_DIR),$(LOCAL_PATH)/)modules.blocklist:system/etc/modules.blocklist \ $(if $(wildcard $(PRODUCT_DIR)modules.options),$(PRODUCT_DIR),$(LOCAL_PATH)/)modules.options:system/etc/modules.options \ $(if $(wildcard $(PRODUCT_DIR)fstab.$(TARGET_PRODUCT)),$(PRODUCT_DIR)fstab.$(TARGET_PRODUCT),$(LOCAL_PATH)/fstab.x86):root/fstab.$(TARGET_PRODUCT) \ @@ -87,16 +83,16 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/ppp/ip-up:$(TARGET_COPY_OUT_SYSTEM)/etc/ppp/ip-up \ $(LOCAL_PATH)/ppp/ip-down:$(TARGET_COPY_OUT_SYSTEM)/etc/ppp/ip-down \ $(LOCAL_PATH)/ppp/peers/gprs:$(TARGET_COPY_OUT_SYSTEM)/etc/ppp/peers/gprs \ - $(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs.xml \ - $(LOCAL_PATH)/media_profiles.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_profiles.xml \ + $(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ + $(LOCAL_PATH)/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \ $(LOCAL_PATH)/pciids/pci.ids:$(TARGET_COPY_OUT_SYSTEM)/vendor/etc/pci.ids \ $(LOCAL_PATH)/usbids/usb.ids:$(TARGET_COPY_OUT_SYSTEM)/vendor/etc/usb.ids \ $(LOCAL_PATH)/fstab.internal.x86:$(TARGET_COPY_OUT_SYSTEM)/vendor/etc/fstab.internal.x86 \ - frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs_google_audio.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_c2.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs_google_c2.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_c2_audio.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs_google_c2_audio.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_c2_video.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs_google_c2_video.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/media_codecs_google_video.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_c2_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_c2_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_video.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ external/mesa/src/util/00-mesa-defaults.conf:$(TARGET_COPY_OUT_VENDOR)/etc/drirc # Copy Vendor Files @@ -148,12 +144,25 @@ PRODUCT_COPY_FILES += \ # Copy Misc Config Files PRODUCT_COPY_FILES += \ - $(foreach f,$(wildcard $(LOCAL_PATH)/alsa/*),$(f):$(subst $(LOCAL_PATH),system/etc,$(f))) \ $(foreach f,$(wildcard $(LOCAL_PATH)/idc/*.idc $(LOCAL_PATH)/keylayout/*.kl),$(f):$(subst $(LOCAL_PATH),system/usr,$(f))) +# Go init +ifeq ($(BOARD_IS_GO_BUILD),true) +PRODUCT_COPY_FILES += \ + $(if $(wildcard $(PRODUCT_DIR)init.low_performance.rc),$(PRODUCT_DIR)init.low_performance.rc,$(LOCAL_PATH)/init.low_performance.rc):$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.low_performance.rc +endif + +# Recovery +PRODUCT_COPY_FILES += \ + $(if $(wildcard $(PRODUCT_DIR)init.recovery.$(TARGET_PRODUCT).rc),$(PRODUCT_DIR)init.recovery.$(TARGET_PRODUCT).rc,$(LOCAL_PATH)/init.recovery.x86.rc):$(TARGET_COPY_OUT_RECOVERY)/root/init.recovery.$(TARGET_PRODUCT).rc \ + $(if $(wildcard $(PRODUCT_DIR)init.recovery.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.recovery.sh:$(TARGET_COPY_OUT_RECOVERY)/root/system/etc/init.recovery.sh \ + $(if $(wildcard $(PRODUCT_DIR)init.fstab.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.fstab.sh:$(TARGET_COPY_OUT_RECOVERY)/root/system/etc/init.fstab.sh \ + PRODUCT_TAGS += dalvik.gc.type-precise +PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE := true +TARGET_DISABLE_EPPE := true PRODUCT_CHARACTERISTICS := tablet PRODUCT_AAPT_CONFIG := normal large xlarge mdpi hdpi @@ -165,17 +174,14 @@ ifeq ($(BOARD_IS_GO_BUILD),true) DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay-go endif -# Enforce privapp-permissions whitelist +# Force sdcardfs to use esdfs instead PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ ro.sys.sdcardfs=false \ persist.sys.sdcardfs=force_off # Copy any Permissions files, overriding anything if needed $(foreach f,$(wildcard $(LOCAL_PATH)/permissions/*.xml),\ - $(eval PRODUCT_COPY_FILES += $(f):$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/$(notdir $f))) - -$(foreach f,$(wildcard $(LOCAL_PATH)/permissions_product/*.xml),\ - $(eval PRODUCT_COPY_FILES += $(f):$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/$(notdir $f))) + $(eval PRODUCT_COPY_FILES += $(f):$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/$(notdir $f))) # Get emulated storage settings #$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) @@ -201,9 +207,6 @@ $(call inherit-product-if-exists,hardware/libsensors/sensors.mk) # Get GloDroid components $(call inherit-product-if-exists,$(LOCAL_PATH)/glodroid/device_glodroid.mk) -# Get tablet dalvik parameters -$(call inherit-product,frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk) - ifeq ($(USE_LIBNDK_TRANSLATION_NB),true) $(call inherit-product-if-exists, vendor/google/emu-x86/target/libndk_translation.mk) $(call inherit-product-if-exists, vendor/google/emu-x86/target/native_bridge_arm_on_x86.mk) diff --git a/dhcp_recovery/Android.bp b/dhcp_recovery/Android.bp new file mode 100644 index 0000000..377c915 --- /dev/null +++ b/dhcp_recovery/Android.bp @@ -0,0 +1,8 @@ +license { + name: "x86_dhcpclient_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + "SPDX-license-identifier-BSD", + ], +} diff --git a/dhcp_recovery/client/Android.bp b/dhcp_recovery/client/Android.bp new file mode 100644 index 0000000..72cb4bf --- /dev/null +++ b/dhcp_recovery/client/Android.bp @@ -0,0 +1,43 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_generic_goldfish_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["x86_dhcpclient_license"], +} + +cc_binary { + name: "x86_dhcpclient", + stem: "dhcpclient", + srcs: [ + "dhcpclient.cpp", + "interface.cpp", + "main.cpp", + "router.cpp", + "timer.cpp", + ], + shared_libs: [ + "libcutils", + "liblog", + ], + static_libs: [ + "libx86dhcpclient", + ], + recovery_available: true, + vendor_available: true, +} diff --git a/dhcp_recovery/client/dhcpclient.cpp b/dhcp_recovery/client/dhcpclient.cpp new file mode 100644 index 0000000..7404fad --- /dev/null +++ b/dhcp_recovery/client/dhcpclient.cpp @@ -0,0 +1,546 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "dhcpclient.h" +#include "dhcp.h" +#include "interface.h" +#include "log.h" + +#include +#include +#include +#include +#include + +#include + +#include + +// The initial retry timeout for DHCP is 4000 milliseconds +static const uint32_t kInitialTimeout = 4000; +// The maximum retry timeout for DHCP is 64000 milliseconds +static const uint32_t kMaxTimeout = 64000; +// A specific value that indicates that no timeout should happen and that +// the state machine should immediately transition to the next state +static const uint32_t kNoTimeout = 0; + +// Enable debug messages +static const bool kDebug = false; + +// The number of milliseconds that the timeout should vary (up or down) from the +// base timeout. DHCP requires a -1 to +1 second variation in timeouts. +static const int kTimeoutSpan = 1000; + +static std::string addrToStr(in_addr_t address) { + struct in_addr addr = { address }; + char buffer[64]; + return inet_ntop(AF_INET, &addr, buffer, sizeof(buffer)); +} + +DhcpClient::DhcpClient(uint32_t options) + : mOptions(options), + mRandomEngine(std::random_device()()), + mRandomDistribution(-kTimeoutSpan, kTimeoutSpan), + mState(State::Init), + mNextTimeout(kInitialTimeout), + mFuzzNextTimeout(true) { +} + +Result DhcpClient::init(const char* interfaceName) { + Result res = mInterface.init(interfaceName); + if (!res) { + return res; + } + + res = mRouter.init(); + if (!res) { + return res; + } + + res = mSocket.open(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); + if (!res) { + return res; + } + + res = mSocket.bindRaw(mInterface.getIndex()); + if (!res) { + return res; + } + return Result::success(); +} + +Result DhcpClient::run() { + // Block all signals while we're running. This way we don't have to deal + // with things like EINTR. waitAndReceive then uses ppoll to set the + // original mask while polling. This way polling can be interrupted but + // socket writing, reading and ioctl remain interrupt free. If a signal + // arrives while we're blocking it it will be placed in the signal queue + // and handled once ppoll sets the original mask. This way no signals are + // lost. + sigset_t blockMask, originalMask; + int status = ::sigfillset(&blockMask); + if (status != 0) { + return Result::error("Unable to fill signal set: %s", strerror(errno)); + } + status = ::sigprocmask(SIG_SETMASK, &blockMask, &originalMask); + if (status != 0) { + return Result::error("Unable to set signal mask: %s", strerror(errno)); + } + + for (;;) { + // Before waiting, polling or receiving we check the current state and + // see what we should do next. This may result in polling but could + // also lead to instant state changes without any polling. The new state + // will then be evaluated instead, most likely leading to polling. + switch (mState) { + case State::Init: + // The starting state. This is the state the client is in when + // it first starts. It's also the state that the client returns + // to when things go wrong in other states. + setNextState(State::Selecting); + break; + case State::Selecting: + // In the selecting state the client attempts to find DHCP + // servers on the network. The client remains in this state + // until a suitable server responds. + sendDhcpDiscover(); + increaseTimeout(); + break; + case State::Requesting: + // In the requesting state the client has found a suitable + // server. The next step is to send a request directly to that + // server. + if (mNextTimeout >= kMaxTimeout) { + // We've tried to request a bunch of times, start over + setNextState(State::Init); + } else { + sendDhcpRequest(mServerAddress); + increaseTimeout(); + } + break; + case State::Bound: + // The client enters the bound state when the server has + // accepted and acknowledged a request and given us a lease. At + // this point the client will wait until the lease is close to + // expiring and then it will try to renew the lease. + if (mT1.expired()) { + // Lease expired, renew lease + setNextState(State::Renewing); + } else { + // Spurious wake-up, continue waiting. Do not fuzz the + // timeout with a random offset. Doing so can cause wakeups + // before the timer has expired causing unnecessary + // processing. Even worse it can cause the timer to expire + // after the lease has ended. + mNextTimeout = mT1.remainingMillis(); + mFuzzNextTimeout = false; + } + break; + case State::Renewing: + // In the renewing state the client is sending a request for the + // same address it had was previously bound to. If the second + // timer expires when in this state the client will attempt to + // do a full rebind. + if (mT2.expired()) { + // Timeout while renewing, move to rebinding + setNextState(State::Rebinding); + } else { + sendDhcpRequest(mServerAddress); + increaseTimeout(); + } + break; + case State::Rebinding: + // The client was unable to renew the lease and moved to the + // rebinding state. In this state the client sends a request for + // the same address it had before to the broadcast address. This + // means that any DHCP server on the network is free to respond. + // After attempting this a few times the client will give up and + // move to the Init state to try to find a new DHCP server. + if (mNextTimeout >= kMaxTimeout) { + // We've tried to rebind a bunch of times, start over + setNextState(State::Init); + } else { + // Broadcast a request + sendDhcpRequest(INADDR_BROADCAST); + increaseTimeout(); + } + break; + default: + break; + } + // The proper action for the current state has been taken, perform any + // polling and/or waiting needed. + waitAndReceive(originalMask); + } + + return Result::error("Client terminated unexpectedly"); +} + +const char* DhcpClient::stateToStr(State state) { + switch (state) { + case State::Init: + return "Init"; + case State::Selecting: + return "Selecting"; + case State::Requesting: + return "Requesting"; + case State::Bound: + return "Bound"; + case State::Renewing: + return "Renewing"; + case State::Rebinding: + return "Rebinding"; + } + return ""; +} + +void DhcpClient::waitAndReceive(const sigset_t& pollSignalMask) { + if (mNextTimeout == kNoTimeout) { + // If there is no timeout the state machine has indicated that it wants + // an immediate transition to another state. Do nothing. + return; + } + + struct pollfd fds; + fds.fd = mSocket.get(); + fds.events = POLLIN; + + uint32_t timeout = calculateTimeoutMillis(); + for (;;) { + uint64_t startedAt = now(); + + struct timespec ts; + ts.tv_sec = timeout / 1000; + ts.tv_nsec = (timeout - ts.tv_sec * 1000) * 1000000; + + // Poll for any incoming traffic with the calculated timeout. While + // polling the original signal mask is set so that the polling can be + // interrupted. + int res = ::ppoll(&fds, 1, &ts, &pollSignalMask); + if (res == 0) { + // Timeout, return to let the caller evaluate + return; + } else if (res > 0) { + // Something to read + Message msg; + if (receiveDhcpMessage(&msg)) { + // We received a DHCP message, check if it's of interest + uint8_t msgType = msg.type(); + switch (mState) { + case State::Selecting: + if (msgType == DHCPOFFER) { + // Received an offer, move to the Requesting state + // to request it. + mServerAddress = msg.serverId(); + mRequestAddress = msg.dhcpData.yiaddr; + setNextState(State::Requesting); + return; + } + break; + case State::Requesting: + case State::Renewing: + case State::Rebinding: + // All of these states have sent a DHCP request and are + // now waiting for an ACK so the behavior is the same. + if (msgType == DHCPACK) { + // Request approved + if (configureDhcp(msg)) { + // Successfully configured DHCP, move to Bound + setNextState(State::Bound); + return; + } + // Unable to configure DHCP, keep sending requests. + // This may not fix the issue but eventually it will + // allow for a full timeout which will lead to a + // move to the Init state. This might still not fix + // the issue but at least the client keeps trying. + } else if (msgType == DHCPNAK) { + // Request denied, halt network and start over + haltNetwork(); + setNextState(State::Init); + return; + } + break; + default: + // For the other states the client is not expecting any + // network messages so we ignore those messages. + break; + } + } + } else { + // An error occurred in polling, don't do anything here. The client + // should keep going anyway to try to acquire a lease in the future + // if things start working again. + } + // If we reach this point we received something that's not a DHCP, + // message, we timed out, or an error occurred. Go again with whatever + // time remains. + uint64_t currentTime = now(); + uint64_t end = startedAt + timeout; + if (currentTime >= end) { + // We're done anyway, return and let caller evaluate + return; + } + // Wait whatever the remaining time is + timeout = end - currentTime; + } +} + +bool DhcpClient::configureDhcp(const Message& msg) { + size_t optsSize = msg.optionsSize(); + if (optsSize < 4) { + // Message is too small + if (kDebug) ALOGD("Opts size too small %d", static_cast(optsSize)); + return false; + } + + const uint8_t* options = msg.dhcpData.options; + + memset(&mDhcpInfo, 0, sizeof(mDhcpInfo)); + + // Inspect all options in the message to try to find the ones we want + for (size_t i = 4; i + 1 < optsSize; ) { + uint8_t optCode = options[i]; + uint8_t optLength = options[i + 1]; + if (optCode == OPT_END) { + break; + } + + if (options + optLength + i >= msg.end()) { + // Invalid option length, drop it + if (kDebug) ALOGD("Invalid opt length %d for opt %d", + static_cast(optLength), + static_cast(optCode)); + return false; + } + const uint8_t* opt = options + i + 2; + switch (optCode) { + case OPT_LEASE_TIME: + if (optLength == 4) { + mDhcpInfo.leaseTime = + ntohl(*reinterpret_cast(opt)); + } + break; + case OPT_T1: + if (optLength == 4) { + mDhcpInfo.t1 = + ntohl(*reinterpret_cast(opt)); + } + break; + case OPT_T2: + if (optLength == 4) { + mDhcpInfo.t2 = + ntohl(*reinterpret_cast(opt)); + } + break; + case OPT_SUBNET_MASK: + if (optLength == 4) { + mDhcpInfo.subnetMask = + *reinterpret_cast(opt); + } + break; + case OPT_GATEWAY: + if (optLength >= 4) { + mDhcpInfo.gateway = + *reinterpret_cast(opt); + } + break; + case OPT_MTU: + if (optLength == 2) { + mDhcpInfo.mtu = + ntohs(*reinterpret_cast(opt)); + } + break; + case OPT_DNS: + if (optLength >= 4) { + mDhcpInfo.dns[0] = + *reinterpret_cast(opt); + } + if (optLength >= 8) { + mDhcpInfo.dns[1] = + *reinterpret_cast(opt + 4); + } + if (optLength >= 12) { + mDhcpInfo.dns[2] = + *reinterpret_cast(opt + 8); + } + if (optLength >= 16) { + mDhcpInfo.dns[3] = + *reinterpret_cast(opt + 12); + } + break; + case OPT_SERVER_ID: + if (optLength == 4) { + mDhcpInfo.serverId = + *reinterpret_cast(opt); + } + break; + default: + break; + } + i += 2 + optLength; + } + mDhcpInfo.offeredAddress = msg.dhcpData.yiaddr; + + if (mDhcpInfo.leaseTime == 0) { + // We didn't get a lease time, ignore this offer + return false; + } + // If there is no T1 or T2 timer given then we create an estimate as + // suggested for servers in RFC 2131. + uint32_t t1 = mDhcpInfo.t1, t2 = mDhcpInfo.t2; + mT1.expireSeconds(t1 > 0 ? t1 : (mDhcpInfo.leaseTime / 2)); + mT2.expireSeconds(t2 > 0 ? t2 : ((mDhcpInfo.leaseTime * 7) / 8)); + + Result res = mInterface.bringUp(); + if (!res) { + ALOGE("Could not configure DHCP: %s", res.c_str()); + return false; + } + + if (mDhcpInfo.mtu != 0) { + res = mInterface.setMtu(mDhcpInfo.mtu); + if (!res) { + // Consider this non-fatal, the system will not perform at its best + // but should still work. + ALOGE("Could not configure DHCP: %s", res.c_str()); + } + } + + char propName[64]; + snprintf(propName, sizeof(propName), "vendor.net.%s.gw", + mInterface.getName().c_str()); + if (property_set(propName, addrToStr(mDhcpInfo.gateway).c_str()) != 0) { + ALOGE("Failed to set %s: %s", propName, strerror(errno)); + } + + int numDnsEntries = sizeof(mDhcpInfo.dns) / sizeof(mDhcpInfo.dns[0]); + for (int i = 0; i < numDnsEntries; ++i) { + snprintf(propName, sizeof(propName), "vendor.net.%s.dns%d", + mInterface.getName().c_str(), i + 1); + if (mDhcpInfo.dns[i] != 0) { + if (property_set(propName, + addrToStr(mDhcpInfo.dns[i]).c_str()) != 0) { + ALOGE("Failed to set %s: %s", propName, strerror(errno)); + } + } else { + // Clear out any previous value here in case it was set + if (property_set(propName, "") != 0) { + ALOGE("Failed to clear %s: %s", propName, strerror(errno)); + } + } + } + + res = mInterface.setAddress(mDhcpInfo.offeredAddress, + mDhcpInfo.subnetMask); + if (!res) { + ALOGE("Could not configure DHCP: %s", res.c_str()); + return false; + } + + if ((mOptions & static_cast(ClientOption::NoGateway)) == 0) { + res = mRouter.setDefaultGateway(mDhcpInfo.gateway, + mInterface.getIndex()); + if (!res) { + ALOGE("Could not configure DHCP: %s", res.c_str()); + return false; + } + } + return true; +} + +void DhcpClient::haltNetwork() { + Result res = mInterface.setAddress(0, 0); + if (!res) { + ALOGE("Could not halt network: %s", res.c_str()); + } + res = mInterface.bringDown(); + if (!res) { + ALOGE("Could not halt network: %s", res.c_str()); + } +} + +bool DhcpClient::receiveDhcpMessage(Message* msg) { + bool isValid = false; + Result res = mSocket.receiveRawUdp(PORT_BOOTP_CLIENT, msg, &isValid); + if (!res) { + if (kDebug) ALOGD("Discarding message: %s", res.c_str()); + return false; + } + + return isValid && + msg->isValidDhcpMessage(OP_BOOTREPLY, mLastMsg.dhcpData.xid); +} + +uint32_t DhcpClient::calculateTimeoutMillis() { + if (!mFuzzNextTimeout) { + return mNextTimeout; + } + int adjustment = mRandomDistribution(mRandomEngine); + if (adjustment < 0 && static_cast(-adjustment) > mNextTimeout) { + // Underflow, return a timeout of zero milliseconds + return 0; + } + return mNextTimeout + adjustment; +} + +void DhcpClient::increaseTimeout() { + if (mNextTimeout == kNoTimeout) { + mNextTimeout = kInitialTimeout; + } else { + if (mNextTimeout < kMaxTimeout) { + mNextTimeout *= 2; + } + if (mNextTimeout > kMaxTimeout) { + mNextTimeout = kMaxTimeout; + } + } +} + +void DhcpClient::setNextState(State state) { + if (kDebug) ALOGD("Moving from state %s to %s", + stateToStr(mState), stateToStr(state)); + mState = state; + mNextTimeout = kNoTimeout; + mFuzzNextTimeout = true; +} + +void DhcpClient::sendDhcpRequest(in_addr_t destination) { + if (kDebug) ALOGD("Sending DHCPREQUEST"); + mLastMsg = Message::request(mInterface.getMacAddress(), + mRequestAddress, + destination); + sendMessage(mLastMsg); +} + +void DhcpClient::sendDhcpDiscover() { + if (kDebug) ALOGD("Sending DHCPDISCOVER"); + mLastMsg = Message::discover(mInterface.getMacAddress()); + sendMessage(mLastMsg); +} + +void DhcpClient::sendMessage(const Message& message) { + Result res = mSocket.sendRawUdp(INADDR_ANY, + PORT_BOOTP_CLIENT, + INADDR_BROADCAST, + PORT_BOOTP_SERVER, + mInterface.getIndex(), + message); + if (!res) { + ALOGE("Unable to send message: %s", res.c_str()); + } +} + diff --git a/dhcp_recovery/client/dhcpclient.h b/dhcp_recovery/client/dhcpclient.h new file mode 100644 index 0000000..128d416 --- /dev/null +++ b/dhcp_recovery/client/dhcpclient.h @@ -0,0 +1,109 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "interface.h" +#include "message.h" +#include "result.h" +#include "router.h" +#include "socket.h" +#include "timer.h" + +#include +#include + +#include + +// Options to configure the behavior of the DHCP client. +enum class ClientOption : uint32_t { + NoGateway = (1 << 0), // Do not configure the system's default gateway +}; + +class DhcpClient { +public: + // Create a DHCP client with the given |options|. These options are values + // from the ClientOption enum. + explicit DhcpClient(uint32_t options); + + // Initialize the DHCP client to listen on |interfaceName|. + Result init(const char* interfaceName); + Result run(); +private: + enum class State { + Init, + Selecting, + Requesting, + Bound, + Renewing, + Rebinding + }; + const char* stateToStr(State state); + + // Wait for any pending timeouts + void waitAndReceive(const sigset_t& pollSignalMask); + // Create a varying timeout (+- 1 second) based on the next timeout. + uint32_t calculateTimeoutMillis(); + // Increase the next timeout in a manner that's compliant with the DHCP RFC. + void increaseTimeout(); + // Move to |state|, the next poll timeout will be zero and the new + // state will be immediately evaluated. + void setNextState(State state); + // Configure network interface based on the DHCP configuration in |msg|. + bool configureDhcp(const Message& msg); + // Halt network operations on the network interface for when configuration + // is not possible and the protocol demands it. + void haltNetwork(); + // Receive a message on the socket and populate |msg| with the received + // data. If the message is a valid DHCP message the method returns true. If + // it's not valid false is returned. + bool receiveDhcpMessage(Message* msg); + + void sendDhcpDiscover(); + void sendDhcpRequest(in_addr_t destination); + void sendMessage(const Message& message); + Result send(in_addr_t source, in_addr_t destination, + uint16_t sourcePort, uint16_t destinationPort, + const uint8_t* data, size_t size); + + uint32_t mOptions; + std::mt19937 mRandomEngine; // Mersenne Twister RNG + std::uniform_int_distribution mRandomDistribution; + + struct DhcpInfo { + uint32_t t1; + uint32_t t2; + uint32_t leaseTime; + uint16_t mtu; + in_addr_t dns[4]; + in_addr_t gateway; + in_addr_t subnetMask; + in_addr_t serverId; + in_addr_t offeredAddress; + } mDhcpInfo; + + Router mRouter; + Interface mInterface; + Message mLastMsg; + Timer mT1, mT2; + Socket mSocket; + State mState; + uint32_t mNextTimeout; + bool mFuzzNextTimeout; + + in_addr_t mRequestAddress; // Address we'd like to use in requests + in_addr_t mServerAddress; // Server to send request to +}; + diff --git a/dhcp_recovery/client/interface.cpp b/dhcp_recovery/client/interface.cpp new file mode 100644 index 0000000..a13af08 --- /dev/null +++ b/dhcp_recovery/client/interface.cpp @@ -0,0 +1,230 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "interface.h" + +#include "netlink.h" + +#include +#include +#include +#include +#include +#include +#include + +in_addr_t broadcastFromNetmask(in_addr_t address, in_addr_t netmask) { + // The broadcast address is the address with the bits excluded in the + // netmask set to 1. For example if address = 10.0.2.15 and netmask is + // 255.255.255.0 then the broadcast is 10.0.2.255. If instead netmask was + // 255.0.0.0.0 then the broadcast would be 10.255.255.255 + // + // Simply set all the lower bits to 1 and that should do it. + return address | (~netmask); +} + +Interface::Interface() : mSocketFd(-1) { +} + +Interface::~Interface() { + if (mSocketFd != -1) { + close(mSocketFd); + mSocketFd = -1; + } +} + +Result Interface::init(const char* interfaceName) { + mInterfaceName = interfaceName; + + if (mSocketFd != -1) { + return Result::error("Interface initialized more than once"); + } + + mSocketFd = ::socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); + if (mSocketFd == -1) { + return Result::error("Failed to create interface socket for '%s': %s", + interfaceName, strerror(errno)); + } + + Result res = populateIndex(); + if (!res) { + return res; + } + + res = populateMacAddress(); + if (!res) { + return res; + } + + res = bringUp(); + if (!res) { + return res; + } + + res = setAddress(0, 0); + if (!res) { + return res; + } + + return Result::success(); +} + +Result Interface::bringUp() { + return setInterfaceUp(true); +} + +Result Interface::bringDown() { + return setInterfaceUp(false); +} + +Result Interface::setMtu(uint16_t mtu) { + struct ifreq request = createRequest(); + + strncpy(request.ifr_name, mInterfaceName.c_str(), sizeof(request.ifr_name)); + request.ifr_mtu = mtu; + int status = ::ioctl(mSocketFd, SIOCSIFMTU, &request); + if (status != 0) { + return Result::error("Failed to set interface MTU %u for '%s': %s", + static_cast(mtu), + mInterfaceName.c_str(), + strerror(errno)); + } + + return Result::success(); +} + +Result Interface::setAddress(in_addr_t address, in_addr_t subnetMask) { + struct Request { + struct nlmsghdr hdr; + struct ifaddrmsg msg; + char buf[256]; + } request; + + memset(&request, 0, sizeof(request)); + + request.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(request.msg)); + request.hdr.nlmsg_type = RTM_NEWADDR; + request.hdr.nlmsg_flags = NLM_F_REQUEST | + NLM_F_ACK | + NLM_F_CREATE | + NLM_F_REPLACE; + + request.msg.ifa_family = AF_INET; + // Count the number of bits in the subnet mask, this is the length. + request.msg.ifa_prefixlen = __builtin_popcount(subnetMask); + request.msg.ifa_index = mIndex; + + addRouterAttribute(request, IFA_ADDRESS, &address, sizeof(address)); + addRouterAttribute(request, IFA_LOCAL, &address, sizeof(address)); + in_addr_t broadcast = broadcastFromNetmask(address, subnetMask); + addRouterAttribute(request, IFA_BROADCAST, &broadcast, sizeof(broadcast)); + + struct sockaddr_nl nlAddr; + memset(&nlAddr, 0, sizeof(nlAddr)); + nlAddr.nl_family = AF_NETLINK; + + int status = ::sendto(mSocketFd, &request, request.hdr.nlmsg_len, 0, + reinterpret_cast(&nlAddr), + sizeof(nlAddr)); + if (status == -1) { + return Result::error("Unable to set interface address: %s", + strerror(errno)); + } + char buffer[8192]; + status = ::recv(mSocketFd, buffer, sizeof(buffer), 0); + if (status < 0) { + return Result::error("Unable to read netlink response: %s", + strerror(errno)); + } + size_t responseSize = static_cast(status); + if (responseSize < sizeof(nlmsghdr)) { + return Result::error("Received incomplete response from netlink"); + } + auto response = reinterpret_cast(buffer); + if (response->nlmsg_type == NLMSG_ERROR) { + if (responseSize < NLMSG_HDRLEN + sizeof(nlmsgerr)) { + return Result::error("Recieved an error from netlink but the " + "response was incomplete"); + } + auto err = reinterpret_cast(NLMSG_DATA(response)); + if (err->error) { + return Result::error("Could not set interface address: %s", + strerror(-err->error)); + } + } + return Result::success(); +} + +struct ifreq Interface::createRequest() const { + struct ifreq request; + memset(&request, 0, sizeof(request)); + strncpy(request.ifr_name, mInterfaceName.c_str(), sizeof(request.ifr_name)); + request.ifr_name[sizeof(request.ifr_name) - 1] = '\0'; + + return request; +} + +Result Interface::populateIndex() { + struct ifreq request = createRequest(); + + int status = ::ioctl(mSocketFd, SIOCGIFINDEX, &request); + if (status != 0) { + return Result::error("Failed to get interface index for '%s': %s", + mInterfaceName.c_str(), strerror(errno)); + } + mIndex = request.ifr_ifindex; + return Result::success(); +} + +Result Interface::populateMacAddress() { + struct ifreq request = createRequest(); + + int status = ::ioctl(mSocketFd, SIOCGIFHWADDR, &request); + if (status != 0) { + return Result::error("Failed to get MAC address for '%s': %s", + mInterfaceName.c_str(), strerror(errno)); + } + memcpy(mMacAddress, &request.ifr_hwaddr.sa_data, ETH_ALEN); + return Result::success(); +} + +Result Interface::setInterfaceUp(bool shouldBeUp) { + struct ifreq request = createRequest(); + + int status = ::ioctl(mSocketFd, SIOCGIFFLAGS, &request); + if (status != 0) { + return Result::error("Failed to get interface flags for '%s': %s", + mInterfaceName.c_str(), strerror(errno)); + } + + bool isUp = (request.ifr_flags & IFF_UP) != 0; + if (isUp != shouldBeUp) { + // Toggle the up flag + request.ifr_flags ^= IFF_UP; + } else { + // Interface is already in desired state, do nothing + return Result::success(); + } + + status = ::ioctl(mSocketFd, SIOCSIFFLAGS, &request); + if (status != 0) { + return Result::error("Failed to set interface flags for '%s': %s", + mInterfaceName.c_str(), strerror(errno)); + } + + return Result::success(); +} + diff --git a/dhcp_recovery/client/interface.h b/dhcp_recovery/client/interface.h new file mode 100644 index 0000000..ca9e9e5 --- /dev/null +++ b/dhcp_recovery/client/interface.h @@ -0,0 +1,56 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "result.h" + +#include +#include + +#include + +// A class representing a network interface. The class provides useful +// functionality to configure and query the network interface. +class Interface { +public: + Interface(); + ~Interface(); + Result init(const char* interfaceName); + + // Returns the interface index indicated by the system + unsigned int getIndex() const { return mIndex; } + // Get the MAC address of the interface + const uint8_t (&getMacAddress() const)[ETH_ALEN] { return mMacAddress; } + // Get the name of the interface + const std::string& getName() const { return mInterfaceName; } + + Result bringUp(); + Result bringDown(); + Result setMtu(uint16_t mtu); + Result setAddress(in_addr_t address, in_addr_t subnetMask); + +private: + struct ifreq createRequest() const; + Result populateIndex(); + Result populateMacAddress(); + Result setInterfaceUp(bool shouldBeUp); + + std::string mInterfaceName; + int mSocketFd; + unsigned int mIndex; + uint8_t mMacAddress[ETH_ALEN]; +}; + diff --git a/dhcp_recovery/client/log.h b/dhcp_recovery/client/log.h new file mode 100644 index 0000000..bf141df --- /dev/null +++ b/dhcp_recovery/client/log.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#define LOG_TAG "dhcpclient" +#include + diff --git a/dhcp_recovery/client/main.cpp b/dhcp_recovery/client/main.cpp new file mode 100644 index 0000000..70b854f --- /dev/null +++ b/dhcp_recovery/client/main.cpp @@ -0,0 +1,72 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "dhcpclient.h" +#include "log.h" + +static void usage(const char* program) { + ALOGE("Usage: %s [--no-gateway] -i ", program); + ALOGE(" If the optional parameter --no-gateway is specified the client"); + ALOGE(" will not configure the default gateway of the system."); +} + +int main(int argc, char* argv[]) { + if (argc < 3) { + usage(argv[0]); + return 1; + } + const char* interfaceName = nullptr; + uint32_t options = 0; + + for (int i = 1; i < argc; ++i) { + if (strcmp(argv[i], "-i") == 0) { + if (i + 1 < argc) { + interfaceName = argv[++i]; + } else { + ALOGE("ERROR: -i parameter needs an argument"); + usage(argv[0]); + return 1; + } + } else if (strcmp(argv[i], "--no-gateway") == 0) { + options |= static_cast(ClientOption::NoGateway); + } else { + ALOGE("ERROR: unknown parameters %s", argv[i]); + usage(argv[0]); + return 1; + } + } + if (interfaceName == nullptr) { + ALOGE("ERROR: No interface specified"); + usage(argv[0]); + return 1; + } + + DhcpClient client(options); + Result res = client.init(interfaceName); + if (!res) { + ALOGE("Failed to initialize DHCP client: %s\n", res.c_str()); + return 1; + } + + res = client.run(); + if (!res) { + ALOGE("DHCP client failed: %s\n", res.c_str()); + return 1; + } + // This is weird and shouldn't happen, the client should run forever. + return 0; +} + diff --git a/dhcp_recovery/client/netlink.h b/dhcp_recovery/client/netlink.h new file mode 100644 index 0000000..e0c916f --- /dev/null +++ b/dhcp_recovery/client/netlink.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +template +inline void addRouterAttribute(Request& r, + int type, + const void* data, + size_t size) { + // Calculate the offset into the character buffer where the RTA data lives + // We use offsetof on the buffer to get it. This avoids undefined behavior + // by casting the buffer (which is safe because it's char) instead of the + // Request struct.(which is undefined because of aliasing) + size_t offset = NLMSG_ALIGN(r.hdr.nlmsg_len) - offsetof(Request, buf); + auto attr = reinterpret_cast(r.buf + offset); + attr->rta_type = type; + attr->rta_len = RTA_LENGTH(size); + memcpy(RTA_DATA(attr), data, size); + + // Update the message length to include the router attribute. + r.hdr.nlmsg_len = NLMSG_ALIGN(r.hdr.nlmsg_len) + RTA_ALIGN(attr->rta_len); +} diff --git a/dhcp_recovery/client/router.cpp b/dhcp_recovery/client/router.cpp new file mode 100644 index 0000000..7c87e2d --- /dev/null +++ b/dhcp_recovery/client/router.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "router.h" + +#include "netlink.h" + +#include + +#include +#include +#include + +Router::Router() : mSocketFd(-1) { +} + +Router::~Router() { + if (mSocketFd != -1) { + ::close(mSocketFd); + mSocketFd = -1; + } +} + +Result Router::init() { + // Create a netlink socket to the router + mSocketFd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + if (mSocketFd == -1) { + return Result::error(strerror(errno)); + } + return Result::success(); +} + +Result Router::setDefaultGateway(in_addr_t gateway, unsigned int ifaceIndex) { + struct Request { + struct nlmsghdr hdr; + struct rtmsg msg; + char buf[256]; + } request; + + memset(&request, 0, sizeof(request)); + + // Set up a request to create a new route + request.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(request.msg)); + request.hdr.nlmsg_type = RTM_NEWROUTE; + request.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; + + request.msg.rtm_family = AF_INET; + request.msg.rtm_dst_len = 0; + request.msg.rtm_table = RT_TABLE_MAIN; + request.msg.rtm_protocol = RTPROT_BOOT; + request.msg.rtm_scope = RT_SCOPE_UNIVERSE; + request.msg.rtm_type = RTN_UNICAST; + + addRouterAttribute(request, RTA_GATEWAY, &gateway, sizeof(gateway)); + addRouterAttribute(request, RTA_OIF, &ifaceIndex, sizeof(ifaceIndex)); + + return sendNetlinkMessage(&request, request.hdr.nlmsg_len); +} + +Result Router::sendNetlinkMessage(const void* data, size_t size) { + struct sockaddr_nl nlAddress; + memset(&nlAddress, 0, sizeof(nlAddress)); + nlAddress.nl_family = AF_NETLINK; + + int res = ::sendto(mSocketFd, data, size, 0, + reinterpret_cast(&nlAddress), + sizeof(nlAddress)); + if (res == -1) { + return Result::error("Unable to send on netlink socket: %s", + strerror(errno)); + } + return Result::success(); +} + diff --git a/dhcp_recovery/client/router.h b/dhcp_recovery/client/router.h new file mode 100644 index 0000000..1ab6654 --- /dev/null +++ b/dhcp_recovery/client/router.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include + +#include "result.h" + +class Router { +public: + Router(); + ~Router(); + // Initialize the router, this has to be called before any other methods can + // be called. It only needs to be called once. + Result init(); + + // Set the default route to |gateway| on the interface specified by + // |interfaceIndex|. If the default route is already set up with the same + // configuration then nothing is done. If another default route exists it + // will be removed and replaced by the new one. If no default route exists + // a route will be created with the given parameters. + Result setDefaultGateway(in_addr_t gateway, unsigned int interfaceIndex); +private: + Result sendNetlinkMessage(const void* data, size_t size); + + // Netlink socket for setting up neighbors and routes + int mSocketFd; +}; + diff --git a/dhcp_recovery/client/timer.cpp b/dhcp_recovery/client/timer.cpp new file mode 100644 index 0000000..5f81322 --- /dev/null +++ b/dhcp_recovery/client/timer.cpp @@ -0,0 +1,46 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "timer.h" + +#include + +uint64_t now() { + struct timespec time = { 0, 0 }; + clock_gettime(CLOCK_MONOTONIC, &time); + return static_cast(time.tv_sec) * 1000u + + static_cast(time.tv_nsec / 1000000u); +} + +Timer::Timer() : mExpires(0) { +} + +void Timer::expireSeconds(uint64_t seconds) { + mExpires = now() + seconds * 1000u; +} + +bool Timer::expired() const { + return now() >= mExpires; +} + +uint64_t Timer::remainingMillis() const { + uint64_t current = now(); + if (current > mExpires) { + return 0; + } + return mExpires - current; +} + diff --git a/dhcp_recovery/client/timer.h b/dhcp_recovery/client/timer.h new file mode 100644 index 0000000..7ae01f9 --- /dev/null +++ b/dhcp_recovery/client/timer.h @@ -0,0 +1,40 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +// Return the current timestamp from a monotonic clock in milliseconds. +uint64_t now(); + +class Timer { +public: + // Create a timer, initially the timer is already expired. + Timer(); + + // Set the timer to expire in |seconds| seconds. + void expireSeconds(uint64_t seconds); + + // Return true if the timer has expired. + bool expired() const; + // Get the remaining time on the timer in milliseconds. + uint64_t remainingMillis() const; + +private: + uint64_t mExpires; +}; + diff --git a/dhcp_recovery/common/Android.bp b/dhcp_recovery/common/Android.bp new file mode 100644 index 0000000..60a9a35 --- /dev/null +++ b/dhcp_recovery/common/Android.bp @@ -0,0 +1,39 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "device_generic_goldfish_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["x86_dhcpclient_license"], +} + +cc_library_static { + name: "libx86dhcpclient", + srcs: [ + "message.cpp", + "socket.cpp", + "utils.cpp", + ], + export_include_dirs: ["include"], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], + recovery_available: true, + vendor_available: true, +} diff --git a/dhcp_recovery/common/include/dhcp.h b/dhcp_recovery/common/include/dhcp.h new file mode 100644 index 0000000..beb388f --- /dev/null +++ b/dhcp_recovery/common/include/dhcp.h @@ -0,0 +1,72 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +// Ports +#define PORT_BOOTP_SERVER 67 +#define PORT_BOOTP_CLIENT 68 + +// Operations +#define OP_BOOTREQUEST 1 +#define OP_BOOTREPLY 2 + +// Flags +#define FLAGS_BROADCAST 0x8000 + +// Hardware address types +#define HTYPE_ETHER 1 + +// The first four bytes of options are a cookie to indicate that the payload are +// DHCP options as opposed to some other BOOTP extension. +#define OPT_COOKIE1 0x63 +#define OPT_COOKIE2 0x82 +#define OPT_COOKIE3 0x53 +#define OPT_COOKIE4 0x63 + +// BOOTP/DHCP options - see RFC 2132 +#define OPT_PAD 0 + +#define OPT_SUBNET_MASK 1 // 4 +#define OPT_TIME_OFFSET 2 // 4 +#define OPT_GATEWAY 3 // 4*n * n +#define OPT_DNS 6 // 4*n * n +#define OPT_DOMAIN_NAME 15 // n +#define OPT_MTU 26 // 2 +#define OPT_BROADCAST_ADDR 28 // 4 + +#define OPT_REQUESTED_IP 50 // 4 +#define OPT_LEASE_TIME 51 // 4 +#define OPT_MESSAGE_TYPE 53 // 1 +#define OPT_SERVER_ID 54 // 4 +#define OPT_PARAMETER_LIST 55 // n * n +#define OPT_MESSAGE 56 // n +#define OPT_T1 58 // 4 +#define OPT_T2 59 // 4 +#define OPT_CLASS_ID 60 // n +#define OPT_CLIENT_ID 61 // n +#define OPT_END 255 + +// DHCP message types +#define DHCPDISCOVER 1 +#define DHCPOFFER 2 +#define DHCPREQUEST 3 +#define DHCPDECLINE 4 +#define DHCPACK 5 +#define DHCPNAK 6 +#define DHCPRELEASE 7 +#define DHCPINFORM 8 + + diff --git a/dhcp_recovery/common/include/message.h b/dhcp_recovery/common/include/message.h new file mode 100644 index 0000000..84029cc --- /dev/null +++ b/dhcp_recovery/common/include/message.h @@ -0,0 +1,131 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include +#include +#include + +#include + +class Message { +public: + Message(); + Message(const uint8_t* data, size_t size); + static Message discover(const uint8_t (&sourceMac)[ETH_ALEN]); + static Message request(const uint8_t (&sourceMac)[ETH_ALEN], + in_addr_t requestAddress, + in_addr_t serverAddress); + static Message offer(const Message& sourceMessage, + in_addr_t serverAddress, + in_addr_t offeredAddress, + in_addr_t offeredNetmask, + in_addr_t offeredGateway, + const in_addr_t* offeredDnsServers, + size_t numOfferedDnsServers); + static Message ack(const Message& sourceMessage, + in_addr_t serverAddress, + in_addr_t offeredAddress, + in_addr_t offeredNetmask, + in_addr_t offeredGateway, + const in_addr_t* offeredDnsServers, + size_t numOfferedDnsServers); + static Message nack(const Message& sourceMessage, in_addr_t serverAddress); + + // Ensure that the data in the message represent a valid DHCP message + bool isValidDhcpMessage(uint8_t expectedOp) const; + // Ensure that the data in the message represent a valid DHCP message and + // has a xid (transaction ID) that matches |expectedXid|. + bool isValidDhcpMessage(uint8_t expectedOp, uint32_t expectedXid) const; + + const uint8_t* data() const { + return reinterpret_cast(&dhcpData); + } + uint8_t* data() { + return reinterpret_cast(&dhcpData); + } + const uint8_t* end() const { return data() + mSize; } + + size_t optionsSize() const; + size_t size() const { return mSize; } + void setSize(size_t size) { mSize = size; } + size_t capacity() const { return sizeof(dhcpData); } + + // Get the DHCP message type + uint8_t type() const; + // Get the DHCP server ID + in_addr_t serverId() const; + // Get the requested IP + in_addr_t requestedIp() const; + + struct Dhcp { + uint8_t op; /* BOOTREQUEST / BOOTREPLY */ + uint8_t htype; /* hw addr type */ + uint8_t hlen; /* hw addr len */ + uint8_t hops; /* client set to 0 */ + + uint32_t xid; /* transaction id */ + + uint16_t secs; /* seconds since start of acq */ + uint16_t flags; + + uint32_t ciaddr; /* client IP addr */ + uint32_t yiaddr; /* your (client) IP addr */ + uint32_t siaddr; /* ip addr of next server */ + /* (DHCPOFFER and DHCPACK) */ + uint32_t giaddr; /* relay agent IP addr */ + + uint8_t chaddr[16]; /* client hw addr */ + char sname[64]; /* asciiz server hostname */ + char file[128]; /* asciiz boot file name */ + + uint8_t options[1024]; /* optional parameters */ + } dhcpData; +private: + Message(uint8_t operation, + const uint8_t (&macAddress)[ETH_ALEN], + uint8_t type); + + void addOption(uint8_t type, const void* data, uint8_t size); + template + void addOption(uint8_t type, T data) { + static_assert(sizeof(T) <= 255, "The size of data is too large"); + addOption(type, &data, sizeof(data)); + } + template + void addOption(uint8_t type, T (&items)[N]) { + static_assert(sizeof(T) * N <= 255, + "The size of data is too large"); + uint8_t* opts = nextOption(); + *opts++ = type; + *opts++ = sizeof(T) * N; + for (const T& item : items) { + memcpy(opts, &item, sizeof(item)); + opts += sizeof(item); + } + updateSize(opts); + } + void endOptions(); + + const uint8_t* getOption(uint8_t optCode, uint8_t* length) const; + uint8_t* nextOption(); + void updateSize(uint8_t* optionsEnd); + size_t mSize; +}; + +static_assert(offsetof(Message::Dhcp, htype) == sizeof(Message::Dhcp::op), + "Invalid packing for DHCP message struct"); diff --git a/dhcp_recovery/common/include/result.h b/dhcp_recovery/common/include/result.h new file mode 100644 index 0000000..5087e14 --- /dev/null +++ b/dhcp_recovery/common/include/result.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include + +#include + +class Result { +public: + static Result success() { + return Result(true); + } + // Construct a result indicating an error. + static Result error(std::string message) { + return Result(message); + } + static Result error(const char* format, ...) { + char buffer[1024]; + va_list args; + va_start(args, format); + vsnprintf(buffer, sizeof(buffer), format, args); + va_end(args); + buffer[sizeof(buffer) - 1] = '\0'; + return Result(std::string(buffer)); + } + + bool isSuccess() const { return mSuccess; } + bool operator!() const { return !mSuccess; } + + const char* c_str() const { return mMessage.c_str(); } +private: + explicit Result(bool success) : mSuccess(success) { } + explicit Result(std::string message) + : mMessage(message), mSuccess(false) { + } + std::string mMessage; + bool mSuccess; +}; + diff --git a/dhcp_recovery/common/include/socket.h b/dhcp_recovery/common/include/socket.h new file mode 100644 index 0000000..0c9483c --- /dev/null +++ b/dhcp_recovery/common/include/socket.h @@ -0,0 +1,78 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "result.h" + +#include + +class Message; + +class Socket { +public: + Socket(); + Socket(const Socket&) = delete; + ~Socket(); + + Socket& operator=(const Socket&) = delete; + + int get() const { return mSocketFd; } + // Open a socket, |domain|, |type| and |protocol| are as described in the + // man pages for socket. + Result open(int domain, int type, int protocol); + // Bind to a generic |sockaddr| of size |sockaddrLength| + Result bind(const void* sockaddr, size_t sockaddrLength); + // Bind to an IP |address| and |port| + Result bindIp(in_addr_t address, uint16_t port); + // Bind a raw socket to the interface with index |interfaceIndex|. + Result bindRaw(unsigned int interfaceIndex); + // Send data in |message| on an IP socket to + // |destinationAddress|:|destinationPort|, the message will egress on the + // interface specified by |interfaceIndex| + Result sendOnInterface(unsigned int interfaceIndex, + in_addr_t destinationAddress, + uint16_t destinationPort, + const Message& message); + // Send |message| as a UDP datagram on a raw socket. The source address of + // the message will be |source|:|sourcePort| and the destination will be + // |destination|:|destinationPort|. The message will be sent on the + // interface indicated by |interfaceIndex|. + Result sendRawUdp(in_addr_t source, + uint16_t sourcePort, + in_addr_t destination, + uint16_t destinationPort, + unsigned int interfaceIndex, + const Message& message); + // Receive data on the socket and indicate which interface the data was + // received on in |interfaceIndex|. The received data is placed in |message| + Result receiveFromInterface(Message* message, unsigned int* interfaceIndex); + // Receive UDP data on a raw socket. Expect that the protocol in the IP + // header is UDP and that the port in the UDP header is |expectedPort|. If + // the received data is valid then |isValid| will be set to true, otherwise + // false. The validity check includes the expected values as well as basic + // size requirements to fit the expected protocol headers. The method will + // only return an error result if the actual receiving fails. + Result receiveRawUdp(uint16_t expectedPort, + Message* message, + bool* isValid); + // Enable |optionName| on option |level|. These values are the same as used + // in setsockopt calls. + Result enableOption(int level, int optionName); +private: + int mSocketFd; +}; + diff --git a/dhcp_recovery/common/include/utils.h b/dhcp_recovery/common/include/utils.h new file mode 100644 index 0000000..5f4b971 --- /dev/null +++ b/dhcp_recovery/common/include/utils.h @@ -0,0 +1,24 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +std::string addrToStr(in_addr_t address); + diff --git a/dhcp_recovery/common/message.cpp b/dhcp_recovery/common/message.cpp new file mode 100644 index 0000000..64a2938 --- /dev/null +++ b/dhcp_recovery/common/message.cpp @@ -0,0 +1,312 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "message.h" +#include "dhcp.h" + +#include + +#include + +static uint32_t sNextTransactionId = 1; + +// The default lease time in seconds +static const uint32_t kDefaultLeaseTime = 10 * 60; + +// The parameters that the client would like to receive from the server +static const uint8_t kRequestParameters[] = { OPT_SUBNET_MASK, + OPT_GATEWAY, + OPT_DNS, + OPT_BROADCAST_ADDR, + OPT_LEASE_TIME, + OPT_T1, + OPT_T2, + OPT_MTU }; + +Message::Message() { + memset(&dhcpData, 0, sizeof(dhcpData)); + mSize = 0; +} + +Message::Message(const uint8_t* data, size_t size) { + if (size <= sizeof(dhcpData)) { + memcpy(&dhcpData, data, size); + mSize = size; + } else { + memset(&dhcpData, 0, sizeof(dhcpData)); + mSize = 0; + } +} + +Message Message::discover(const uint8_t (&sourceMac)[ETH_ALEN]) { + Message message(OP_BOOTREQUEST, + sourceMac, + static_cast(DHCPDISCOVER)); + + message.addOption(OPT_PARAMETER_LIST, kRequestParameters); + message.endOptions(); + + return message; +} + +Message Message::request(const uint8_t (&sourceMac)[ETH_ALEN], + in_addr_t requestAddress, + in_addr_t serverAddress) { + + Message message(OP_BOOTREQUEST, + sourceMac, + static_cast(DHCPREQUEST)); + + message.addOption(OPT_PARAMETER_LIST, kRequestParameters); + message.addOption(OPT_REQUESTED_IP, requestAddress); + message.addOption(OPT_SERVER_ID, serverAddress); + message.endOptions(); + + return message; +} + +Message Message::offer(const Message& sourceMessage, + in_addr_t serverAddress, + in_addr_t offeredAddress, + in_addr_t offeredNetmask, + in_addr_t offeredGateway, + const in_addr_t* offeredDnsServers, + size_t numOfferedDnsServers) { + + uint8_t macAddress[ETH_ALEN]; + memcpy(macAddress, sourceMessage.dhcpData.chaddr, sizeof(macAddress)); + Message message(OP_BOOTREPLY, macAddress, static_cast(DHCPOFFER)); + + message.dhcpData.xid = sourceMessage.dhcpData.xid; + message.dhcpData.flags = sourceMessage.dhcpData.flags; + message.dhcpData.yiaddr = offeredAddress; + message.dhcpData.giaddr = sourceMessage.dhcpData.giaddr; + + message.addOption(OPT_SERVER_ID, serverAddress); + message.addOption(OPT_LEASE_TIME, kDefaultLeaseTime); + message.addOption(OPT_SUBNET_MASK, offeredNetmask); + message.addOption(OPT_GATEWAY, offeredGateway); + message.addOption(OPT_DNS, + offeredDnsServers, + numOfferedDnsServers * sizeof(in_addr_t)); + + message.endOptions(); + + return message; +} + +Message Message::ack(const Message& sourceMessage, + in_addr_t serverAddress, + in_addr_t offeredAddress, + in_addr_t offeredNetmask, + in_addr_t offeredGateway, + const in_addr_t* offeredDnsServers, + size_t numOfferedDnsServers) { + uint8_t macAddress[ETH_ALEN]; + memcpy(macAddress, sourceMessage.dhcpData.chaddr, sizeof(macAddress)); + Message message(OP_BOOTREPLY, macAddress, static_cast(DHCPACK)); + + message.dhcpData.xid = sourceMessage.dhcpData.xid; + message.dhcpData.flags = sourceMessage.dhcpData.flags; + message.dhcpData.yiaddr = offeredAddress; + message.dhcpData.giaddr = sourceMessage.dhcpData.giaddr; + + message.addOption(OPT_SERVER_ID, serverAddress); + message.addOption(OPT_LEASE_TIME, kDefaultLeaseTime); + message.addOption(OPT_SUBNET_MASK, offeredNetmask); + message.addOption(OPT_GATEWAY, offeredGateway); + message.addOption(OPT_DNS, + offeredDnsServers, + numOfferedDnsServers * sizeof(in_addr_t)); + + message.endOptions(); + + return message; +} + +Message Message::nack(const Message& sourceMessage, in_addr_t serverAddress) { + uint8_t macAddress[ETH_ALEN]; + memcpy(macAddress, sourceMessage.dhcpData.chaddr, sizeof(macAddress)); + Message message(OP_BOOTREPLY, macAddress, static_cast(DHCPNAK)); + + message.dhcpData.xid = sourceMessage.dhcpData.xid; + message.dhcpData.flags = sourceMessage.dhcpData.flags; + message.dhcpData.giaddr = sourceMessage.dhcpData.giaddr; + + message.addOption(OPT_SERVER_ID, serverAddress); + message.endOptions(); + + return message; +} + +bool Message::isValidDhcpMessage(uint8_t expectedOp, + uint32_t expectedXid) const { + if (!isValidDhcpMessage(expectedOp)) { + return false; + } + // Only look for message with a matching transaction ID + if (dhcpData.xid != expectedXid) { + return false; + } + return true; +} + +bool Message::isValidDhcpMessage(uint8_t expectedOp) const { + // Require that there is at least enough options for the DHCP cookie + if (dhcpData.options + 4 > end()) { + return false; + } + + if (dhcpData.op != expectedOp) { + return false; + } + if (dhcpData.htype != HTYPE_ETHER) { + return false; + } + if (dhcpData.hlen != ETH_ALEN) { + return false; + } + + // Need to have the correct cookie in the options + if (dhcpData.options[0] != OPT_COOKIE1) { + return false; + } + if (dhcpData.options[1] != OPT_COOKIE2) { + return false; + } + if (dhcpData.options[2] != OPT_COOKIE3) { + return false; + } + if (dhcpData.options[3] != OPT_COOKIE4) { + return false; + } + + return true; +} + +size_t Message::optionsSize() const { + auto options = reinterpret_cast(&dhcpData.options); + const uint8_t* msgEnd = end(); + if (msgEnd <= options) { + return 0; + } + return msgEnd - options; +} + +uint8_t Message::type() const { + uint8_t length = 0; + const uint8_t* opt = getOption(OPT_MESSAGE_TYPE, &length); + if (opt && length == 1) { + return *opt; + } + return 0; +} + +in_addr_t Message::serverId() const { + uint8_t length = 0; + const uint8_t* opt = getOption(OPT_SERVER_ID, &length); + if (opt && length == 4) { + return *reinterpret_cast(opt); + } + return 0; +} + +in_addr_t Message::requestedIp() const { + uint8_t length = 0; + const uint8_t* opt = getOption(OPT_REQUESTED_IP, &length); + if (opt && length == 4) { + return *reinterpret_cast(opt); + } + return 0; +} + +Message::Message(uint8_t operation, + const uint8_t (&macAddress)[ETH_ALEN], + uint8_t type) { + memset(&dhcpData, 0, sizeof(dhcpData)); + + dhcpData.op = operation; + dhcpData.htype = HTYPE_ETHER; + dhcpData.hlen = ETH_ALEN; + dhcpData.hops = 0; + + dhcpData.flags = htons(FLAGS_BROADCAST); + + dhcpData.xid = htonl(sNextTransactionId++); + + memcpy(dhcpData.chaddr, macAddress, ETH_ALEN); + + uint8_t* opts = dhcpData.options; + + *opts++ = OPT_COOKIE1; + *opts++ = OPT_COOKIE2; + *opts++ = OPT_COOKIE3; + *opts++ = OPT_COOKIE4; + + *opts++ = OPT_MESSAGE_TYPE; + *opts++ = 1; + *opts++ = type; + + updateSize(opts); +} + +void Message::addOption(uint8_t type, const void* data, uint8_t size) { + uint8_t* opts = nextOption(); + + *opts++ = type; + *opts++ = size; + memcpy(opts, data, size); + opts += size; + + updateSize(opts); +} + +void Message::endOptions() { + uint8_t* opts = nextOption(); + + *opts++ = OPT_END; + + updateSize(opts); +} + +const uint8_t* Message::getOption(uint8_t expectedOptCode, + uint8_t* length) const { + size_t optsSize = optionsSize(); + for (size_t i = 4; i + 2 < optsSize; ) { + uint8_t optCode = dhcpData.options[i]; + uint8_t optLen = dhcpData.options[i + 1]; + const uint8_t* opt = dhcpData.options + i + 2; + + if (optCode == OPT_END) { + return nullptr; + } + if (optCode == expectedOptCode) { + *length = optLen; + return opt; + } + i += 2 + optLen; + } + return nullptr; +} + +uint8_t* Message::nextOption() { + return reinterpret_cast(&dhcpData) + size(); +} + +void Message::updateSize(uint8_t* optionsEnd) { + mSize = optionsEnd - reinterpret_cast(&dhcpData); +} + diff --git a/dhcp_recovery/common/socket.cpp b/dhcp_recovery/common/socket.cpp new file mode 100644 index 0000000..8fd7b9f --- /dev/null +++ b/dhcp_recovery/common/socket.cpp @@ -0,0 +1,315 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "socket.h" + +#include "message.h" +#include "utils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Combine the checksum of |buffer| with |size| bytes with |checksum|. This is +// used for checksum calculations for IP and UDP. +static uint32_t addChecksum(const uint8_t* buffer, + size_t size, + uint32_t checksum) { + const uint16_t* data = reinterpret_cast(buffer); + while (size > 1) { + checksum += *data++; + size -= 2; + } + if (size > 0) { + // Odd size, add the last byte + checksum += *reinterpret_cast(data); + } + // msw is the most significant word, the upper 16 bits of the checksum + for (uint32_t msw = checksum >> 16; msw != 0; msw = checksum >> 16) { + checksum = (checksum & 0xFFFF) + msw; + } + return checksum; +} + +// Convenienct template function for checksum calculation +template +static uint32_t addChecksum(const T& data, uint32_t checksum) { + return addChecksum(reinterpret_cast(&data), sizeof(T), checksum); +} + +// Finalize the IP or UDP |checksum| by inverting and truncating it. +static uint32_t finishChecksum(uint32_t checksum) { + return ~checksum & 0xFFFF; +} + +Socket::Socket() : mSocketFd(-1) { +} + +Socket::~Socket() { + if (mSocketFd != -1) { + ::close(mSocketFd); + mSocketFd = -1; + } +} + + +Result Socket::open(int domain, int type, int protocol) { + if (mSocketFd != -1) { + return Result::error("Socket already open"); + } + mSocketFd = ::socket(domain, type, protocol); + if (mSocketFd == -1) { + return Result::error("Failed to open socket: %s", strerror(errno)); + } + return Result::success(); +} + +Result Socket::bind(const void* sockaddr, size_t sockaddrLength) { + if (mSocketFd == -1) { + return Result::error("Socket not open"); + } + + int status = ::bind(mSocketFd, + reinterpret_cast(sockaddr), + sockaddrLength); + if (status != 0) { + return Result::error("Unable to bind raw socket: %s", strerror(errno)); + } + + return Result::success(); +} + +Result Socket::bindIp(in_addr_t address, uint16_t port) { + struct sockaddr_in sockaddr; + memset(&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sin_family = AF_INET; + sockaddr.sin_port = htons(port); + sockaddr.sin_addr.s_addr = address; + + return bind(&sockaddr, sizeof(sockaddr)); +} + +Result Socket::bindRaw(unsigned int interfaceIndex) { + struct sockaddr_ll sockaddr; + memset(&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sll_family = AF_PACKET; + sockaddr.sll_protocol = htons(ETH_P_IP); + sockaddr.sll_ifindex = interfaceIndex; + + return bind(&sockaddr, sizeof(sockaddr)); +} + +Result Socket::sendOnInterface(unsigned int interfaceIndex, + in_addr_t destinationAddress, + uint16_t destinationPort, + const Message& message) { + if (mSocketFd == -1) { + return Result::error("Socket not open"); + } + + char controlData[CMSG_SPACE(sizeof(struct in_pktinfo))] = { 0 }; + struct sockaddr_in addr; + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(destinationPort); + addr.sin_addr.s_addr = destinationAddress; + + struct msghdr header; + memset(&header, 0, sizeof(header)); + struct iovec iov; + // The struct member is non-const since it's used for receiving but it's + // safe to cast away const for sending. + iov.iov_base = const_cast(message.data()); + iov.iov_len = message.size(); + header.msg_name = &addr; + header.msg_namelen = sizeof(addr); + header.msg_iov = &iov; + header.msg_iovlen = 1; + header.msg_control = &controlData; + header.msg_controllen = sizeof(controlData); + + struct cmsghdr* controlHeader = CMSG_FIRSTHDR(&header); + controlHeader->cmsg_level = IPPROTO_IP; + controlHeader->cmsg_type = IP_PKTINFO; + controlHeader->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); + auto packetInfo = + reinterpret_cast(CMSG_DATA(controlHeader)); + memset(packetInfo, 0, sizeof(*packetInfo)); + packetInfo->ipi_ifindex = interfaceIndex; + + ssize_t status = ::sendmsg(mSocketFd, &header, 0); + if (status <= 0) { + return Result::error("Failed to send packet: %s", strerror(errno)); + } + return Result::success(); +} + +Result Socket::sendRawUdp(in_addr_t source, + uint16_t sourcePort, + in_addr_t destination, + uint16_t destinationPort, + unsigned int interfaceIndex, + const Message& message) { + struct iphdr ip; + struct udphdr udp; + + ip.version = IPVERSION; + ip.ihl = sizeof(ip) >> 2; + ip.tos = 0; + ip.tot_len = htons(sizeof(ip) + sizeof(udp) + message.size()); + ip.id = 0; + ip.frag_off = 0; + ip.ttl = IPDEFTTL; + ip.protocol = IPPROTO_UDP; + ip.check = 0; + ip.saddr = source; + ip.daddr = destination; + ip.check = finishChecksum(addChecksum(ip, 0)); + + udp.source = htons(sourcePort); + udp.dest = htons(destinationPort); + udp.len = htons(sizeof(udp) + message.size()); + udp.check = 0; + + uint32_t udpChecksum = 0; + udpChecksum = addChecksum(ip.saddr, udpChecksum); + udpChecksum = addChecksum(ip.daddr, udpChecksum); + udpChecksum = addChecksum(htons(IPPROTO_UDP), udpChecksum); + udpChecksum = addChecksum(udp.len, udpChecksum); + udpChecksum = addChecksum(udp, udpChecksum); + udpChecksum = addChecksum(message.data(), message.size(), udpChecksum); + udp.check = finishChecksum(udpChecksum); + + struct iovec iov[3]; + + iov[0].iov_base = static_cast(&ip); + iov[0].iov_len = sizeof(ip); + iov[1].iov_base = static_cast(&udp); + iov[1].iov_len = sizeof(udp); + // sendmsg requires these to be non-const but for sending won't modify them + iov[2].iov_base = static_cast(const_cast(message.data())); + iov[2].iov_len = message.size(); + + struct sockaddr_ll dest; + memset(&dest, 0, sizeof(dest)); + dest.sll_family = AF_PACKET; + dest.sll_protocol = htons(ETH_P_IP); + dest.sll_ifindex = interfaceIndex; + dest.sll_halen = ETH_ALEN; + memset(dest.sll_addr, 0xFF, ETH_ALEN); + + struct msghdr header; + memset(&header, 0, sizeof(header)); + header.msg_name = &dest; + header.msg_namelen = sizeof(dest); + header.msg_iov = iov; + header.msg_iovlen = sizeof(iov) / sizeof(iov[0]); + + ssize_t res = ::sendmsg(mSocketFd, &header, 0); + if (res == -1) { + return Result::error("Failed to send message: %s", strerror(errno)); + } + return Result::success(); +} + +Result Socket::receiveFromInterface(Message* message, + unsigned int* interfaceIndex) { + char controlData[CMSG_SPACE(sizeof(struct in_pktinfo))]; + struct msghdr header; + memset(&header, 0, sizeof(header)); + struct iovec iov; + iov.iov_base = message->data(); + iov.iov_len = message->capacity(); + header.msg_iov = &iov; + header.msg_iovlen = 1; + header.msg_control = &controlData; + header.msg_controllen = sizeof(controlData); + + ssize_t bytesRead = ::recvmsg(mSocketFd, &header, 0); + if (bytesRead < 0) { + return Result::error("Error receiving on socket: %s", strerror(errno)); + } + message->setSize(static_cast(bytesRead)); + if (header.msg_controllen >= sizeof(struct cmsghdr)) { + for (struct cmsghdr* ctrl = CMSG_FIRSTHDR(&header); + ctrl; + ctrl = CMSG_NXTHDR(&header, ctrl)) { + if (ctrl->cmsg_level == SOL_IP && + ctrl->cmsg_type == IP_PKTINFO) { + auto packetInfo = + reinterpret_cast(CMSG_DATA(ctrl)); + *interfaceIndex = packetInfo->ipi_ifindex; + } + } + } + return Result::success(); +} + +Result Socket::receiveRawUdp(uint16_t expectedPort, + Message* message, + bool* isValid) { + struct iphdr ip; + struct udphdr udp; + + struct iovec iov[3]; + iov[0].iov_base = &ip; + iov[0].iov_len = sizeof(ip); + iov[1].iov_base = &udp; + iov[1].iov_len = sizeof(udp); + iov[2].iov_base = message->data(); + iov[2].iov_len = message->capacity(); + + ssize_t bytesRead = ::readv(mSocketFd, iov, 3); + if (bytesRead < 0) { + return Result::error("Unable to read from socket: %s", strerror(errno)); + } + if (static_cast(bytesRead) < sizeof(ip) + sizeof(udp)) { + // Not enough bytes to even cover IP and UDP headers + *isValid = false; + return Result::success(); + } + *isValid = ip.version == IPVERSION && + ip.ihl == (sizeof(ip) >> 2) && + ip.protocol == IPPROTO_UDP && + udp.dest == htons(expectedPort); + + message->setSize(bytesRead - sizeof(ip) - sizeof(udp)); + return Result::success(); +} + +Result Socket::enableOption(int level, int optionName) { + if (mSocketFd == -1) { + return Result::error("Socket not open"); + } + + int enabled = 1; + int status = ::setsockopt(mSocketFd, + level, + optionName, + &enabled, + sizeof(enabled)); + if (status == -1) { + return Result::error("Failed to set socket option: %s", + strerror(errno)); + } + return Result::success(); +} diff --git a/dhcp_recovery/common/utils.cpp b/dhcp_recovery/common/utils.cpp new file mode 100644 index 0000000..e4a37f3 --- /dev/null +++ b/dhcp_recovery/common/utils.cpp @@ -0,0 +1,26 @@ +/* + * Copyright 2017, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "utils.h" + +std::string addrToStr(in_addr_t address) { + char buffer[INET_ADDRSTRLEN]; + if (::inet_ntop(AF_INET, &address, buffer, sizeof(buffer)) == nullptr) { + return "[unknown]"; + } + return buffer; +} + diff --git a/fstab.internal.x86 b/fstab.internal.x86 index bd4bbbc..a9809d9 100644 --- a/fstab.internal.x86 +++ b/fstab.internal.x86 @@ -1,4 +1,5 @@ none /cache tmpfs nosuid,nodev,noatime defaults +/dev/block/by-name/misc /misc emmc defaults defaults /devices/*/block/sr* auto auto defaults voldmanaged=cdrom:auto /devices/*/usb*/* auto auto defaults voldmanaged=usb:auto,noemulatedsd @@ -12,4 +13,6 @@ none /cache tmpfs nosuid,nodev,noatime defaults /devices/*/*/vd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usbdisk,noemulatedsd /devices/*/*/nvme* auto auto defaults,uid=1000,gid=1000 voldmanaged=usbdisk,noemulatedsd /devices/*/*/xvd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usbdisk,noemulatedsd -/dev/block/zram0 none swap defaults zramsize=52%,max_comp_streams=4,swapprio=10,notrim + +share /mnt/vendor/shared virtiofs nosuid,nodev,noatime nofail +share /mnt/vendor/shared 9p trans=virtio,version=9p2000.L,nosuid,nodev,noatime nofail diff --git a/fstab.x86 b/fstab.x86 index 6e82de8..fc7127f 100644 --- a/fstab.x86 +++ b/fstab.x86 @@ -9,4 +9,6 @@ none /cache tmpfs nosuid,nodev,noatime defaults /devices/*/80860F*:*/mmc_* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/*/000*:0*:*/000*:0*:*/mmc_* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/*/PNP0FFF:00/mmc_* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata -/dev/block/zram0 none swap defaults zramsize=52%,max_comp_streams=4,swapprio=10,notrim + +share /mnt/vendor/shared virtiofs nosuid,nodev,noatime nofail +share /mnt/vendor/shared 9p trans=virtio,version=9p2000.L,nosuid,nodev,noatime nofail diff --git a/glodroid/BoardConfig_glodroid.mk b/glodroid/BoardConfig_glodroid.mk index 0141f53..b80c314 100644 --- a/glodroid/BoardConfig_glodroid.mk +++ b/glodroid/BoardConfig_glodroid.mk @@ -13,8 +13,8 @@ BCC_PATH := $(patsubst $(CURDIR)/%,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST) BOARD_BUILD_AOSPEXT_MESA3D := true BOARD_MESA3D_SRC_DIR := external/mesa MESON_GEN_LLVM_STUB := true -BOARD_BUILD_AOSPEXT_DAV1D := true -BOARD_DAV1D_SRC_DIR := glodroid/dav1d +#BOARD_BUILD_AOSPEXT_DAV1D := true +#BOARD_DAV1D_SRC_DIR := glodroid/dav1d #BOARD_LIBCAMERA_EXTRA_TARGETS := \ # libetc:libcamera/ipa_ipu3.so:libcamera:ipa_ipu3.so: \ diff --git a/glodroid/device_glodroid.mk b/glodroid/device_glodroid.mk index 2920781..865e80a 100644 --- a/glodroid/device_glodroid.mk +++ b/glodroid/device_glodroid.mk @@ -16,7 +16,7 @@ ifeq ($(BOARD_BUILD_AOSPEXT_LIBCAMERA),true) PRODUCT_PACKAGES += \ ipa_ipu3.so ipa_ipu3.so.sign \ camera.libcamera libcamera libcamera-base libcamera-cam lc-compliance \ - android.hardware.camera.provider@2.5-service_64 libdav1d dav1d \ + android.hardware.camera.provider@2.5-service_64 PRODUCT_PROPERTY_OVERRIDES += ro.hardware.camera=libcamera endif diff --git a/gpu/gpu_mesa.mk b/gpu/gpu_mesa.mk index 81934e8..47ed6fc 100644 --- a/gpu/gpu_mesa.mk +++ b/gpu/gpu_mesa.mk @@ -18,15 +18,14 @@ PRODUCT_PACKAGES := \ modetest \ vulkan.intel \ vulkan.intel_hasvk \ - vulkan.amd \ + vulkan.radeon \ vulkan.virtio \ + vulkan.nouveau \ + vulkan.lvp \ libEGL_angle \ libGLESv1_CM_angle \ libGLESv2_angle \ - libEGL_swiftshader \ - libGLESv2_swiftshader \ - vulkan.pastel \ - vulkan.pastel_legacy \ + vulkan.pastel PRODUCT_PACKAGES += \ libEGL_mesa \ @@ -35,6 +34,7 @@ PRODUCT_PACKAGES += \ libgallium_dri \ libglapi \ libgbm_mesa_wrapper \ + dri_gbm \ i965_drv_video \ crocus_drv_video \ iHD_drv_video \ diff --git a/init.fstab.sh b/init.fstab.sh new file mode 100644 index 0000000..1813867 --- /dev/null +++ b/init.fstab.sh @@ -0,0 +1,33 @@ +# +# Copyright (C) 2024 Shadichy +# +# License: GNU Public License v2 or later +# + +function map_device_link() { + # shellcheck disable=2012,2046 + mknod /dev/block/by-name/"${1#'#>'}" b "$2" "$3" +} + +function init_loop_links() { + mkdir -p /dev/block/by-name + + while read -r line; do + case "$line" in + '#>'*) map_device_link $line ;; + *) ;; + esac + done <"$(ls /fstab.*)" + + ln -s /dev/block/by-name/kernel_a /dev/block/by-name/boot_a + ln -s /dev/block/by-name/kernel_b /dev/block/by-name/boot_b + + ln -s /dev/block/by-name/recovery_a /dev/block/by-name/ramdisk-recovery_a + ln -s /dev/block/by-name/recovery_b /dev/block/by-name/ramdisk-recovery_b + + # Handle for misc symlink specifically + mv /dev/block/by-name/misc /dev/block/by-name/misc-device + ln -s misc-device /dev/block/by-name/misc +} + +init_loop_links diff --git a/init.low_performance.rc b/init.low_performance.rc new file mode 100644 index 0000000..6dfa182 --- /dev/null +++ b/init.low_performance.rc @@ -0,0 +1,30 @@ +on init + setprop ro.config.low_ram true + setprop ro.hw_timeout_multiplier 50 + + # Set lowram options + setprop ro.lmk.critical_upgrade true + setprop ro.lmk.upgrade_pressure 40 + setprop ro.lmk.downgrade_pressure 60 + setprop ro.lmk.kill_heaviest_task false + + # set threshold to filter unused apps + setprop pm.dexopt.downgrade_after_inactive_days 10 + + # set the compiler filter for shared apks to quicken. + # Rationale: speed has a lot of dex code expansion, it uses more ram and space + # compared to quicken. Using quicken for shared APKs on Go devices may save RAM. + # Note that this is a trade-off: here we trade clean pages for dirty pages, + # extra cpu and battery. That's because the quicken files will be jit-ed in all + # the processes that load of shared apk and the code cache is not shared. + # Some notable apps that will be affected by this are gms and chrome. + # b/65591595. + setprop pm.dexopt.shared quicken + + # From build/make/target/board/go_defaults_512.prop + + # lmkd can kill more now. + setprop ro.lmk.medium 700 + + # madvise random in ART to reduce page cache thrashing. + setprop dalvik.vm.madvise-random true diff --git a/init.recovery.sh b/init.recovery.sh new file mode 100644 index 0000000..f4f4ebb --- /dev/null +++ b/init.recovery.sh @@ -0,0 +1,95 @@ +# +# Copyright (C) 2024 BlissLabs +# +# License: GNU Public License v2 or later +# + +function set_property() +{ + setprop "$1" "$2" + [ -n "$DEBUG" ] && echo "$1"="$2" >> /dev/x86.prop +} + +function set_prop_if_empty() +{ + [ -z "$(getprop $1)" ] && set_property "$1" "$2" +} + +function init_misc() +{ + # Tell vold to use ntfs3 driver instead of ntfs-3g + if [ "$USE_NTFS3" -ge "1" ] || [ "$VOLD_USE_NTFS3" -ge 1 ]; then + set_property ro.vold.use_ntfs3 true + fi + + set_property service.adb.tcp.port ${DEBUG_NET_PORT:-5555} +} + +function inir_recovery_device_link() +{ + # Insert /data to recovery.fstab + if grep -E '^\s*[^#].+ /data ' "$(ls /fstab.*)" >> /etc/recovery.fstab; then + set_property sys.recovery.data_is_part true + fi + + # Insert /system into recovery.fstab + if [ "$(getprop ro.boot.slot_suffix)" ]; then + echo "/dev/block/by-name/system /system ext4 defaults slotselect,first_stage_mount" >> /etc/recovery.fstab + else + echo "/dev/block/by-name/system /system ext4 defaults defaults" >> /etc/recovery.fstab + fi + + # Create /dev/block/bootdevice/by-name + # because some scripts are dumb + mkdir -p /dev/block/bootdevice + ln -s /dev/block/by-name /dev/block/bootdevice/by-name +} + +function do_netconsole() +{ + modprobe netconsole netconsole="@/,@$(getprop dhcp.eth0.gateway)/" +} + +function do_init() +{ + init_misc + inir_recovery_device_link +} + +# import cmdline variables +for c in `cat /proc/cmdline`; do + case $c in + BOOT_IMAGE=*|iso-scan/*|*.*=*) + ;; + nomodeset) + HWACCEL=0 + ;; + *=*) + eval $c + if [ -z "$1" ]; then + case $c in + DEBUG=*) + [ -n "$DEBUG" ] && set_property debug.logcat 1 + [ "$DEBUG" = "0" ] || SETUPWIZARD=${SETUPWIZARD:-0} + ;; + DPI=*) + set_property ro.sf.lcd_density "$DPI" + ;; + esac + fi + ;; + esac +done + +[ -n "$DEBUG" ] && set -x || exec &> /dev/null + +case "$1" in + netconsole) + [ -n "$DEBUG" ] && do_netconsole + ;; + init|"") + do_init + ;; +esac + +return 0 diff --git a/init.recovery.x86.rc b/init.recovery.x86.rc new file mode 100644 index 0000000..a5ac475 --- /dev/null +++ b/init.recovery.x86.rc @@ -0,0 +1,23 @@ +on early-init + setprop ro.minui.pixel_format ${ro.boot.pixel_format} + mkdir /mnt/vendor/shared 0770 root root + +service dhcpclient /system/bin/dhcpclient -i ${vendor.recovery.ethernet.dhcp.iface:-eth0} + user root + group root + seclabel u:r:dhcpclient:s0 + oneshot + disabled + +on early-boot + ifup ${vendor.recovery.ethernet.dhcp.iface:-eth0} + start dhcpclient + +on early-fs + exec u:r:init:s0 -- /system/bin/sh /system/etc/init.fstab.sh + +on post-fs + exec u:r:init:s0 -- /system/bin/sh /system/etc/init.recovery.sh + +on property:net.dns1=* + exec u:r:init:s0 -- /system/bin/sh /system/etc/init.recovery.sh netconsole diff --git a/init.sh b/init.sh index e3728c4..2ffb5fc 100644 --- a/init.sh +++ b/init.sh @@ -30,9 +30,17 @@ function init_misc() # in case no cpu governor driver autoloads [ -d /sys/devices/system/cpu/cpu0/cpufreq ] || modprobe acpi-cpufreq - # enable sdcardfs if /data is not mounted on tmpfs or 9p - #mount | grep /data\ | grep -qE 'tmpfs|9p' - #[ $? -eq 0 ] && set_prop_if_empty ro.sys.sdcardfs false + # enable sdcardfs/esdfs if /data is not mounted on tmpfs or 9p + mount | grep /data\ | grep -qE 'tmpfs|9p' + [ $? -eq 0 ] && SDCARDFS_DISABLE=${SDCARDFS_DISABLE:-1} + + # Allow force disable sdcardfs/esdfs + if [ "$SDCARDFS_DISABLE" -ge 1 ]; then + set_property external_storage.sdcardfs.enabled false + set_property persist.sys.fuse.passthrough.enable false + else + set_property persist.sys.fuse.passthrough.enable true + fi # remove wl if it's not used local wifi @@ -57,18 +65,19 @@ function init_misc() #Set CPU name into a property setprop ro.bliss.cpuname "$(grep "model name" /proc/cpuinfo | sort -u | cut -d : -f 2 | cut -c2-)" + + # Tell vold to use ntfs3 driver instead of ntfs-3g + if [ "$USE_NTFS3" -ge "1" ] || [ "$VOLD_USE_NTFS3" -ge 1 ]; then + set_property ro.vold.use_ntfs3 true + fi + + if [ "$DEBUG_VSOCK" -ge "1" ]; then + set_property service.adb.listen_addrs "vsock:5555" + fi } function init_hal_audio() { - ## HACK: if snd_hda_intel cannot be probed, reprobe it - if [ "$( lsmod | grep "snd_hda_intel" )" ]; then - if [ "$( dmesg | grep "couldn't bind with audio component" )" ]; then - rmmod snd_hda_intel - modprobe snd_hda_intel - fi - fi - case "$PRODUCT" in VirtualBox*|Bochs*) [ -d /proc/asound/card0 ] || modprobe snd-sb16 isapnp=0 irq=5 @@ -111,64 +120,146 @@ function init_hal_audio() fi } -function init_hal_audio_bootcomplete() +function init_hal_brcm_wifi() { - if [ "$BOARD" == "Jupiter" ] && [ "$VENDOR" == "Valve" ] - then - alsaucm -c Valve-Jupiter-1 set _verb HiFi +## Function created by Chaozhuo's PhoenixOS +## Currently these devices are supported to use broadcom-wl driver +# Broadcom BCM4313 (PCI ID 14e4:4727) +# Broadcom BCM4321 (PCI IDs 14e4:4328, 14e4:4329, 14e4:432a) +# Broadcom BCM4322 (PCI IDs 14e4:432b, 14e4:432d) +# Broadcom BCM43142 (PCI ID 14e4:4365) +# Broadcom BCM4352 (PCI ID 14e4:43b1) +# Broadcom BCM4360 (PCI IDs 14e4:43a0, 14e4:4360) +## These devices are also on the list, but removed due to the fact that +## b43 or brcm80211 supports it. +## https://wireless.wiki.kernel.org/en/users/drivers/b43 +# Broadcom BCM4311 (PCI IDs 14e4:4311, 14e4:4312) +# Broadcom BCM4312 (PCI ID 14e4:4315) +# Broadcom BCM4322 (PCI IDs 14e4:432c) +# Broadcom BCM43224 (PCI IDs 14e4:0576, 14e4:4353) +# Broadcom BCM43225 (PCI ID 14e4:4357) +# Broadcom BCM43227 (PCI ID 14e4:4358) +# Broadcom BCM43228 (PCI ID 14e4:4359) +# Broadcom BCM4331 (PCI ID 14e4:4331) + + BCMAID=`lspci | grep "14e4" | awk '{print $4}'` + + case "${BCMAID##*:}" in + 4727 | \ + 4328 | 4329 | 432a | \ + 432b | 432d | \ + 4365 | \ + 43b1 | \ + 43a0 | 4360 ) - pcm_card=$(cat /proc/asound/cards | grep acp5x | awk '{print $1}') - # headset microphone on d0, 32bit only - amixer -c ${pcm_card} sset 'Headset Mic',0 on + rmmod b43 + rmmod b44 + rmmod b43legacy + rmmod ssb + rmmod bcma + rmmod brcm80211 + rmmod brcmsmac + rmmod wl - # internal microphone on d0, 32bit only - amixer -c ${pcm_card} sset 'Int Mic',0 on - amixer -c ${pcm_card} sset 'DMIC Enable',0 on + modprobe wl + ;; + *) + ;; + esac +} - # headphone jack on d0, 32bit only - amixer -c ${pcm_card} sset 'Headphone',0 on +function init_hal_audio_bootcomplete() +{ + if [ -e "/data/vendor/asound.state" ]; then + # Initialize once in case a new audio device is plugged in + alsa_ctl init + # Restore /data/vendor/asound.state if found + alsa_ctl restore + else + # Initialize as usual + # 1. Initialize the all the audio cards + alsa_ctl init + + # 2. Restore alsa state for specific cards or turn on all of the + # default controls & set value to max (usually for PCH) + for c in $(grep '\[.*\]' /proc/asound/cards | awk '{print $1}'); do + f=/system/etc/alsa/$(cat /proc/asound/card$c/id).state + d=/data/vendor/alsa/$(cat /proc/asound/card$c/id).state + if [ -e $f ]; then + alsa_ctl -f $f restore $c + elif [ -e $d ]; then + alsa_ctl -f $d restore $c + else + alsa_amixer -c $c set Master on + alsa_amixer -c $c set Master 100% + alsa_amixer -c $c set Headphone on + alsa_amixer -c $c set Headphone 100% + alsa_amixer -c $c set Speaker on + alsa_amixer -c $c set Speaker 100% + alsa_amixer -c $c set Capture 80% + alsa_amixer -c $c set Capture cap + alsa_amixer -c $c set PCM 100% unmute + alsa_amixer -c $c set SPO unmute + alsa_amixer -c $c set IEC958 on + alsa_amixer -c $c set 'Mic Boost' 1 + alsa_amixer -c $c set 'Internal Mic Boost' 1 + + # 2.5. Set alsaucm HiFi verb & devices for specific hardware + for d in $(grep '\[.*\]' /proc/asound/cards | awk '{print $4}'); do + # Check if the card is rt5651, this card can not be able to + # use both Speaker & Headphones at the same time. So we will enable + # only Speaker for this card and tell users to turn Headphones on + # manually if they want to use it. + if [ "$(cat /proc/asound/cards | grep rt5651)" ]; then + card_is_rt5651=true + fi + + case $d in + *bytcht*|*bytcr*|*cht-bsw*|*chtmax*|*chtrt*|*chtnau*) + if [ "$card_is_rt5651" == true ]; then + alsaucm -c $d set _verb HiFi \ + set _enadev Speaker \ + set _enadev Headset \ + set _enadev Mic + else + alsaucm -c $d set _verb HiFi \ + set _enadev Speaker \ + set _enadev Headphones \ + set _enadev Headset \ + set _enadev Mic + fi + ;; + *SOF*) + if [ "$(cat /proc/asound/cards | grep -E 'bytcht|bdw')" ]; then + if [ "$card_is_rt5651" == true ]; then + alsaucm -c $d set _verb HiFi \ + set _enadev Speaker \ + set _enadev Headset \ + set _enadev Mic + else + alsaucm -c $d set _verb HiFi \ + set _enadev Speaker \ + set _enadev Headphones \ + set _enadev Headset \ + set _enadev Mic + fi + fi + ;; + *acp5x*) + alsaucm -c $d set _verb HiFi \ + set _enadev Speaker \ + set _enadev Headphones \ + set _enadev Headset \ + set _enadev Mic + ;; + esac + done + fi + done - # speaker on d1, 16bit only - amixer -c ${pcm_card} sset 'Left DSP RX1 Source',0 ASPRX1 - amixer -c ${pcm_card} sset 'Right DSP RX1 Source',0 ASPRX2 - amixer -c ${pcm_card} sset 'Left DSP RX2 Source',0 ASPRX1 - amixer -c ${pcm_card} sset 'Right DSP RX2 Source',0 ASPRX2 - amixer -c ${pcm_card} sset 'Left DSP1 Preload',0 on - amixer -c ${pcm_card} sset 'Right DSP1 Preload',0 on - - # unmute them all - amixer -c ${pcm_card} sset 'IEC958',0 on - amixer -c ${pcm_card} sset 'IEC958',1 on - amixer -c ${pcm_card} sset 'IEC958',2 on - amixer -c ${pcm_card} sset 'IEC958',3 on + # 3. Store everything into /data/vendor/asound.state + alsa_ctl store fi - -# [ -d /proc/asound/card0 ] || modprobe snd-dummy - for c in $(grep '\[.*\]' /proc/asound/cards | awk '{print $1}'); do - f=/system/etc/alsa/$(cat /proc/asound/card$c/id).state - if [ -e $f ]; then - alsa_ctl -f $f restore $c - else - alsa_ctl init $c - alsa_amixer -c $c set Master on - alsa_amixer -c $c set Master 100% - alsa_amixer -c $c set Headphone on - alsa_amixer -c $c set Headphone 100% - alsa_amixer -c $c set Speaker on - alsa_amixer -c $c set Speaker 100% - alsa_amixer -c $c set Capture 80% - alsa_amixer -c $c set Capture cap - alsa_amixer -c $c set PCM 100% unmute - alsa_amixer -c $c set SPO unmute - alsa_amixer -c $c set IEC958 on - alsa_amixer -c $c set 'Mic Boost' 1 - alsa_amixer -c $c set 'Internal Mic Boost' 1 - fi - d=/data/vendor/alsa/$(cat /proc/asound/card$c/id).state - if [ -e $d ]; then - alsa_ctl -f $d restore $c - fi - done } function init_hal_bluetooth() @@ -214,27 +305,28 @@ function init_hal_bluetooth() start btattach fi - if [ "$BTLINUX_HAL" = "1" ]; then - start btlinux-1.1 - else - start vendor.bluetooth-1-1 +# if [ "$BTLINUX_HAL" = "1" ]; then +# start btlinux-1.1 +# else +# start vendor.bluetooth-1-1 +# fi + + if [ "$BT_BLE_DISABLE" = "1" ]; then + set_property bluetooth.core.le.disabled true + set_property bluetooth.hci.disabled_commands 246 + fi + + if [ "$BT_BLE_NO_VENDORCAPS" = "1" ]; then + set_property bluetooth.core.le.vendor_capabilities.enabled false + set_property persist.sys.bt.max_vendor_cap 0 fi } function init_hal_camera() { - case "$UEVENT" in - *e-tabPro*) - set_prop_if_empty hal.camera.0 0,270 - set_prop_if_empty hal.camera.2 1,90 - ;; - *LenovoideapadD330*) - set_prop_if_empty hal.camera.0 0,90 - set_prop_if_empty hal.camera.2 1,90 - ;; - *) - ;; - esac + if [ "$EMULATED_CAMERA" != "1" ]; then + stop vendor.camera-provider-2-7-google + fi } function init_hal_gps() @@ -276,25 +368,29 @@ function init_hal_gralloc() { case "$(readlink /sys/class/graphics/fb0/device/driver)" in *virtio_gpu|*virtio-pci) - HWC=${HWC:-drm_minigbm_celadon} + HWC=${HWC:-drm_minigbm} GRALLOC=${GRALLOC:-minigbm_arcvm} #video=${video:-1280x768} + set_property ro.vendor.hwc.drm.present_fence_not_reliable true ;& *nouveau) - GRALLOC=${GRALLOC:-gbm_hack} - HWC=${HWC:-drm_celadon} + GRALLOC=${GRALLOC:-minigbm_gbm_mesa} + HWC=${HWC:-drm_minigbm} ;& *i915) if [ "$(cat /sys/kernel/debug/dri/0/i915_capabilities | grep -e 'gen' -e 'graphics version' | awk '{print $NF}')" -gt 9 ]; then HWC=${HWC:-drm_minigbm_celadon} GRALLOC=${GRALLOC:-minigbm} + else + HWC=${HWC:-drm_celadon} + GRALLOC=${GRALLOC:-gbm} fi ;& - *amdgpu) - HWC=${HWC:-drm_minigbm_celadon} + *amdgpu|*vmwgfx*) GRALLOC=${GRALLOC:-minigbm} + HWC=${HWC:-drm_minigbm} ;& - *radeon|*vmwgfx*) + *radeon) if [ "$HWACCEL" != "0" ]; then ${HWC:+set_property ro.hardware.hwcomposer $HWC} set_property ro.hardware.gralloc ${GRALLOC:-gbm} @@ -337,35 +433,38 @@ function init_hal_gralloc() function init_egl() { - if [ "$HWACCEL" != "0" ]; then - if [ "$ANGLE" == "1" ]; then - set_property ro.hardware.egl angle - else - set_property ro.hardware.egl mesa - fi - else - if [ "$ANGLE" == "1" ]; then - set_property ro.hardware.egl angle - else - set_property ro.hardware.egl swiftshader - fi - set_property ro.hardware.vulkan pastel - start vendor.hwcomposer-2-1 + if [ "$HWACCEL" == "0" ] && [ "$MESA_LLVMPIPE" != "1" ]; then + export EGL=${EGL:-angle} + fi + + set_property ro.hardware.egl ${EGL:-mesa} + + if [ "$MESA_LLVMPIPE" -ge "1" ] || [ "$VULKAN" == "lvp" ]; then + set_property mesa.libgl.always.software true + modprobe vgem + fi + + if [ "$MESA_ZINK" -ge "1" ]; then + set_property mesa.loader.driver.override zink fi # Set OpenGLES version case "$FORCE_GLES" in + *2.0*) + set_property ro.opengles.version 131072 + set_property mesa.gles.version.override 2.0 + ;; *3.0*) set_property ro.opengles.version 196608 - export MESA_GLES_VERSION_OVERRIDE=3.0 + set_property mesa.gles.version.override 3.0 ;; *3.1*) set_property ro.opengles.version 196609 - export MESA_GLES_VERSION_OVERRIDE=3.1 + set_property mesa.gles.version.override 3.1 ;; *3.2*) set_property ro.opengles.version 196610 - export MESA_GLES_VERSION_OVERRIDE=3.2 + set_property mesa.gles.version.override 3.2 ;; *) set_property ro.opengles.version 196608 @@ -374,7 +473,7 @@ function init_egl() # Set RenderEngine backend if [ -z ${FORCE_RENDERENGINE+x} ]; then - set_property debug.renderengine.backend threaded + set_property debug.renderengine.backend skiaglthreaded else set_property debug.renderengine.backend $FORCE_RENDERENGINE fi @@ -392,29 +491,33 @@ function init_egl() function init_hal_hwcomposer() { - # TODO - if [ "$HWACCEL" != "0" ]; then - if [ "$HWC" = "default" ]; then - if [ "$HWC_IS_DRMFB" = "1" ]; then - set_property debug.sf.hwc_service_name drmfb - start vendor.hwcomposer-2-1.drmfb - else - set_property debug.sf.hwc_service_name default - start vendor.hwcomposer-2-1 - fi - else + if [ "$HWACCEL" == "0" ] || + [[ "$(readlink /sys/class/graphics/fb0/device/driver)" == *radeon* ]]; then + export HWC_HIDL=${HWC_HIDL:-default-2.1} + fi + + case "$HWC_HIDL" in + drmfb) + set_property debug.sf.hwc_service_name drmfb + start vendor.hwcomposer-2-1.drmfb + ;; + default-2.1) + set_property debug.sf.hwc_service_name default_clone + start vendor.hwcomposer-2-1-clone + ;; + default-2.4|*) set_property debug.sf.hwc_service_name default start vendor.hwcomposer-2-4 + ;; + esac - if [[ "$HWC" == "drm_celadon" || "$HWC" == "drm_minigbm_celadon" ]]; then - set_property vendor.hwcomposer.planes.enabling $MULTI_PLANE - set_property vendor.hwcomposer.planes.num $MULTI_PLANE_NUM - set_property vendor.hwcomposer.preferred.mode.limit $HWC_PREFER_MODE - set_property vendor.hwcomposer.connector.id $CONNECTOR_ID - set_property vendor.hwcomposer.mode.id $MODE_ID - set_property vendor.hwcomposer.connector.multi_refresh_rate $MULTI_REFRESH_RATE - fi - fi + if [[ "$HWC" == "drm_celadon" || "$HWC" == "drm_minigbm_celadon" ]]; then + set_property vendor.hwcomposer.planes.enabling $MULTI_PLANE + set_property vendor.hwcomposer.planes.num $MULTI_PLANE_NUM + set_property vendor.hwcomposer.preferred.mode.limit $HWC_PREFER_MODE + set_property vendor.hwcomposer.connector.id $CONNECTOR_ID + set_property vendor.hwcomposer.mode.id $MODE_ID + set_property vendor.hwcomposer.connector.multi_refresh_rate $MULTI_REFRESH_RATE fi } @@ -488,24 +591,31 @@ function init_hal_media() function init_hal_vulkan() { - case "$(readlink /sys/class/graphics/fb0/device/driver)" in - *i915) - if [ "$(cat /sys/kernel/debug/dri/0/i915_capabilities | grep -e 'gen' -e 'graphics version' | awk '{print $NF}')" -lt 9 ]; then - set_property ro.hardware.vulkan intel_hasvk - else - set_property ro.hardware.vulkan intel - fi - ;; - *amdgpu) - set_property ro.hardware.vulkan amd - ;; - *virtio_gpu) - set_property ro.hardware.vulkan virtio - ;; - *) - set_property ro.hardware.vulkan pastel - ;; - esac + if [ "$HWACCEL" != "0" ]; then + case "$(readlink /sys/class/graphics/fb0/device/driver)" in + *i915) + if [ "$(cat /sys/kernel/debug/dri/0/i915_capabilities | grep -e 'gen' -e 'graphics version' | awk '{print $NF}')" -lt 9 ]; then + VULKAN=${VULKAN:-intel_hasvk} + else + VULKAN=${VULKAN:-intel} + fi + ;& + *amdgpu) + VULKAN=${VULKAN:-radeon} + ;& + *virtio_gpu|*virtio-pci) + VULKAN=${VULKAN:-virtio} + ;& + *nouveau) + VULKAN=${VULKAN:-nouveau} + ;& + *) + set_property ro.hardware.vulkan ${VULKAN:-pastel} + ;; + esac + else + set_property ro.hardware.vulkan ${VULKAN:-pastel} + fi } function init_hal_lights() @@ -536,15 +646,28 @@ function init_hal_power() function init_hal_thermal() { - #thermal-daemon test, pulled from Project Celadon - case "$(cat /sys/class/dmi/id/chassis_vendor | head -1)" in - QEMU) - setprop vendor.thermal.enable 0 - ;; - *) - setprop vendor.thermal.enable 1 - ;; - esac + # Check if thermald needs to be disabled + # 1. VMs (QEMU, VMware, Oracle VirtualBox) + # 2. AMD CPUs + case "$VENDOR" in + *QEMU*|*VMware*) + export THERMALD_DISABLE=${THERMALD_DISABLE:-1} + ;; + *) + ;; + esac + + if [[ "$BOARD" == *VirtualBox* ]]; then + export THERMALD_DISABLE=${THERMALD_DISABLE:-1} + fi + + if grep -q "AuthenticAMD" /proc/cpuinfo; then + export THERMALD_DISABLE=${THERMALD_DISABLE:-1} + fi + + if [ "$THERMALD_DISABLE" -lt 1 ]; then + start thermal-daemon + fi } function init_hal_sensors() @@ -572,7 +695,7 @@ function init_hal_sensors() modprobe lis3lv02d_i2c echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode ;; - *Aspire*SW5-012*) + *Aspire*SW5-012*|*Venue*8*Pro*3845*|*ST70416-6*|*Akoya*P2213T*) set_property ro.iio.accel.order 102 ;; *LenovoideapadD330*) @@ -583,29 +706,16 @@ function init_hal_sensors() set_property ro.iio.accel.x.opt_scale -1 set_property ro.iio.accel.z.opt_scale -1 ;; - *i7Stylus*|*M80TA*) + *i7Stylus*|*SARY*TAB3*) set_property ro.iio.accel.x.opt_scale -1 ;; - *LenovoMIIX320*|*ONDATablet*) + *LenovoMIIX320*|*MIIX510*|*MIIX300-10IBY*|*ONDATablet*| \ + *TECLAST*X4*|*SF133AYR110*|*SolTIVW*) set_property ro.iio.accel.order 102 set_property ro.iio.accel.x.opt_scale -1 set_property ro.iio.accel.y.opt_scale -1 ;; - *Venue*8*Pro*3845*) - set_property ro.iio.accel.order 102 - ;; - *ST70416-6*) - set_property ro.iio.accel.order 102 - ;; - *T*0*TA*|*M80TA*) - set_property ro.iio.accel.y.opt_scale -1 - ;; - *Akoya*P2213T*) - set_property ro.iio.accel.order 102 - ;; - *TECLAST*X4*|*SF133AYR110*) - set_property ro.iio.accel.order 102 - set_property ro.iio.accel.x.opt_scale -1 + *Hi10*plus*|*T*0*TA*|*M80TA*|*TECLAST*X16*) set_property ro.iio.accel.y.opt_scale -1 ;; *TAIFAElimuTab*) @@ -666,32 +776,36 @@ function create_pointercal() chmod 775 /data/misc/tscal chmod 664 /data/misc/tscal/pointercal fi + + # setprop to tell the system to turn on TSCalibrartion + set_property ro.tscal.enable true } function init_tscal() { - case "$UEVENT" in - *ST70416-6*) - modprobe gslx680_ts_acpi - ;& - *T91*|*T101*|*ET2002*|*74499FU*|*945GSE-ITE8712*|*CF-19[CDYFGKLP]*|*TECLAST:rntPAD*) - create_pointercal - return - ;; - *) - ;; - esac - - for usbts in $(lsusb | awk '{ print $6 }'); do - case "$usbts" in - 0596:0001|0eef:0001|14e1:6000|14e1:5000) + if [ "$FORCE_TSCAL" -ge "1" ]; then + create_pointercal + else + case "$UEVENT" in + *T91*|*T101*|*ET2002*|*74499FU*|*945GSE-ITE8712*|*CF-19[CDYFGKLP]*|*TECLAST:rntPAD*) create_pointercal return ;; *) ;; esac - done + + for usbts in $(lsusb | awk '{ print $6 }'); do + case "$usbts" in + 0596:0001|0eef:0001|14e1:6000|14e1:5000) + create_pointercal + return + ;; + *) + ;; + esac + done + fi } function init_ril() @@ -719,21 +833,6 @@ function init_cpu_governor() } } -function set_lowmem() -{ - # 512 MB size in kB : https://source.android.com/devices/tech/perf/low-ram - SIZE_512MB=2048000 - - mem_size=`cat /proc/meminfo | grep MemTotal | tr -s ' ' | cut -d ' ' -f 2` - - if [ "$mem_size" -le "$SIZE_512MB" ] - then - setprop ro.config.low_ram true - else - setprop ro.config.low_ram false - fi -} - function set_custom_ota() { for c in `cat /proc/cmdline`; do @@ -754,30 +853,12 @@ function set_custom_ota() } -function init_loop_links() -{ - mkdir -p /dev/block/by-name - for part in kernel initrd system; do - for suffix in _a _b; do - loop_device=$(losetup -a | grep "$part$suffix" | cut -d ":" -f1) - if [ ! -z "$loop_device" ]; then - ln -s $loop_device /dev/block/by-name/$part$suffix - fi - done - done - loop_device=$(losetup -a | grep misc | cut -d ":" -f1) - ln -s $loop_device /dev/block/by-name/misc - - ln -s /dev/block/by-name/kernel_a /dev/block/by-name/boot_a - ln -s /dev/block/by-name/kernel_b /dev/block/by-name/boot_b -} - function init_prepare_ota() { # If there's slot set, turn on bootctrl # If not, disable the OTA app (in bootcomplete) if [ "$(getprop ro.boot.slot_suffix)" ]; then - start vendor.boot-hal-1-2 + start vendor.boot-hal-1-1 fi } @@ -805,10 +886,10 @@ function set_custom_timezone() function do_init() { init_misc - set_lowmem set_custom_timezone init_hal_audio set_custom_ota + init_hal_brcm_wifi init_hal_bluetooth init_hal_camera init_hal_gps @@ -818,12 +899,10 @@ function do_init() init_hal_vulkan init_hal_lights init_hal_power - init_hal_thermal init_hal_sensors init_hal_surface init_tscal init_ril - init_loop_links init_prepare_ota post_init } @@ -860,6 +939,13 @@ function do_bootcomplete() # initialize audio in bootcomplete init_hal_audio_bootcomplete + # Turn off TSCalibration if property isn't set + if [ "$(getprop ro.tscal.enable)" == "true" ]; then + pm enable org.zeroxlab.util.tscal + else + pm disable org.zeroxlab.util.tscal + fi + # check wifi setup FILE_CHECK=/data/misc/wifi/wpa_supplicant.conf @@ -893,6 +979,7 @@ function do_bootcomplete() pm disable org.lineageos.updater fi + init_hal_thermal post_bootcomplete } @@ -911,6 +998,7 @@ for c in `cat /proc/cmdline`; do ;; nomodeset) HWACCEL=0 + set_property mesa.libgl.always.software true ;; *=*) eval $c @@ -995,6 +1083,9 @@ case "$1" in bootcomplete) do_bootcomplete ;; + kmsg) + dmesg -w > /data/kmsg.txt + ;; init|"") do_init ;; diff --git a/init.x86.rc b/init.x86.rc index 315b25b..4c495c7 100644 --- a/init.x86.rc +++ b/init.x86.rc @@ -1,3 +1,5 @@ +import /vendor/etc/init/hw/init.low_performance.rc + on early-init write /proc/sys/kernel/ctrl-alt-del 1 @@ -14,6 +16,8 @@ on early-init # mapping properties setprop ro.hardware.power ${ro.boot.hardware.power} + symlink /dev/hwrng /dev/hw_random + on early-init && property:mesa.loader.override=* export MESA_LOADER_DRIVER_OVERRIDE ${mesa.loader.override} @@ -23,14 +27,15 @@ on early-init && property:mesa.galliumhud.value=* on early-init && property:mesa.galliumhud.period=* export GALLIUM_HUD_PERIOD ${mesa.galliumhud.period} - write /sys/block/zram0/comp_algorithm zstd - on init write /proc/sys/vm/page-cluster 0 +on early-fs + exec u:r:init:s0 -- /system/bin/logwrapper /system/bin/sh /vendor/etc/init.fstab.sh + on fs + mkdir /mnt/vendor/shared 0770 system system mount_all /fstab.${ro.hardware} - swapon_all /fstab.${ro.hardware} on post-fs exec u:r:init:s0 -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh @@ -99,13 +104,19 @@ service wpa_supplicant /vendor/bin/hw/wpa_supplicant -dd \ interface aidl android.hardware.wifi.supplicant.ISupplicant/default class main socket wpa_wlan0 dgram 660 wifi wifi + user root disabled oneshot service logcat /system/bin/logcat -b all -v threadtime -f /data/log.txt + user root + class debug + +service kmsg_fetch /system/bin/sh /system/etc/init.sh kmsg + user root class debug -service thermal-daemon /system/vendor/bin/thermal-daemon --config-file /system/vendor/etc/thermal-daemon/thermal-conf.xml --ignore-cpuid-check +service thermal-daemon /vendor/bin/thermal-daemon --adaptive class main user system group system @@ -113,31 +124,43 @@ service thermal-daemon /system/vendor/bin/thermal-daemon --config-file /system/v service btattach /system/vendor/bin/btattach class main + user root disabled oneshot seclabel u:r:bluetooth:s0 service wacom-input /system/bin/wacom-input + user root disabled oneshot seclabel u:r:inputflinger:s0 service tablet-mode /system/bin/tablet-mode + user root disabled oneshot seclabel u:r:inputflinger:s0 service ctrl-alt-del /system/bin/input keyevent --longpress POWER + user root disabled oneshot keycodes 97 100 111 seclabel u:r:init:s0 -service iptsd_runner /system/vendor/bin/iptsd_runner +service iptsd_runner /vendor/bin/iptsd_runner + user root class main disabled seclabel u:r:zygote:s0 +service zram_setup /vendor/bin/sh /vendor/etc/init.zram.sh + class late_start + user root + group root system wakelock graphics + disabled + oneshot + on property:system_init.startsurfaceflinger=0 # disable cursor blinking write /dev/tty0 "[?17;0;0c" @@ -145,6 +168,7 @@ on property:system_init.startsurfaceflinger=0 stop console on property:sys.boot_completed=1 + start zram_setup write /proc/sys/kernel/ctrl-alt-del 0 exec u:r:init:s0 -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh bootcomplete @@ -153,6 +177,3 @@ on property:net.dns1=* on property:debug.logcat=1 class_start debug - -on property:sys.boot_completed=1 && property:vendor.thermal.enable=1 - start thermal-daemon diff --git a/init.zram.sh b/init.zram.sh new file mode 100755 index 0000000..98976c0 --- /dev/null +++ b/init.zram.sh @@ -0,0 +1,101 @@ +#!/vendor/bin/sh + +# Copyright (c) 2012-2013, 2016-2021, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of The Linux Foundation nor +# the names of its contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +function configure_zram_parameters() { + MemTotalStr=`cat /proc/meminfo | grep MemTotal` + MemTotal=${MemTotalStr:16:8} + + low_ram=`getprop ro.config.low_ram` + + # Zram disk - 75% for Go devices. + # For 512MB Go device, size = 384MB, set same for Non-Go. + # For 1GB Go device, size = 768MB, set same for Non-Go. + # For 2GB Go device, size = 1536MB, set same for Non-Go. + # For >2GB Non-Go devices, size = 50% of RAM size. + # For >8GB Non-Go device, size = 25% of RAM size. + # For Non-Go, Limit the size to 4GB if not x86_64. + # And enable lz4 zram compression for Go targets. + + let RamSizeGB="( $MemTotal / 1048576 ) + 1" + diskSizeUnit=M + if [ $RamSizeGB -le 2 ]; then + let zRamSizeMB="( $RamSizeGB * 1024 ) * 3 / 4" + else + let zRamSizeMB="( $RamSizeGB * 1024 ) / 2" + fi + + if [ $RamSizeGB -gt 8 ]; then + let zRamSizeMB="( $RamSizeGB * 1024 ) / 4" + fi + + # use MB avoid 32 bit overflow if not x86_64 + if [ "$(uname -m)" != "x86_64" ] && [ $zRamSizeMB -gt 4096 ]; then + let zRamSizeMB=4096 + fi + + if [ "$low_ram" == "true" ]; then + echo lz4 > /sys/block/zram0/comp_algorithm + fi + + if [ -f /sys/block/zram0/disksize ]; then + if [ -f /sys/block/zram0/use_dedup ]; then + echo 1 > /sys/block/zram0/use_dedup + fi + echo "$zRamSizeMB""$diskSizeUnit" > /sys/block/zram0/disksize + + # ZRAM may use more memory than it saves if SLAB_STORE_USER + # debug option is enabled. + if [ -e /sys/kernel/slab/zs_handle ]; then + echo 0 > /sys/kernel/slab/zs_handle/store_user + fi + if [ -e /sys/kernel/slab/zspage ]; then + echo 0 > /sys/kernel/slab/zspage/store_user + fi + + mkswap /dev/block/zram0 + swapon /dev/block/zram0 -p 32758 + fi + + # Set swappiness + echo 80 > /proc/sys/vm/swappiness +} + +# import cmdline variables +for c in `cat /proc/cmdline`; do + case $c in + *=*) + eval $c + ;; + esac +done + +# Disable ZRAM if wanted +if [ "$DISABLE_ZRAM" != "1" ]; then + configure_zram_parameters +fi diff --git a/iptsd b/iptsd index 67d0b77..846c641 160000 --- a/iptsd +++ b/iptsd @@ -1 +1 @@ -Subproject commit 67d0b77ef2037ed3fc9471469b6f709a52f4a8c6 +Subproject commit 846c641f63c8a4019f2873d3c414cd83c9eed974 diff --git a/libinit/Android.bp b/libinit/Android.bp new file mode 100644 index 0000000..3cf1407 --- /dev/null +++ b/libinit/Android.bp @@ -0,0 +1,24 @@ +// +// Copyright (C) 2021 The LineageOS Project +// +// SPDX-License-Identifier: Apache-2.0 +// + +cc_library_static { + name: "libinit_x86", + srcs: [ + "libinit_dalvik_heap.cpp", + "libinit_utils.cpp", + ], + whole_static_libs: ["libbase"], + export_include_dirs: ["include"], + recovery_available: true, +} + +cc_library_static { + name: "init_x86", + srcs: ["init_x86.cpp"], + whole_static_libs: ["libinit_x86"], + include_dirs: ["system/core/init"], + recovery_available: true, +} diff --git a/libinit/include/libinit_dalvik_heap.h b/libinit/include/libinit_dalvik_heap.h new file mode 100644 index 0000000..75144b2 --- /dev/null +++ b/libinit/include/libinit_dalvik_heap.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef LIBINIT_DALVIK_HEAP_H +#define LIBINIT_DALVIK_HEAP_H + +#include + +typedef struct dalvik_heap_info { + std::string heapstartsize; + std::string heapgrowthlimit; + std::string heapsize; + std::string heapminfree; + std::string heapmaxfree; + std::string heaptargetutilization; +} dalvik_heap_info_t; + +void set_dalvik_heap(void); + +#endif // LIBINIT_DALVIK_HEAP_H diff --git a/libinit/include/libinit_utils.h b/libinit/include/libinit_utils.h new file mode 100644 index 0000000..ac2d673 --- /dev/null +++ b/libinit/include/libinit_utils.h @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef LIBINIT_UTILS_H +#define LIBINIT_UTILS_H + +#include + +void property_override(std::string prop, std::string value, bool add = true); + +void set_ro_build_prop(const std::string &prop, const std::string &value, bool product = false); + +#endif // LIBINIT_UTILS_H diff --git a/libinit/init_x86.cpp b/libinit/init_x86.cpp new file mode 100644 index 0000000..1bfb1de --- /dev/null +++ b/libinit/init_x86.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#include +#include + +#include "vendor_init.h" + +#include + +using android::base::GetProperty; +using android::base::ReadFileToString; + +static const std::string kDmiIdPath = "/sys/devices/virtual/dmi/id/"; + +static const std::unordered_map kDmiIdToPropertyMap = { + {"bios_version", "ro.boot.bootloader"}, + {"product_serial", "ro.bliss.serialnumber"}, + {"board_name", "ro.product.board"}, +}; + +static const std::unordered_map kDmiIdToRoBuildPropMap = { + {"product_name", "name"}, + {"chassis_vendor", "brand"}, + {"board_name", "model"}, + {"sys_vendor", "manufacturer"}, +}; + +static const std::unordered_map kLenovoDmiIdToRoBuildPropMap = { + {"product_family", "name"}, + {"chassis_vendor", "brand"}, + {"board_name", "model"}, + {"sys_vendor", "manufacturer"}, +}; + +static bool is_lenovo() { + std::string value; + if (ReadFileToString(kDmiIdPath + "sys_vendor", &value)) { + value.pop_back(); + return value == "Lenovo" || value == "LENOVO"; + } + return false; +} + +static void set_misc_properties() { + if (GetProperty("ro.boot.insecure_adb", "") == "1") { + property_override("ro.adb.secure", "0"); + property_override("ro.secure", "0"); + } +} + +static void set_properties_from_dmi_id() { + std::string value; + + for (const auto& [file, prop] : kDmiIdToPropertyMap) { + ReadFileToString(kDmiIdPath + file, &value); + if (value.empty()) + continue; + value.pop_back(); + property_override(prop, value); + } + + if (is_lenovo()) { + for (const auto& [file, ro_build_prop] : kLenovoDmiIdToRoBuildPropMap) { + ReadFileToString(kDmiIdPath + file, &value); + if (value.empty()) + continue; + value.pop_back(); + set_ro_build_prop(ro_build_prop, value, true); + } + return; + } + + for (const auto& [file, ro_build_prop] : kDmiIdToRoBuildPropMap) { + ReadFileToString(kDmiIdPath + file, &value); + if (value.empty()) + continue; + value.pop_back(); + set_ro_build_prop(ro_build_prop, value, true); + } +} + +void vendor_load_properties() { + set_dalvik_heap(); + set_misc_properties(); + set_properties_from_dmi_id(); +} diff --git a/libinit/libinit_dalvik_heap.cpp b/libinit/libinit_dalvik_heap.cpp new file mode 100644 index 0000000..61f091e --- /dev/null +++ b/libinit/libinit_dalvik_heap.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include + +#define HEAPSTARTSIZE_PROP "dalvik.vm.heapstartsize" +#define HEAPGROWTHLIMIT_PROP "dalvik.vm.heapgrowthlimit" +#define HEAPSIZE_PROP "dalvik.vm.heapsize" +#define HEAPMINFREE_PROP "dalvik.vm.heapminfree" +#define HEAPMAXFREE_PROP "dalvik.vm.heapmaxfree" +#define HEAPTARGETUTILIZATION_PROP "dalvik.vm.heaptargetutilization" + +#define GB(b) (b * 1024ull * 1024 * 1024) + +static const dalvik_heap_info_t dalvik_heap_info_16384 = { + .heapstartsize = "32m", + .heapgrowthlimit = "448m", + .heapsize = "640m", + .heapminfree = "16m", + .heapmaxfree = "64m", + .heaptargetutilization = "0.4", +}; + +static const dalvik_heap_info_t dalvik_heap_info_12288 = { + .heapstartsize = "24m", + .heapgrowthlimit = "384m", + .heapsize = "512m", + .heapminfree = "8m", + .heapmaxfree = "56m", + .heaptargetutilization = "0.42", +}; + +static const dalvik_heap_info_t dalvik_heap_info_8192 = { + .heapstartsize = "24m", + .heapgrowthlimit = "256m", + .heapsize = "512m", + .heapminfree = "8m", + .heapmaxfree = "48m", + .heaptargetutilization = "0.46", +}; + +static const dalvik_heap_info_t dalvik_heap_info_6144 = { + .heapstartsize = "16m", + .heapgrowthlimit = "256m", + .heapsize = "512m", + .heapminfree = "8m", + .heapmaxfree = "32m", + .heaptargetutilization = "0.5", +}; + +static const dalvik_heap_info_t dalvik_heap_info_4096 = { + .heapstartsize = "8m", + .heapgrowthlimit = "256m", + .heapsize = "512m", + .heapminfree = "8m", + .heapmaxfree = "16m", + .heaptargetutilization = "0.6", +}; + +static const dalvik_heap_info_t dalvik_heap_info_2048 = { + .heapstartsize = "8m", + .heapgrowthlimit = "128m", + .heapsize = "256m", + .heapminfree = "512k", + .heapmaxfree = "8m", + .heaptargetutilization = "0.75", +}; + +static const dalvik_heap_info_t dalvik_heap_info_1024 = { + .heapstartsize = "8m", + .heapgrowthlimit = "96m", + .heapsize = "256m", + .heapminfree = "512k", + .heapmaxfree = "8m", + .heaptargetutilization = "0.75", +}; + +void set_dalvik_heap() { + struct sysinfo sys; + const dalvik_heap_info_t *dhi; + + sysinfo(&sys); + + int heap_select = (sys.totalram > GB(15)) ? 8 : + (sys.totalram > GB(11)) ? 7 : + (sys.totalram > GB(7)) ? 6 : + (sys.totalram > GB(5)) ? 5 : + (sys.totalram > GB(3)) ? 4 : + (sys.totalram > GB(1.3)) ? 3 : 2; + + switch (heap_select) { + case 8: + dhi = &dalvik_heap_info_16384; + break; + case 7: + dhi = &dalvik_heap_info_12288; + break; + case 6: + dhi = &dalvik_heap_info_8192; + break; + case 5: + dhi = &dalvik_heap_info_6144; + break; + case 4: + dhi = &dalvik_heap_info_4096; + break; + case 3: + dhi = &dalvik_heap_info_2048; + break; + default: + dhi = &dalvik_heap_info_1024; + break; + } + + property_override(HEAPSTARTSIZE_PROP, dhi->heapstartsize); + property_override(HEAPGROWTHLIMIT_PROP, dhi->heapgrowthlimit); + property_override(HEAPSIZE_PROP, dhi->heapsize); + property_override(HEAPTARGETUTILIZATION_PROP, dhi->heaptargetutilization); + property_override(HEAPMINFREE_PROP, dhi->heapminfree); + property_override(HEAPMAXFREE_PROP, dhi->heapmaxfree); +} diff --git a/libinit/libinit_utils.cpp b/libinit/libinit_utils.cpp new file mode 100644 index 0000000..da04145 --- /dev/null +++ b/libinit/libinit_utils.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include +#include + +#include + +void property_override(std::string prop, std::string value, bool add) { + auto pi = (prop_info *) __system_property_find(prop.c_str()); + if (pi != nullptr) { + __system_property_update(pi, value.c_str(), value.length()); + } else if (add) { + __system_property_add(prop.c_str(), prop.length(), value.c_str(), value.length()); + } +} + +std::vector ro_props_default_source_order = { + "bliss.", + "odm.", + "odm_dlkm.", + "product.", + "system.", + "system_ext.", + "vendor.", + "vendor_dlkm.", + "", +}; + +void set_ro_build_prop(const std::string &prop, const std::string &value, bool product) { + std::string prop_name; + + for (const auto &source : ro_props_default_source_order) { + if (product) + prop_name = "ro.product." + source + prop; + else + prop_name = "ro." + source + "build." + prop; + + property_override(prop_name, value, true); + } +} diff --git a/librecovery_ui/Android.bp b/librecovery_ui/Android.bp new file mode 100644 index 0000000..ac1248c --- /dev/null +++ b/librecovery_ui/Android.bp @@ -0,0 +1,37 @@ +// +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library { + name: "librecovery_ui_x86", + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + "-pedantic", + ], + srcs: [ + "recovery_ui.cpp", + ], + + shared_libs: [ + "libbase", + "librecovery_ui", + ], +} diff --git a/librecovery_ui/recovery_ui.cpp b/librecovery_ui/recovery_ui.cpp new file mode 100644 index 0000000..f8b5b46 --- /dev/null +++ b/librecovery_ui/recovery_ui.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +class x86RecoveryUI : public EthernetRecoveryUI { + public: + bool IsUsbConnected() override { + return true; + } +}; + +Device* make_device() { + std::string eth_device = android::base::GetProperty("vendor.recovery.ethernet.dhcp.iface", "eth0"); + return new EthernetDevice(new x86RecoveryUI, eth_device); +} diff --git a/manifest.xml b/manifest.xml index fe7ba5a..1d5299e 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,4 +1,4 @@ - + android.hardware.audio hwbinder @@ -26,15 +26,6 @@ default - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - android.hardware.camera.provider hwbinder @@ -46,24 +37,6 @@ legacy/0 - - android.hardware.configstore - hwbinder - 1.1 - - ISurfaceFlingerConfigs - default - - - - android.hardware.dumpstate - hwbinder - 1.0 - - IDumpstateDevice - default - - android.hardware.graphics.allocator hwbinder @@ -74,7 +47,7 @@ android.hardware.graphics.composer hwbinder @2.1::IComposer/drmfb - @2.1::IComposer/default + @2.1::IComposer/default_clone @2.4::IComposer/default @@ -83,46 +56,6 @@ @2.0::IMapper/default @4.0::IMapper/default - - android.hardware.light - hwbinder - 2.0 - - ILight - default - - - - android.hardware.memtrack - hwbinder - 1.0 - - IMemtrack - default - - - - android.hardware.media.omx - hwbinder - 1.0 - - IOmx - default - - - IOmxStore - default - - - - android.hardware.power - hwbinder - 1.0 - - IPower - default - - android.hardware.renderscript passthrough @@ -150,14 +83,6 @@ default - - android.hardware.drm - hwbinder - @1.4::ICryptoFactory/clearkey - @1.4::ICryptoFactory/widevine - @1.4::IDrmFactory/clearkey - @1.4::IDrmFactory/widevine - android.hardware.gnss hwbinder diff --git a/manifest_framework.xml b/manifest_framework.xml new file mode 100644 index 0000000..d1761ef --- /dev/null +++ b/manifest_framework.xml @@ -0,0 +1,37 @@ + + + android.hardware.media.c2 + hwbinder + 1.2 + + IComponentStore + ffmpeg + + + + android.hardware.graphics.composer + hwbinder + 2.1 + + IComposer + drmfb + + + + android.hardware.graphics.composer + hwbinder + 2.1 + + IComposer + default_clone + + + + android.hardware.media.c2 + 1 + + IComponentStore + ffmpeg + + + diff --git a/manifest_omx.xml b/manifest_omx.xml new file mode 100644 index 0000000..a771d0b --- /dev/null +++ b/manifest_omx.xml @@ -0,0 +1,15 @@ + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + + diff --git a/modules.blocklist b/modules.blocklist index e135b23..0db0a33 100644 --- a/modules.blocklist +++ b/modules.blocklist @@ -2,6 +2,8 @@ blocklist evbug deferred nouveau deferred amdgpu deferred radeon +deferred snd_hda_intel +deferred soc_button_array blocklist rtw88_8821cu blocklist rtw88_8822bu blocklist rtw88_8822cu diff --git a/overlay-go/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay-go/frameworks/base/packages/SettingsProvider/res/values/defaults.xml new file mode 100644 index 0000000..989409d --- /dev/null +++ b/overlay-go/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -0,0 +1,22 @@ + + + + 50% + 50% + diff --git a/permissions/privapp-permissions-com.xda.nobar.xml b/overlay/packages/apps/Settings/res/values/bliss_config.xml similarity index 66% rename from permissions/privapp-permissions-com.xda.nobar.xml rename to overlay/packages/apps/Settings/res/values/bliss_config.xml index f5b058f..884250b 100644 --- a/permissions/privapp-permissions-com.xda.nobar.xml +++ b/overlay/packages/apps/Settings/res/values/bliss_config.xml @@ -1,24 +1,19 @@ - - - - - - - - - - + + + true + diff --git a/permissions/privapp-permissions-com.android.launcher3.xml b/overlay/packages/apps/Settings/res/values/config.xml similarity index 59% rename from permissions/privapp-permissions-com.android.launcher3.xml rename to overlay/packages/apps/Settings/res/values/config.xml index 9ed1424..884250b 100644 --- a/permissions/privapp-permissions-com.android.launcher3.xml +++ b/overlay/packages/apps/Settings/res/values/config.xml @@ -1,25 +1,19 @@ - - - - - - - - - - - + + + true + diff --git a/packages.mk b/packages.mk index fcf2f86..1c2d962 100644 --- a/packages.mk +++ b/packages.mk @@ -29,7 +29,6 @@ PRODUCT_PACKAGES := \ io_switch \ libGLES_android \ libhuaweigeneric-ril \ - lights.default \ make_ext4fs \ parted \ rtk_hciattach \ @@ -64,7 +63,6 @@ PRODUCT_PACKAGES += \ wpa_supplicant.conf \ PRODUCT_PACKAGES += \ - badblocks \ e2fsck \ fsck.exfat \ fsck.f2fs \ @@ -95,7 +93,6 @@ PRODUCT_PACKAGES += \ # Third party apps PRODUCT_PACKAGES += \ Eleven \ - TSCalibration2 \ native_bridge_stub_library_defaults \ libnativebridge-headers \ libnativeloader-headers \ @@ -120,9 +117,6 @@ PRODUCT_PACKAGES_DEBUG := \ mcaptest \ rctest \ -PRODUCT_HOST_PACKAGES := \ - qemu-android \ - # # Packages for AOSP-available stuff we use from the framework # @@ -136,19 +130,13 @@ PRODUCT_PACKAGES += \ iw_common \ external_iw_license -# aptX/aptX HD encoders -PRODUCT_PACKAGES += \ - libaptX_encoder \ - libaptXHD_encoder - ## Enable hidden features on Android PRODUCT_PACKAGES += \ pc.xml \ - hpe.xml \ - device.prop - + hpe.xml + # Some additional CLI programs -PRODUCT_PACKAGES += tput dialog alsa-info.sh tree lspci dmidecode +PRODUCT_PACKAGES += tput dialog alsa-info.sh tree lspci dmidecode vainfo evtest efibootmgr # Surface specific ifeq ($(BOARD_IS_SURFACE_BUILD),true) @@ -159,3 +147,11 @@ PRODUCT_PACKAGES += iptsd_runner iptsd \ iptsd-dump \ iptsd-perf endif + +# For Recovery +## DHCP client +PRODUCT_PACKAGES += \ + x86_dhcpclient.recovery + +# A small script to inherit paths +PRODUCT_PACKAGES += blisspath diff --git a/pciids b/pciids index 3f3f331..4756a2f 160000 --- a/pciids +++ b/pciids @@ -1 +1 @@ -Subproject commit 3f3f3313a31957066a50b7e6f2edd3ea7a757b55 +Subproject commit 4756a2fe9e6d8555e765236a9be5c6d778954780 diff --git a/permissions/GoogleExtServices_permissions.xml b/permissions/GoogleExtServices_permissions.xml deleted file mode 100644 index 5f7fe2a..0000000 --- a/permissions/GoogleExtServices_permissions.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/permissions/privapp-permissions-com.farmerbb.taskbar.support.xml b/permissions/privapp-permissions-com.farmerbb.taskbar.support.xml deleted file mode 100644 index fcbd3d9..0000000 --- a/permissions/privapp-permissions-com.farmerbb.taskbar.support.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/permissions/privapp-permissions-com.farmerbb.taskbar.xml b/permissions/privapp-permissions-com.farmerbb.taskbar.xml deleted file mode 100644 index 676a37d..0000000 --- a/permissions/privapp-permissions-com.farmerbb.taskbar.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/permissions/privapp-permissions-com.fb.fluid.xml b/permissions/privapp-permissions-com.fb.fluid.xml deleted file mode 100644 index 40891eb..0000000 --- a/permissions/privapp-permissions-com.fb.fluid.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/permissions/privapp-permissions-com.google.android.webview.xml b/permissions/privapp-permissions-com.google.android.webview.xml deleted file mode 100644 index c1a0e84..0000000 --- a/permissions/privapp-permissions-com.google.android.webview.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - diff --git a/permissions/privapp-permissions-google.xml b/permissions/privapp-permissions-google.xml deleted file mode 100644 index 3c3b4d7..0000000 --- a/permissions/privapp-permissions-google.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/permissions_product/com.android.angle.xml b/permissions_product/com.android.angle.xml deleted file mode 100644 index 6766099..0000000 --- a/permissions_product/com.android.angle.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/system.prop b/properties/system.prop similarity index 100% rename from system.prop rename to properties/system.prop diff --git a/properties/vendor.prop b/properties/vendor.prop new file mode 100644 index 0000000..043af86 --- /dev/null +++ b/properties/vendor.prop @@ -0,0 +1,8 @@ +# DHCP +vendor.recovery.dhcpclient.iface?=eth0 + +# Display +ro.surface_flinger.enable_frame_rate_override=false + +# Recovery +ro.recovery.supported_fs=9p,virtiofs diff --git a/props/Android.mk b/props/Android.mk deleted file mode 100644 index 4d35cfb..0000000 --- a/props/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (C) 2022 BlissLabs -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := device.prop -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_TAGS := optional -LOCAL_PROPRIETARY_MODULE := true -LOCAL_SRC_FILES := device.prop -include $(BUILD_PREBUILT) diff --git a/props/device.prop b/props/device.prop deleted file mode 100644 index c834ec3..0000000 --- a/props/device.prop +++ /dev/null @@ -1,5 +0,0 @@ -ro.product.bliss.brand= -ro.product.bliss.device= -ro.product.bliss.manufacturer= -ro.product.bliss.model= -ro.product.bliss.name= diff --git a/props/vendor.prop b/props/vendor.prop deleted file mode 100644 index 5601818..0000000 --- a/props/vendor.prop +++ /dev/null @@ -1 +0,0 @@ -import /system/vendor/etc/device.prop diff --git a/recovery.fstab b/recovery.fstab new file mode 100644 index 0000000..8057662 --- /dev/null +++ b/recovery.fstab @@ -0,0 +1,17 @@ +/dev/block/by-name/misc /misc emmc defaults defaults + +/devices/*/block/sr* auto auto defaults voldmanaged=cdrom:auto +/devices/*/usb*/* auto auto defaults voldmanaged=usb:auto,noemulatedsd +/devices/*/mmc0:a*/* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*/*sdmmc*/* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*/80860F*:*/mmc_* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*/000*:0*:*/000*:0*:*/mmc_* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*/PNP0FFF:00/mmc_* auto auto defaults voldmanaged=usb:auto,encryptable=userdata +/devices/*/*/sd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usb:auto,noemulatedsd +/devices/*/*/hd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usb:auto,noemulatedsd +/devices/*/*/vd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usb:auto,noemulatedsd +/devices/*/*/nvme* auto auto defaults,uid=1000,gid=1000 voldmanaged=usb:auto,noemulatedsd +/devices/*/*/xvd* auto auto defaults,uid=1000,gid=1000 voldmanaged=usb:auto,noemulatedsd + +share /mnt/vendor/shared virtiofs nosuid,nodev,noatime nofail +share /mnt/vendor/shared 9p trans=virtio,version=9p2000.L,nosuid,nodev,noatime nofail diff --git a/scripts/Android.mk b/scripts/Android.mk new file mode 100644 index 0000000..995d261 --- /dev/null +++ b/scripts/Android.mk @@ -0,0 +1,7 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := blisspath +LOCAL_MODULE_CLASS := EXECUTABLES +LOCAL_SRC_FILES := blisspath +include $(BUILD_PREBUILT) diff --git a/scripts/blisspath b/scripts/blisspath new file mode 100644 index 0000000..16a5fc5 --- /dev/null +++ b/scripts/blisspath @@ -0,0 +1,4 @@ +#!/system/bin/sh + +export PATH="${PATH}:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin" +exec "$SHELL" diff --git a/seccomp/mediaswcodec.policy b/seccomp/mediaswcodec.policy index ab24ef7..f4f663a 100644 --- a/seccomp/mediaswcodec.policy +++ b/seccomp/mediaswcodec.policy @@ -1,2 +1,5 @@ #for minigbm_gbm_mesa -sched_getaffinity: 1 \ No newline at end of file +sched_getaffinity: 1 + +#for hbm +mkdirat: 1 diff --git a/sepolicy/plat_private/file.te b/sepolicy/plat_private/file.te index ba8f2c8..f6c462c 100644 --- a/sepolicy/plat_private/file.te +++ b/sepolicy/plat_private/file.te @@ -1 +1,2 @@ -type grub_file, file_type; +type bootdir_file, file_type; +type esp_file, file_type; diff --git a/sepolicy/plat_private/file_contexts b/sepolicy/plat_private/file_contexts index 13e9d97..91a9c70 100644 --- a/sepolicy/plat_private/file_contexts +++ b/sepolicy/plat_private/file_contexts @@ -3,6 +3,9 @@ /dev/tty0 u:object_r:gpu_device:s0 /vendor/lib{64}?/libgbm_mesa_wrapper.so u:object_r:same_process_hal_file:s0 /vendor/bin/hw/android\.hardware\.graphics\.allocator@4\.0-service\.minigbm_gbm_mesa u:object_r:hal_graphics_allocator_default_exec:s0 +/(vendor|system/vendor)/lib(64)?/libgallium_dri\.so u:object_r:same_process_hal_file:s0 +/vendor/bin/hw/android\.hardware\.graphics\.composer@2\.1-service-clone u:object_r:hal_graphics_composer_default_exec:s0 # Files in rootfs -/grub(/.*)? u:object_r:grub_file:s0 +/boot(/.*)? u:object_r:bootdir_file:s0 +/boot/efi(/.*)? u:object_r:esp_file:s0 diff --git a/sepolicy/plat_private/genfs_contexts b/sepolicy/plat_private/genfs_contexts new file mode 100644 index 0000000..3d0ace5 --- /dev/null +++ b/sepolicy/plat_private/genfs_contexts @@ -0,0 +1,2 @@ +genfscon virtiofs / u:object_r:virtiofs:s0 +genfscon ntfs3 / u:object_r:ntfs3:s0 diff --git a/sepolicy/public/file.te b/sepolicy/public/file.te new file mode 100644 index 0000000..ee8d61e --- /dev/null +++ b/sepolicy/public/file.te @@ -0,0 +1,2 @@ +type virtiofs, sdcard_type, fs_type, mlstrustedobject; +type ntfs3, sdcard_type, fs_type, mlstrustedobject; diff --git a/sepolicy/vendor/cameraserver.te b/sepolicy/vendor/cameraserver.te new file mode 100644 index 0000000..148afac --- /dev/null +++ b/sepolicy/vendor/cameraserver.te @@ -0,0 +1,3 @@ +allow cameraserver system_file:dir { open read }; +allow cameraserver hal_allocator:fd use; +allow cameraserver gpu_device:chr_file { open read write ioctl }; diff --git a/sepolicy/vendor/dhcpclient.te b/sepolicy/vendor/dhcpclient.te new file mode 100644 index 0000000..8bdaef0 --- /dev/null +++ b/sepolicy/vendor/dhcpclient.te @@ -0,0 +1,25 @@ +# DHCP client +type dhcpclient, domain; +type dhcpclient_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(dhcpclient) +net_domain(dhcpclient) + +allow dhcpclient self:capability { net_admin net_raw sys_module }; +allow dhcpclient self:netlink_route_socket { ioctl write nlmsg_write }; +#allow dhcpclient varrun_file:dir search; +allow dhcpclient self:packet_socket { create bind write read }; +allowxperm dhcpclient self:netlink_route_socket ioctl { SIOCGIFFLAGS + SIOCSIFFLAGS + SIOCSIFMTU + SIOCGIFINDEX + SIOCGIFHWADDR }; + +set_prop(dhcpclient, vendor_net_prop); + +recovery_only(` + domain_trans(init, rootfs, dhcpclient) + + dontaudit dhcpclient rootfs:dir read; + dontaudit dhcpclient vendor_default_prop:property_service set; +') diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te new file mode 100644 index 0000000..207b1ed --- /dev/null +++ b/sepolicy/vendor/file.te @@ -0,0 +1,2 @@ +# DMI +type vendor_sysfs_dmi_id, fs_type, sysfs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts new file mode 100644 index 0000000..259ff94 --- /dev/null +++ b/sepolicy/vendor/file_contexts @@ -0,0 +1 @@ +/(vendor|system/vendor)/bin/hw/android\.hardware\.camera\.provider@2\.7-service-google u:object_r:hal_camera_default_exec:s0 diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts new file mode 100644 index 0000000..f3ca64a --- /dev/null +++ b/sepolicy/vendor/genfs_contexts @@ -0,0 +1,2 @@ +# DMI +genfscon sysfs /devices/virtual/dmi/id u:object_r:vendor_sysfs_dmi_id:s0 diff --git a/sepolicy/vendor/hal_camera_default.te b/sepolicy/vendor/hal_camera_default.te new file mode 100644 index 0000000..d433214 --- /dev/null +++ b/sepolicy/vendor/hal_camera_default.te @@ -0,0 +1,12 @@ +vndbinder_use(hal_camera_default); +allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find; +hal_client_domain(hal_camera_default, hal_graphics_allocator); +hal_client_domain(hal_camera_default, hal_graphics_composer); + +# For camera hal to talk with sensor service +binder_call(hal_camera_default, sensor_service_server) +binder_call(sensor_service_server, hal_camera_default) +allow hal_camera_default self:vsock_socket create_socket_perms_no_ioctl; + +# camera hal with minigbm +allow hal_camera_default gpu_device:chr_file { open read write ioctl map }; diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te new file mode 100644 index 0000000..18cb879 --- /dev/null +++ b/sepolicy/vendor/init.te @@ -0,0 +1,12 @@ +# DHCP +recovery_only(` + get_prop(init, vendor_recovery_ethernet_dhcp_prop) + set_prop(init, vendor_recovery_ethernet_dhcp_prop) +') + +# Mount +## permit mount of virtiofs on /mnt/vendor/shared +allow init mnt_vendor_file:dir mounton; + +# DMI +r_dir_file(init, vendor_sysfs_dmi_id) diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te new file mode 100644 index 0000000..e6235e9 --- /dev/null +++ b/sepolicy/vendor/property.te @@ -0,0 +1,2 @@ +vendor_restricted_prop(vendor_net_prop) +vendor_restricted_prop(vendor_recovery_ethernet_dhcp_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts new file mode 100644 index 0000000..f9ab975 --- /dev/null +++ b/sepolicy/vendor/property_contexts @@ -0,0 +1,5 @@ +# DHCP +vendor.recovery.ethernet.dhcp.iface u:object_r:vendor_recovery_ethernet_dhcp_prop:s0 exact string + +# Net +vendor.net. u:object_r:vendor_net_prop:s0 exact string diff --git a/sepolicy/vendor/recovery.te b/sepolicy/vendor/recovery.te new file mode 100644 index 0000000..6efb85c --- /dev/null +++ b/sepolicy/vendor/recovery.te @@ -0,0 +1,3 @@ +recovery_only(` + get_prop(recovery, vendor_recovery_ethernet_dhcp_prop) +') diff --git a/sepolicy/vendor/system_server.te b/sepolicy/vendor/system_server.te new file mode 100644 index 0000000..04c19f0 --- /dev/null +++ b/sepolicy/vendor/system_server.te @@ -0,0 +1 @@ +get_prop(system_server, bootloader_prop) diff --git a/sepolicy/vendor/vendor_init.te b/sepolicy/vendor/vendor_init.te new file mode 100644 index 0000000..29d8a67 --- /dev/null +++ b/sepolicy/vendor/vendor_init.te @@ -0,0 +1,2 @@ +# DHCP +set_prop(vendor_init, vendor_recovery_ethernet_dhcp_prop) diff --git a/sepolicy/vendor/vold.te b/sepolicy/vendor/vold.te new file mode 100644 index 0000000..954d8aa --- /dev/null +++ b/sepolicy/vendor/vold.te @@ -0,0 +1,2 @@ +# vold will access /mnt/vendor/shared for unknown reasons +allow vold mnt_vendor_file:dir r_dir_perms; diff --git a/sepolicy/vendor/zygote.te b/sepolicy/vendor/zygote.te new file mode 100644 index 0000000..7664154 --- /dev/null +++ b/sepolicy/vendor/zygote.te @@ -0,0 +1 @@ +get_prop(zygote, bootloader_prop) diff --git a/treble.mk b/treble.mk index 12d5f8e..4b1f5d9 100644 --- a/treble.mk +++ b/treble.mk @@ -12,11 +12,9 @@ PRODUCT_PACKAGES += \ # HWComposer HAL PRODUCT_PACKAGES += \ - android.hardware.graphics.composer@2.1-impl \ - android.hardware.graphics.composer@2.4-impl \ - android.hardware.graphics.composer@2.1-service \ - android.hardware.graphics.composer@2.4-service \ - android.hardware.graphics.composer@2.1-drmfb-service + android.hardware.graphics.composer@2.1-drmfb-service \ + android.hardware.graphics.composer@2.1-service-clone \ + android.hardware.graphics.composer@2.4-service # Audio HAL PRODUCT_PACKAGES += \ @@ -27,33 +25,29 @@ PRODUCT_PACKAGES += \ # Bluetooth HAL PRODUCT_PACKAGES += \ - android.hardware.bluetooth@1.1-service.vbt \ - android.hardware.bluetooth@1.1-service.btlinux \ - android.hardware.bluetooth.audio@2.1-impl \ - -# Camera HAL -PRODUCT_PACKAGES += \ - camera.x86 + android.hardware.bluetooth-service.default\ + android.hardware.bluetooth.audio-impl # Media codec PRODUCT_PACKAGES += \ - android.hardware.media.c2@1.1-service \ - android.hardware.media.c2@1.2-ffmpeg-service \ - android.hardware.media.omx@1.0-service + android.hardware.media.c2-ffmpeg-service + +ifneq ($(TARGET_SUPPORTS_32_BIT_APPS),false) +PRODUCT_PACKAGES += android.hardware.media.omx@1.0-service +endif # DumpState HAL PRODUCT_PACKAGES += \ - android.hardware.dumpstate@1.0-impl \ - android.hardware.dumpstate@1.0-service.example + com.android.hardware.dumpstate # Gatekeeper HAL PRODUCT_PACKAGES += \ - android.hardware.gatekeeper@1.0-service.software + com.android.hardware.gatekeeper.nonsecure # Health HAL PRODUCT_PACKAGES += \ - android.hardware.health@2.1-impl \ - android.hardware.health@2.1-service + android.hardware.health-service.example \ + android.hardware.health-service.example_recovery # Keymaster HAL PRODUCT_PACKAGES += \ @@ -61,20 +55,16 @@ PRODUCT_PACKAGES += \ # Light HAL PRODUCT_PACKAGES += \ - android.hardware.light@2.0-impl \ - android.hardware.light@2.0-service + android.hardware.light-service.x86 # Memtrack HAL PRODUCT_PACKAGES += \ - memtrack.default \ - android.hardware.memtrack@1.0-impl \ - android.hardware.memtrack@1.0-service + com.android.hardware.memtrack # Power HAL PRODUCT_PACKAGES += \ power.x86 \ - android.hardware.power@1.0-impl \ - android.hardware.power@1.0-service + android.hardware.power-service.example # RenderScript HAL PRODUCT_PACKAGES += \ @@ -86,25 +76,46 @@ PRODUCT_PACKAGES += \ # USB HAL PRODUCT_PACKAGES += \ - android.hardware.usb@1.0-impl \ - android.hardware.usb@1.0-service + android.hardware.usb-service.example # Drm HAL PRODUCT_PACKAGES += \ - android.hardware.drm@1.4-service-lazy.clearkey + android.hardware.drm-service.clearkey # GPS HAL PRODUCT_PACKAGES += \ android.hardware.gnss@1.0-impl \ android.hardware.gnss@1.0-service -# ConfigStore HAL +# Thermal HAL PRODUCT_PACKAGES += \ - android.hardware.configstore@1.1-service + com.android.hardware.thermal.intel + +# Fingerprint +PRODUCT_PACKAGES += \ + com.android.hardware.biometrics.fingerprint.virtual + +# Bootctrl HAL +PRODUCT_PACKAGES += \ + android.hardware.boot@1.2-x86impl \ + android.hardware.boot@1.2-x86impl.recovery \ + android.hardware.boot@1.2-service + +PRODUCT_SOONG_NAMESPACES += \ + hardware/google/camera \ + hardware/google/camera/devices/EmulatedCamera \ -# Thermal HAL PRODUCT_PACKAGES += \ - android.hardware.thermal@2.0-service.intel + android.hardware.camera.provider@2.7-service-google \ + libgooglecamerahwl_impl + +PRODUCT_COPY_FILES += \ + hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_back.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_back.json \ + hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_front.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_front.json \ + hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_depth.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_depth.json + +# HIDL Allocator +PRODUCT_PACKAGES += android.hidl.allocator@1.0-service -# vndservicemanager -PRODUCT_PACKAGES += vndservicemanager +# vndservice & vndservicemanager & hwservicemanager +PRODUCT_PACKAGES += vndservice vndservicemanager hwservicemanager diff --git a/ueventd.x86.rc b/ueventd.x86.rc index b3d51b2..8e80460 100644 --- a/ueventd.x86.rc +++ b/ueventd.x86.rc @@ -11,7 +11,6 @@ /sys/devices/pci*/0000:00:*/usb*/*/*/*/bluetooth/hci0/rfkill* state 0660 bluetooth bluetooth /sys/devices/pci*/0000:00:*/usb*/*/*/*/bluetooth/hci0/rfkill* type 0440 bluetooth bluetooth /dev/rfkill 0660 bluetooth wifi -/dev/uhid 0660 bluetooth bluetooth /dev/bus/usb/00*/00* 0660 bluetooth bluetooth /sys/devices/system/cpu/cpu* online 0664 system system @@ -21,9 +20,5 @@ /sys/devices/virtual/thermal/thermal_zone* trip_point_1_temp 0644 system system /dev/acpi_thermal_rel 0600 system system -# allow binderized sensor hal access input devices -# note that binderize cannot happen until all sensor hals are ready -/dev/input/event* 0660 system system -/dev/hidraw* 0660 system system -# steamdeck virtual controller built into deck sensor hal -/dev/uinput 0660 system system +# add hidraw devices to the uhid group +/dev/hidraw* 0660 uhid uhid diff --git a/usbids b/usbids index 6c41b72..e3a144a 160000 --- a/usbids +++ b/usbids @@ -1 +1 @@ -Subproject commit 6c41b72bb778cfbc9a457b93676131270114bfb2 +Subproject commit e3a144ac314fe8cf30c2c097e05b3ce913b67f87 diff --git a/user_app/amaze.apk b/user_app/amaze.apk index ff6d508..717ad00 100644 Binary files a/user_app/amaze.apk and b/user_app/amaze.apk differ diff --git a/user_app/xtmapper.apk b/user_app/xtmapper.apk index c972512..e24602b 100644 Binary files a/user_app/xtmapper.apk and b/user_app/xtmapper.apk differ diff --git a/user_app_vanilla/kernelsu.apk b/user_app_vanilla/kernelsu.apk index 0f33f1a..68009be 100644 Binary files a/user_app_vanilla/kernelsu.apk and b/user_app_vanilla/kernelsu.apk differ