Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ if (NOT NUM_OF_PINGS_BEFORE_RECOVERY)
set( NUM_OF_PINGS_BEFORE_RECOVERY 3 )
endif()

if (NOT SUBTITLES_WAYLAND_DISPLAY)
set( SUBTITLES_WAYLAND_DISPLAY "\"westeros-asplayer-subtitles\"" )
endif()

if( NATIVE_BUILD )
add_compile_options(-Wno-error=attributes)
add_subdirectory( stubs/rdk_gstreamer_utils )
Expand Down
3 changes: 3 additions & 0 deletions common/public/include/SessionServerCommon.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct AppConfig
* "/tmp/bar" In all cases the name can be retrieved with getAppConnectionInfo()
*/
std::string clientDisplayName; /**< Socket name that Rialto client should connect to */
std::string subtitlesDisplayName; /**< Wayland display name for subtitles */
};

/**
Expand Down Expand Up @@ -105,6 +106,8 @@ struct ServerManagerConfig
SocketPermissions sessionManagementSocketPermissions{}; /* Defines permissions of session management socket */
unsigned numOfFailedPingsBeforeRecovery{@NUM_OF_PINGS_BEFORE_RECOVERY@};
/* Defines how many pings have to fail before recovery action will be taken */
std::string subtitlesDisplayName{@SUBTITLES_WAYLAND_DISPLAY@};
/* Wayland display name for subtitles rendering */
};

} // namespace firebolt::rialto::common
Expand Down
4 changes: 3 additions & 1 deletion media/server/ipc/source/ServerManagerModuleService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void ServerManagerModuleService::setConfiguration(::google::protobuf::RpcControl
common::MaxResourceCapabilitites maxResource{request->resources().maxplaybacks(),
request->resources().maxwebaudioplayers()};
const auto kClientDisplayName = request->has_clientdisplayname() ? request->clientdisplayname() : "";
const auto kSubtitlesDisplayName = request->has_subtitlesdisplayname() ? request->subtitlesdisplayname() : "";
bool success{true};
if (request->has_sessionmanagementsocketfd())
{
Expand All @@ -105,7 +106,8 @@ void ServerManagerModuleService::setConfiguration(::google::protobuf::RpcControl
request->socketowner(), request->socketgroup());
}
success &= m_sessionServerManager.configureServices(convertSessionServerState(request->initialsessionserverstate()),
maxResource, kClientDisplayName, request->appname());
maxResource, kClientDisplayName, kSubtitlesDisplayName,
request->appname());
m_sessionServerManager.setLogLevels(static_cast<RIALTO_DEBUG_LEVEL>(request->loglevels().defaultloglevels()),
static_cast<RIALTO_DEBUG_LEVEL>(request->loglevels().clientloglevels()),
static_cast<RIALTO_DEBUG_LEVEL>(request->loglevels().sessionserverloglevels()),
Expand Down
1 change: 1 addition & 0 deletions media/server/service/include/IPlaybackService.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class IPlaybackService
virtual void setMaxPlaybacks(int maxPlaybacks) = 0;
virtual void setMaxWebAudioPlayers(int maxWebAudio) = 0;
virtual void setClientDisplayName(const std::string &clientDisplayName) const = 0;
virtual void setSubtitlesDisplayName(const std::string &subtitlesDisplayName) const = 0;
virtual void setResourceManagerAppName(const std::string &appName) const = 0;

virtual bool isActive() const = 0;
Expand Down
3 changes: 2 additions & 1 deletion media/server/service/include/ISessionServerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class ISessionServerManager
virtual bool configureIpc(int32_t socketFd) = 0;
virtual bool configureServices(const common::SessionServerState &state,
const common::MaxResourceCapabilitites &maxResource,
const std::string &clientDisplayName, const std::string &appName) = 0;
const std::string &clientDisplayName, const std::string &subtitlesDisplayName,
const std::string &appName) = 0;
virtual bool setState(const common::SessionServerState &state) = 0;
virtual void setLogLevels(RIALTO_DEBUG_LEVEL defaultLogLevels, RIALTO_DEBUG_LEVEL clientLogLevels,
RIALTO_DEBUG_LEVEL sessionServerLogLevels, RIALTO_DEBUG_LEVEL ipcLogLevels,
Expand Down
9 changes: 9 additions & 0 deletions media/server/service/source/PlaybackService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ void PlaybackService::setClientDisplayName(const std::string &clientDisplayName)
}
}

