From ba32d2cf537c3c039c9f243e39453bbfd4ad8fac Mon Sep 17 00:00:00 2001 From: Padmarao Edapalapati Date: Fri, 1 Mar 2019 06:30:35 +0000 Subject: [PATCH 1/3] Adding audio service for gpnative and copying fb_splash service to target for splash screen --- config/CMakeLists.txt | 2 ++ config/earlyapp-setup_gpnative_audio.service | 13 +++++++++++++ config/earlyapp_gpnative.service | 1 + 3 files changed, 16 insertions(+) create mode 100644 config/earlyapp-setup_gpnative_audio.service diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 6a544ef..34f7682 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -38,7 +38,9 @@ SET(CONF_FILES earlyapp-setup-aud.service earlyapp-setup_gst.service earlyapp-setup_gpnative.service + earlyapp-setup_gpnative_audio.service earlyapp-setup-ipu.service + fb_splash.service simple-egl.service simple-egl_resume.service early-audio.service diff --git a/config/earlyapp-setup_gpnative_audio.service b/config/earlyapp-setup_gpnative_audio.service new file mode 100644 index 0000000..e42341a --- /dev/null +++ b/config/earlyapp-setup_gpnative_audio.service @@ -0,0 +1,13 @@ +[Unit] +Description=Setup audio for Early App +DefaultDependencies=no +StartLimitBurst=16 + +[Service] +RemainAfterExit=yes +Slice=earlyapp.slice + +# Load audio driver and set dsp switch +ExecStartPre=/usr/bin/sh -c 'if modprobe -n --first-time snd_soc_sst_bxt_tdf8532; then modprobe -v snd_soc_sst_bxt_tdf8532;fi' +ExecStart=amixer -c0 cset numid=19 on +Restart=on-failure diff --git a/config/earlyapp_gpnative.service b/config/earlyapp_gpnative.service index b1736a0..f9e48cf 100644 --- a/config/earlyapp_gpnative.service +++ b/config/earlyapp_gpnative.service @@ -1,6 +1,7 @@ [Unit] Description=Early App service file for Gordon Peak native. DefaultDependencies=no +Wants=earlyapp-setup_gpnative_audio.service Requires=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service After=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service From a9662adc031c5b665ed812f3bbe5a6100557a1fc Mon Sep 17 00:00:00 2001 From: pedapalapati Date: Mon, 11 Mar 2019 18:40:35 +0530 Subject: [PATCH 2/3] Moving audio first in BOOT_VIDEO and adding aud service to resolve critical chain path --- config/earlyapp_gpnative.service | 2 +- src/DeviceController.cpp | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/config/earlyapp_gpnative.service b/config/earlyapp_gpnative.service index f9e48cf..a98af9d 100644 --- a/config/earlyapp_gpnative.service +++ b/config/earlyapp_gpnative.service @@ -1,7 +1,7 @@ [Unit] Description=Early App service file for Gordon Peak native. DefaultDependencies=no -Wants=earlyapp-setup_gpnative_audio.service +Wants=earlyapp-setup_gpnative_audio.service earlyapp-setup-aud.service Requires=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service After=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service diff --git a/src/DeviceController.cpp b/src/DeviceController.cpp index 4fc90a5..4d53836 100644 --- a/src/DeviceController.cpp +++ b/src/DeviceController.cpp @@ -175,6 +175,19 @@ namespace earlyapp case SystemStatusTracker::eSTATE_BOOTVIDEO: { + // Audio device. + std::shared_ptr audioParam(new DeviceParameter()); + audioParam->setFileToPlay(m_pConf->audioSplashSoundPath()); + if(m_pAud != nullptr) + { + m_pAud->preparePlay(audioParam); + m_pAud->play(); + } + else + { + LWRN_(TAG, "Invalid Audio device: BOOTVIDEO"); + } + // Video device. if(m_pVid != nullptr) { @@ -184,24 +197,17 @@ namespace earlyapp // The VideoDevice will be held until it gets EOS. m_pVid->prepareStop(); m_pVid->stop(); + if(m_pAud != nullptr) + { + m_pAud->prepareStop(); + m_pAud->stop(); + } } else { LWRN_(TAG, "Invalid Video device: BOOTVIDEO"); } - // Audio device. - std::shared_ptr audioParam(new DeviceParameter()); - audioParam->setFileToPlay(m_pConf->audioSplashSoundPath()); - if(m_pAud != nullptr) - { - m_pAud->preparePlay(audioParam); - m_pAud->play(); - } - else - { - LWRN_(TAG, "Invalid Audio device: BOOTVIDEO"); - } } break; From 0dfbf854df049220a45e83da06277de74c77eb72 Mon Sep 17 00:00:00 2001 From: pedapalapati Date: Sun, 24 Mar 2019 22:29:37 +0530 Subject: [PATCH 3/3] Adding ipu modules load to earlyapp-setup_gpnative.service and splitted services to earlyapp_gpnative.service to avoid it is in the critical-chain Signed-off-by: pedapalapati --- config/earlyapp-setup_gpnative.service | 8 +++----- config/earlyapp_gpnative.service | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/config/earlyapp-setup_gpnative.service b/config/earlyapp-setup_gpnative.service index 2d90bba..0273a7b 100644 --- a/config/earlyapp-setup_gpnative.service +++ b/config/earlyapp-setup_gpnative.service @@ -1,13 +1,11 @@ [Unit] -Description=Setup device nodes for Early App Gordon Peak native. +Description=Setup IPU device nodes for Early App Gordon Peak native. DefaultDependencies=no -After=cbc_attach.service [Service] Type=oneshot RemainAfterExit=yes Slice=earlyapp.slice -# Set permissions on GPU render nodes -ExecStart=/usr/bin/chown :render /dev/dri/renderD128 -ExecStart=/usr/bin/chmod g+rw /dev/dri/renderD128 +# Load IPU modules +ExecStart=/usr/bin/modprobe -a crlmodule intel-ipu4 intel-ipu4-mmu intel-ipu4-isys intel-ipu4-psys intel-ipu4-isys-csslib intel-ipu4-psys-csslib diff --git a/config/earlyapp_gpnative.service b/config/earlyapp_gpnative.service index a98af9d..b94d757 100644 --- a/config/earlyapp_gpnative.service +++ b/config/earlyapp_gpnative.service @@ -1,9 +1,9 @@ [Unit] Description=Early App service file for Gordon Peak native. DefaultDependencies=no -Wants=earlyapp-setup_gpnative_audio.service earlyapp-setup-aud.service -Requires=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service -After=ias-earlyapp.service cbc_attach.service earlyapp-setup_gpnative.service +Wants=earlyapp-setup_gpnative_audio.service +Requires=ias-earlyapp.service cbc_attach.service earlyapp-setup-cbc.service earlyapp-setup-render.service earlyapp-setup-aud.service earlyapp-setup_gpnative.service earlyapp-setup-resume.service +After=ias-earlyapp.service cbc_attach.service earlyapp-setup-cbc.service earlyapp-setup-render.service earlyapp-setup-aud.service earlyapp-setup_gpnative.service [Service] Environment=XDG_RUNTIME_DIR=/run/ias