Skip to content

Commit

Permalink
Merge pull request intel#57 from padmaraoi/master
Browse files Browse the repository at this point in the history
Added audio service file GP CL native and modified earlyapp_gpnative.service
  • Loading branch information
padmaraoi authored Apr 22, 2019
2 parents 13a1d40 + 0dfbf85 commit 864a71c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
2 changes: 2 additions & 0 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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
Expand Down
8 changes: 3 additions & 5 deletions config/earlyapp-setup_gpnative.service
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions config/earlyapp-setup_gpnative_audio.service
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions config/earlyapp_gpnative.service
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[Unit]
Description=Early App service file for Gordon Peak native.
DefaultDependencies=no
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
Expand Down
30 changes: 18 additions & 12 deletions src/DeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ namespace earlyapp

case SystemStatusTracker::eSTATE_BOOTVIDEO:
{
// Audio device.
std::shared_ptr<DeviceParameter> 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)
{
Expand All @@ -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<DeviceParameter> 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;

Expand Down

0 comments on commit 864a71c

Please sign in to comment.