void PlaybackService::setSubtitlesDisplayName(const std::string &subtitlesDisplayName) const
{
// Method called during initialization only (before setting any state), no need to execute it on a task thread.
if (!subtitlesDisplayName.empty())
{
setenv("SUBTITLES_WAYLAND_DISPLAY", subtitlesDisplayName.c_str(), 1);
}
}

void PlaybackService::setResourceManagerAppName(const std::string &appName) const
{
// Method called during initialization only (before setting any state), no need to execute it on a task thread.
Expand Down
1 change: 1 addition & 0 deletions media/server/service/source/PlaybackService.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class PlaybackService : public IPlaybackService
void setMaxPlaybacks(int maxPlaybacks) override;
void setMaxWebAudioPlayers(int maxWebAudio) override;
void setClientDisplayName(const std::string &clientDisplayName) const override;
void setSubtitlesDisplayName(const std::string &subtitlesDisplayName) const override;
void setResourceManagerAppName(const std::string &clientDisplayName) const override;

bool isActive() const override;
Expand Down
4 changes: 3 additions & 1 deletion media/server/service/source/SessionServerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ bool SessionServerManager::configureIpc(int32_t socketFd)

bool SessionServerManager::configureServices(const common::SessionServerState &state,
const common::MaxResourceCapabilitites &maxResource,
const std::string &clientDisplayName, const std::string &appName)
const std::string &clientDisplayName,
const std::string &subtitlesDisplayName, const std::string &appName)
{
m_sessionManagementServer->start();
m_playbackService.setMaxPlaybacks(maxResource.maxPlaybacks);
m_playbackService.setMaxWebAudioPlayers(maxResource.maxWebAudioPlayers);
m_playbackService.setClientDisplayName(clientDisplayName);
m_playbackService.setSubtitlesDisplayName(subtitlesDisplayName);
m_playbackService.setResourceManagerAppName(appName);
return setState(state);
}
Expand Down
3 changes: 2 additions & 1 deletion media/server/service/source/SessionServerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class SessionServerManager : public ISessionServerManager
const std::string &socketGroup) override;
bool configureIpc(int32_t socketFd) override;
bool configureServices(const common::SessionServerState &state, const common::MaxResourceCapabilitites &maxResource,
const std::string &clientDisplayName, const std::string &appName) override;
const std::string &clientDisplayName, const std::string &subtitlesDisplayName,
const std::string &appName) override;
bool setState(const common::SessionServerState &state) override;
void setLogLevels(RIALTO_DEBUG_LEVEL defaultLogLevels, RIALTO_DEBUG_LEVEL clientLogLevels,
RIALTO_DEBUG_LEVEL sessionServerLogLevels, RIALTO_DEBUG_LEVEL ipcLogLevels,
Expand Down
2 changes: 2 additions & 0 deletions proto/servermanagermodule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ message Resources {
* @param[in] socketGroup Socket file created with this group
* @param[in] sessionManagementSocketFd File descriptor of socket used for SessionServer <-> Application communication
* (optional, sessionManagementSocketName will be used if fd not present)
* @param[in] subtitlesDisplayName Wayland display name for subtitles rendering
*
*/
message SetConfigurationRequest {
Expand All @@ -98,6 +99,7 @@ message SetConfigurationRequest {
optional string appName = 9;
optional int32 sessionManagementSocketFd = 10;
optional uint32 subtitleClockResyncInterval = 11;
optional string subtitlesDisplayName = 12;
}
message SetConfigurationResponse {
}
Expand Down
1 change: 1 addition & 0 deletions serverManager/common/source/ISessionServerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ISessionServerApp
virtual std::string getSessionManagementSocketOwner() const = 0;
virtual std::string getSessionManagementSocketGroup() const = 0;
virtual std::string getClientDisplayName() const = 0;
virtual std::string getSubtitlesDisplayName() const = 0;
virtual firebolt::rialto::common::SessionServerState getInitialState() const = 0;
virtual int getServerId() const = 0;
virtual const std::string &getAppName() const = 0;
Expand Down
11 changes: 9 additions & 2 deletions serverManager/common/source/SessionServerApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ SessionServerApp::SessionServerApp(const std::string &appName,
std::unique_ptr<firebolt::rialto::ipc::INamedSocket> &&namedSocket)
: m_kServerId{generateServerId()}, m_appName{appName}, m_initialState{initialState},
m_sessionManagementSocketName{getSessionManagementSocketPath(appConfig)},
m_clientDisplayName{appConfig.clientDisplayName}, m_socks{-1, -1}, m_linuxWrapper{linuxWrapper},
m_timerFactory{timerFactory}, m_sessionServerAppManager{sessionServerAppManager}, m_pid{-1}, m_isPreloaded{false},
m_clientDisplayName{appConfig.clientDisplayName}, m_subtitlesDisplayName{appConfig.subtitlesDisplayName},
m_socks{-1, -1}, m_linuxWrapper{linuxWrapper}, m_timerFactory{timerFactory},
m_sessionServerAppManager{sessionServerAppManager}, m_pid{-1}, m_isPreloaded{false},
m_kSessionServerPath{sessionServerPath}, m_kSessionServerStartupTimeout{sessionServerStartupTimeout},
m_kSessionManagementSocketPermissions{socketPermissions}, m_kSessionManagementSocketOwner{socketOwner},
m_kSessionManagementSocketGroup{socketGroup}, m_childInitialized{false}, m_expectedState{initialState},
Expand Down Expand Up @@ -195,6 +196,7 @@ bool SessionServerApp::configure(const std::string &appName,
m_initialState = initialState;
m_sessionManagementSocketName = getSessionManagementSocketPath(appConfig);
m_clientDisplayName = appConfig.clientDisplayName;
m_subtitlesDisplayName = appConfig.subtitlesDisplayName;
m_isPreloaded = false;
m_expectedState = initialState;
if (m_namedSocket)
Expand Down Expand Up @@ -239,6 +241,11 @@ std::string SessionServerApp::getClientDisplayName() const
return m_clientDisplayName;
}

std::string SessionServerApp::getSubtitlesDisplayName() const
{
return m_subtitlesDisplayName;
}

firebolt::rialto::common::SessionServerState SessionServerApp::getInitialState() const
{
return m_initialState;
Expand Down
2 changes: 2 additions & 0 deletions serverManager/common/source/SessionServerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SessionServerApp : public ISessionServerApp
const std::string &getAppName() const override;
int getAppManagementSocketName() const override;
std::string getClientDisplayName() const override;
std::string getSubtitlesDisplayName() const override;
int getMaxPlaybackSessions() const override;
int getMaxWebAudioPlayers() const override;
void cancelStartupTimer() override;
Expand All @@ -95,6 +96,7 @@ class SessionServerApp : public ISessionServerApp
firebolt::rialto::common::SessionServerState m_initialState;
std::string m_sessionManagementSocketName;
std::string m_clientDisplayName;
std::string m_subtitlesDisplayName;
std::array<int, 2> m_socks;
std::shared_ptr<firebolt::rialto::wrappers::ILinuxWrapper> m_linuxWrapper;
std::shared_ptr<firebolt::rialto::common::ITimerFactory> m_timerFactory;
Expand Down
11 changes: 7 additions & 4 deletions serverManager/common/source/SessionServerAppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ void SessionServerAppManager::handleRestartServer(int serverId)
const std::string kAppName{sessionServer->getAppName()};
const firebolt::rialto::common::SessionServerState kState{sessionServer->getExpectedState()};
const firebolt::rialto::common::AppConfig kAppConfig{sessionServer->getSessionManagementSocketName(),
sessionServer->getClientDisplayName()};
sessionServer->getClientDisplayName(),
sessionServer->getSubtitlesDisplayName()};
std::unique_ptr<firebolt::rialto::ipc::INamedSocket> namedSocket{std::move(sessionServer->releaseNamedSocket())};
if (firebolt::rialto::common::SessionServerState::INACTIVE != kState &&
firebolt::rialto::common::SessionServerState::ACTIVE != kState)
Expand Down Expand Up @@ -488,6 +489,7 @@ bool SessionServerAppManager::configureSessionServerWithSocketName(const std::sh
const auto kInitialState{kSessionServer->getInitialState()};
const auto kSocketName{kSessionServer->getSessionManagementSocketName()};
const auto kClientDisplayName{kSessionServer->getClientDisplayName()};
const auto kSubtitlesDisplayName{kSessionServer->getSubtitlesDisplayName()};
const auto kSocketPermissions{kSessionServer->getSessionManagementSocketPermissions()};
const auto kSocketOwner{kSessionServer->getSessionManagementSocketOwner()};
const auto kSocketGroup{kSessionServer->getSessionManagementSocketGroup()};
Expand All @@ -496,8 +498,8 @@ bool SessionServerAppManager::configureSessionServerWithSocketName(const std::sh
const firebolt::rialto::common::MaxResourceCapabilitites kMaxResource{kSessionServer->getMaxPlaybackSessions(),
kSessionServer->getMaxWebAudioPlayers()};
if (!m_ipcController->performSetConfiguration(kSessionServer->getServerId(), kInitialState, kSocketName,
kClientDisplayName, kMaxResource, kSocketPermissions, kSocketOwner,
kSocketGroup, kAppName))
kClientDisplayName, kSubtitlesDisplayName, kMaxResource,
kSocketPermissions, kSocketOwner, kSocketGroup, kAppName))
{
RIALTO_SERVER_MANAGER_LOG_ERROR("Configuration of server with id %d failed - ipc error.",
kSessionServer->getServerId());
Expand All @@ -513,12 +515,13 @@ bool SessionServerAppManager::configureSessionServerWithSocketFd(const std::shar
const auto kInitialState{kSessionServer->getInitialState()};
const auto kSocketFd{kSessionServer->getSessionManagementSocketFd()};
const auto kClientDisplayName{kSessionServer->getClientDisplayName()};
const auto kSubtitlesDisplayName{kSessionServer->getSubtitlesDisplayName()};
const auto kAppName{kSessionServer->getAppName()};

const firebolt::rialto::common::MaxResourceCapabilitites kMaxResource{kSessionServer->getMaxPlaybackSessions(),
kSessionServer->getMaxWebAudioPlayers()};
if (!m_ipcController->performSetConfiguration(kSessionServer->getServerId(), kInitialState, kSocketFd,
kClientDisplayName, kMaxResource, kAppName))
kClientDisplayName, kSubtitlesDisplayName, kMaxResource, kAppName))
{
RIALTO_SERVER_MANAGER_LOG_ERROR("Configuration of server with id %d failed - ipc error.",
kSessionServer->getServerId());
Expand Down
3 changes: 2 additions & 1 deletion serverManager/config/rialto-config.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"socketGroup" : @SOCKET_GROUP@,
"numOfPreloadedServers" : @NUM_OF_PRELOADED_SERVERS@,
"logLevel" : @LOG_LEVEL@,
"numOfPingsBeforeRecovery" : @NUM_OF_PINGS_BEFORE_RECOVERY@
"numOfPingsBeforeRecovery" : @NUM_OF_PINGS_BEFORE_RECOVERY@,
"subtitlesDisplayName" : @SUBTITLES_WAYLAND_DISPLAY@
}
2 changes: 2 additions & 0 deletions serverManager/ipc/include/IController.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ class IController
virtual void removeClient(int serverId) = 0;
virtual bool performSetConfiguration(int serverId, const firebolt::rialto::common::SessionServerState &initialState,
const std::string &socketName, const std::string &clientDisplayName,
const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const unsigned int socketPermissions, const std::string &socketOwner,
const std::string &socketGroup, const std::string &appName) = 0;
virtual bool performSetConfiguration(int serverId, const firebolt::rialto::common::SessionServerState &initialState,
int socketFd, const std::string &clientDisplayName,
const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const std::string &appName) = 0;
virtual bool performPing(int serverId, int pingId) = 0;
Expand Down
5 changes: 4 additions & 1 deletion serverManager/ipc/source/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ bool Client::performSetState(const firebolt::rialto::common::SessionServerState

bool Client::performSetConfiguration(const firebolt::rialto::common::SessionServerState &initialState,
const std::string &socketName, const std::string &clientDisplayName,
const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const unsigned int socketPermissions, const std::string &socketOwner,
const std::string &socketGroup, const std::string &appName) const
Expand All @@ -216,6 +217,7 @@ bool Client::performSetConfiguration(const firebolt::rialto::common::SessionServ
rialto::SetConfigurationResponse response;
request.set_sessionmanagementsocketname(socketName);
request.set_clientdisplayname(clientDisplayName);
request.set_subtitlesdisplayname(subtitlesDisplayName);
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subtitlesDisplayName is always written into the protobuf request, even when it’s an empty string. In proto2 this marks the field as present and overrides the .proto default, so the session server will see "" and won’t apply the intended default subtitles display. Consider only setting subtitlesdisplayname when the value is non-empty (or ensure a non-empty default is injected earlier in the server manager).

Suggested change
request.set_subtitlesdisplayname(subtitlesDisplayName);
if (!subtitlesDisplayName.empty())
{
request.set_subtitlesdisplayname(subtitlesDisplayName);
}

Copilot uses AI. Check for mistakes.
request.mutable_resources()->set_maxplaybacks(maxResource.maxPlaybacks);
request.mutable_resources()->set_maxwebaudioplayers(maxResource.maxWebAudioPlayers);
request.set_socketpermissions(socketPermissions);
Expand All @@ -240,7 +242,7 @@ bool Client::performSetConfiguration(const firebolt::rialto::common::SessionServ
}

bool Client::performSetConfiguration(const firebolt::rialto::common::SessionServerState &initialState, int socketFd,
const std::string &clientDisplayName,
const std::string &clientDisplayName, const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const std::string &appName) const
{
Expand All @@ -254,6 +256,7 @@ bool Client::performSetConfiguration(const firebolt::rialto::common::SessionServ
rialto::SetConfigurationResponse response;
request.set_sessionmanagementsocketfd(socketFd);
request.set_clientdisplayname(clientDisplayName);
request.set_subtitlesdisplayname(subtitlesDisplayName);
request.mutable_resources()->set_maxplaybacks(maxResource.maxPlaybacks);
request.mutable_resources()->set_maxwebaudioplayers(maxResource.maxWebAudioPlayers);
request.set_appname(appName);
Expand Down
3 changes: 2 additions & 1 deletion serverManager/ipc/source/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ class Client
bool performSetState(const firebolt::rialto::common::SessionServerState &state);
bool performSetConfiguration(const firebolt::rialto::common::SessionServerState &initialState,
const std::string &socketName, const std::string &clientDisplayName,
const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const unsigned int socketPermissions, const std::string &socketOwner,
const std::string &socketGroup, const std::string &appName) const;
bool performSetConfiguration(const firebolt::rialto::common::SessionServerState &initialState, int socketFd,
const std::string &clientDisplayName,
const std::string &clientDisplayName, const std::string &subtitlesDisplayName,
const firebolt::rialto::common::MaxResourceCapabilitites &maxResource,
const std::string &appName) const;
bool performPing(int pingId) const;
Expand Down
Loading
Loading