Black Screen Detector (System Administrator)

Материал из SmartPlayer
Версия от 17:45, 8 августа 2023; N.Bloshkin (обсуждение | вклад) (Новая страница: «== '''Solution Concept''' == To address the issue, it was decided to create an automatic "Black Screen Detector". It notifies of problems with content on the device and alerts about the occurred situation in the personal account.<br> {{Note|This functionality is not available to the user in the personal account and needs to be activated separately.|warn}} === '''Operating Principle''' === Every client/company has its own ID associated with the server. This I...»)

Situation Description

Users are experiencing issues with broadcasts on their devices. When playing content on some devices, a "black" screen appears. This problem can be observed in the user's personal account or at the device's location.

Cause

On devices operating on-site, a "black screen" appears during content playback. Meanwhile, the broadcast in the personal account continues to run but only displays a "black" screen.
This situation arises due to various errors when starting the broadcast. The reasons for such problems can vary and are very difficult to detect.
Any of the following actions can be a cause:

  • A user uploads a video, but this video uses a codec unsupported by the system. As a result, the video simply cannot start and displays a black screen. There are issues related to the client application (a bug), leading to broadcast problems
  • As long as there is a consistent, stable network, everything works fine. However, as soon as the device loses network access (for any reason), the broadcast is interrupted, and a black screen appears.
An example of displaying a "Black" screen in the user's personal account

Frequency of the Problem

It's very easy to detect and visually confirm the "black" screen. In such cases, the personal account is very helpful.
The challenge with this situation is that it doesn't have a consistent frequency; it can occur once a month, or once every few days or even hours.
The period when the black screen appears is determined empirically and is confirmed on-site. The responsibility of finding the cause of the problem falls on technical specialists.

Solution Concept

To address the issue, it was decided to create an automatic "Black Screen Detector". It notifies of problems with content on the device and alerts about the occurred situation in the personal account.

This functionality is not available to the user in the personal account and needs to be activated separately.

Operating Principle

Every client/company has its own ID associated with the server. This ID is indicated in the personal account, and all the company's devices are linked to it.
After activating the functionality, the server sends an "event" to the devices at specific time intervals.
When initiating the "event", the device checks for the presence of a "black" screen using the detector, taking a screenshot during the launch.
After launching the detector, two specific results can be obtained:

  • After initiating the "event", no black screen is detected - the system continues to operate in normal mode.
  • After initiating the "event", a black screen is detected - the server sends a secondary, verification "event".

The interval for resending the "event" is 10 seconds.
If a black screen is detected again during the second check, the server sends an email alerting about the issue.

The specified email should be linked to the server.

Preparation

The system administrator must configure the server application based on two parameters:

  • Launch and operation of the "black screen" detector
  • Setting up email alerts for detected errors

Operating Principle

If the server application detects a black screen, it sends an email. The result of this check will be an email notification about the issue.
To confirm the functionality check via the personal account, the system administrator can set a black picture. The server continues to send notifications until the problem is resolved or the functionality is turned off.
Subsequently, the system administrator must take measures to resolve the issue.

Nuances and Subtleties in Functional Operation

1. For correct operation, it is necessary for the placeholder with a white dot to be perceived as a black screen. Therefore, an absolute check is not used.
2. It's relevant only during video playback. If there are root rights on the device, the detector works fine. However, if there are no root rights on the device, the detector won't be able to take a screenshot.
Exceptions:
Screenshot is available:

  • If the application is signed with the "developer's signature" (rights level – Signage).
  • Some devices (Vestel, Hikvision, Phillips) can take a screenshot without root rights due to firmware features.

3. If a user tries to take a screenshot without root rights, an "empty screenshot" is created with the inscription "Video is playing. No rights to take a screenshot".
4. Information from the server to the developers is sent through an "event". Inside the sent "event", the server awaits a callback from the developers.
5. The default "Callback" timeout on the server is 30 seconds.

Реализация

Активация

По умолчанию детектор для всех компаний отключен на сервере, так как создает на него слишком большую нагрузку.

