service set_hw /vendor/bin/set_hw.sh
    class core
    user root
    group system
    disabled
    oneshot

service qrtr-ns /vendor/bin/qrtr-ns -f 1
    class core
    user root
    group system
    disabled
    oneshot

service pd_mapper /vendor/bin/pd-mapper
    class core
    user root
    group system
    disabled
    oneshot

service tqftpserv /vendor/bin/tqftpserv
    class core
    user root
    group system
    disabled
    oneshot

service rmtfs /vendor/bin/rmtfs -o /dev/block/by-name -P -r -s
    class core
    user root
    group system
    disabled
    oneshot

on early-init
    start set_hw
    exec - root -- /vendor/bin/qrtr-cfg 1
    start qrtr-ns

on post-fs
    start pd_mapper

on post-fs && property:vendor.hw=db845c
    exec - root -- /system/bin/sleep 1
    exec - system audio -- /system/bin/tinymix "QUAT_MI2S_RX Audio Mixer MultiMedia1" 1

on post-fs && property:vendor.hw=rb5
    exec - root -- /system/bin/sleep 1
    exec - system audio -- /system/bin/tinymix "TERT_MI2S_RX Audio Mixer MultiMedia1" 1

on post-fs && property:vendor.hw=sm8550hdk
    exec - root -- /system/bin/sleep 1
    exec - system audio -- /system/bin/tinymix "SpkrLeft PA Volume" "15"
    exec - system audio -- /system/bin/tinymix "SpkrRight PA Volume" "15"
    exec - system audio -- /system/bin/tinymix "WSA RX0 MUX" "AIF1_PB"
    exec - system audio -- /system/bin/tinymix "WSA RX1 MUX" "AIF1_PB"
    exec - system audio -- /system/bin/tinymix "WSA_RX0 INP0" "RX0"
    exec - system audio -- /system/bin/tinymix "WSA_RX1 INP0" "RX1"
    exec - system audio -- /system/bin/tinymix "SpkrLeft DAC Switch" "1"
    exec - system audio -- /system/bin/tinymix "SpkrRight DAC Switch" "1"
    exec - system audio -- /system/bin/tinymix "WSA_RX0 Digital Volume" "85"
    exec - system audio -- /system/bin/tinymix "WSA_RX1 Digital Volume" "85"
    exec - system audio -- /system/bin/tinymix "WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1" "1"

on post-fs-data
    mkdir /data/vendor
    mkdir /data/vendor/tmp
    mkdir /data/vendor/readwrite
    mkdir /data/vendor/readonly
    mkdir /data/vendor/readonly/firmware
    mkdir /data/vendor/readonly/firmware/image
    write /sys/class/firmware/timeout 1
    start tqftpserv
    start rmtfs

on shutdown
    stop rmtfs