Включается детектор только по запросу со стороны компании, у которой появилась проблема с чёрным экраном.

Алгоритм действия

Вся работа будет вестись в два этапа.
Первый этап - это запуск самого детектора.

При запуске детектора нужно использовать id компании, который указан в личном кабинете.
Расположение ID компании в личном кабинете

Для этого нужно зайти в профиль и развернуть подробную информацию о пользователе. Системному администратору нужно подключиться на сервер, через Command Line Interface (CLI).

При включении CLI сервер получает определенные данные для настройки:
Это:

  • ID компании, для которой включаем детектор
  • Можно передать платформу (или несколько платформ), для которой необходимо запустить мониторинг.

Например: передаем параметр "ANDROID" и мониторинг включается только для устройств "ANDROID".

  • E-mail адрес или несколько адресов на которые должно отправляться уведомление о нештатной ситуации
  • Указанное время хранения скриншотов (по умолчанию 3 дня)

Далее нужно перейти в серверное приложение и выполнить команду: docker exec -it smartplayer_backend_i bash

Команда"docker exec -it smartplayer_backend_i bash"

На этом этапе попадаем в нашем контейнере с серверным приложением.
Следующей выполняем команду:

Enable screen - screen monitor
Команда"docker exec -it smartplayer_backend_i bash"

После очередного этапа система выдает вот такую строку:

Системное сообщение: Input company ID and press Enter
Системное сообщение "Input company ID and press Enter:"

Выполненная команда отобразит строку в которой просят ввести Id компании.
После ввода ID появляется запрос на мониторинг всех платформ компании. В данном случае выбираем «ДА/Y»

Здесь нужно запустить мониторинг платформ нажав "ДА/Y"

В последствии консоль потребует указать e-mail на который будут приходить оповещения о проблемах. Это делается в строке:
Input_email and press enter

Здесь нужно запустить мониторинг платформ нажав "ДА/Y"
Указанная почта должна быть привязана к серверу.

Также можно указать интервал с которым будут приходить скриншоты (например 1 минута). Строка выглядит так:
Input check interval in minutes (m) or seconds (s) and press "Enter"

Здесь нужно указать время в минутах с префиксом (m) или в секундах с префиксом (S)

Далее указываем время либо в секундах с префиксом (s) после числового значения, либо в минутах с префиксом (m) и применяем эту настройку через "Enter". Итогом всех манипуляций будет статус:
Company screen monitoring enabled - выделена зеленым цветом. Это значит что детектор черного экрана запущен.

Оповещение о запуске Детектора выделено зелёным цветом

Уведомления на почту

Второй этап настройка уведомления, которые приходят на почту. Настройка уведомления подробно прописана в отдельной инструкции Настройка отправки писем через серверное приложение SmartPlayer.

При получении сообщения о проблеме на почту, невозможно напрямую из этого уведомления сделать какие либо действия. К примеру «Перезагрузка экрана» или "Остановка трансляции" недоступна.

Предфинальные действия

В зависимости от результата, системный администратор сможет корректно определить причину и предпринять конкретные действия для устранения ситуации. Если у него не получается решить проблему внутри своей среды или же проблема на нашей стороне, он должен обратиться к команде SmartPlayer.
Это вариант удобен для всех. Так как поможет решить проблемы если они и с нашей стороны (например баг приложения), так и со стороны пользователя (например пользователь неправильно создал трансляцию).

Важная информация о которой не стоит забывать

Для перезапуска трансляции надо зайти в личный кабинет и перезапустить все вручную
Детектор черного экрана на данный момент работает только на Android версии 1.63.1

Итоговый результат

Системный администратор со стороны клиента сможет запустить и настроить функционал детектора и начать решать проблему. Наличие детектора позволяет контролировать проблемную ситуацию с "Чёрным" экраном и оперативно работать с её исправлением. Это актуально как для нас, так и для сотрудников клиента. Команда SmartPlayer и команда сотрудников со стороны клиента смогут оперативно взаимодействовать для решения проблемы.
Рядовой пользователь минимизирует негативный опыт взаимодействия с нашим продуктом.