Dietpi: GMediaRender stopped working after update 6.29.2

Created on 9 May 2020  路  10Comments  路  Source: MichaIng/DietPi

Creating a bug report/issue

Required Information

  • DietPi version | 6.29.2
  • Kernel version | Linux DietPi 4.19.
  • SBC model | RPi4

Steps to reproduce

Need to correct the file /etc/systemd/system/gmrender.service

dietpi@DietPi:~$ sudo systemctl status gmrender.service 

gmrender.service - GMediaRender (DietPi)
   Loaded: loaded (/etc/systemd/system/gmrender.service; disabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/gmrender.service.d
           鈹斺攢dietpi-process_tool.conf, dietpi-services_edit.conf
   Active: failed (Result: exit-code) since Sat 2020-05-09 09:37:22 -03; 47s ago
  Process: 615 ExecStartPre=/DietPi/dietpi/func/obtain_network_details (code=exited, status=0/SUCCESS)
  Process: 619 ExecStartPre=/bin/dash -c systemctl set-environment ACTIVE_IP=$(mawk NR==4 /DietPi/dietpi/.network) (code=exited, status=0/SUCCESS)
  Process: 622 ExecStart=/usr/local/bin/gmediarender -u 941892a6-f8c7-42e8-b8eb-b407257a8bf0 -f DietPi --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db
=0 --logfile=stdout -I $ACTIVE_IP (code=exited, status=1/FAILURE)
 Main PID: 622 (code=exited, status=1/FAILURE)

May 09 09:37:21 DietPi systemd[1]: Starting GMediaRender (DietPi)...
May 09 09:37:21 DietPi dash[619]: mawk: cannot open /DietPi/dietpi/.network (No such file or directory)
May 09 09:37:21 DietPi systemd[1]: Started GMediaRender (DietPi).
May 09 09:37:22 DietPi gmediarender[622]: Failed to initialize: Missing argument for -I
May 09 09:37:22 DietPi systemd[1]: gmrender.service: Main process exited, code=exited, status=1/FAILURE
May 09 09:37:22 DietPi systemd[1]: gmrender.service: Failed with result 'exit-code'.
dietpi@DietPi:~$ 

The IP address is not passing to the GMediaRender ExecStart

Here is my /etc/systemd/system/gmrender.service :

[Unit]
Description=GMediaRender (DietPi)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --logfi$

[Install]
WantedBy=multi-user.target

My workaround is inserting the Rpi4 IP address into the ExecStart command:

ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --logfile=stdout -I "192.168.4.107"

Bug Solution available

All 10 comments

Hi,

many thanks for your report. Well /run/dietpi/.network is located on new location on new release 6.29.2. (as expected)

mawk: cannot open /DietPi/dietpi/.network (No such file or directory)

for sure it's not gonna work anymore as file is moved from /DietPi/dietpi/.network to /run/dietpi/.network

@MichaIng
I guess gmrender.service would need to be adjusted

@fnsnyc @Joulinar
Many thanks for reporting this issue.

Interesting that the gmrender.service contains the correct location already (it is indeed adjusted during update) but the error messages shows it checking the old location. I guess there is simply some systemctl daemon-reload missing. Actually I thought that this is done at the end of every DietPi update, let me see...

@fnsnyc
Just to verify, please run:

systemctl daemon-reload
systemctl restart gmrender
systemctl status gmrender

@MichaIng

Same error.

This is actually indeed done:

@fnsnyc
If the above steps do indeed not solve it, I see that you have edited the service file before, as there is a /etc/systemd/system/gmrender.service.ddietpi-services_edit.conf. Could you please paste the following to show the finally effective service code:

systemctl cat gmrender

```
dietpi@DietPi:~$ sudo systemctl cat gmrender

/etc/systemd/system/gmrender.service

[Unit]
Description=GMediaRender (DietPi)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --log
file=stdout -I "$ACTIVE_IP"

ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --lo

gfile=stdout -I "192.168.4.107"

[Install]
WantedBy=multi-user.target

/etc/systemd/system/gmrender.service.d/dietpi-process_tool.conf

WARNING: Do not manually edit this file, use "dietpi-services" to adjust values!

[Service]
Nice=-10
IOSchedulingPriority=0

/etc/systemd/system/gmrender.service.d/dietpi-services_edit.conf

[Unit]

Description=GMediaRender (DietPi)

Wants=network-online.target

After=network-online.target dietpi-boot.service

[Service]

User=gmrender

ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /DietPi/dietpi/.network)'

ExecStart=/usr/local/bin/gmediarender -u '941892a6-f8c7-42e8-b8eb-b407257a8bf0' -f 'DietPi' --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=0 --lo

gfile=stdout -I "$ACTIVE_IP"

ExecStartPre=
ExecStartPre=/DietPi/dietpi/func/obtain_network_details
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /DietPi/dietpi/.network)'

[Install]

WantedBy=multi-user.target

dietpi@DietPi:~$
``

@fnsnyc
Ah there it is. I remember this being a fix for another issue if network interface bring-up takes very long. Let's keep the fix in place, so do:

sed -Ei 's@/(DietPi|boot)/dietpi/\.network@/run/dietpi/.network@g' /etc/systemd/system/gmrender.service.d/dietpi-services_edit.conf
systemctl daemon-reload
systemctl restart gmrender
systemctl status gmrender

voil脿! now it's working!! Thanks so much!

@MichaIng
I guess this would need to be implemented by default. I did a test installation on 6.30 and it fails as network interface bring-up takes longer. See attached picture.

root@DietPi3:~# systemctl cat gmrender.service
# /etc/systemd/system/gmrender.service
[Unit]
Description=GMediaRender (DietPi)
Documentation=https://github.com/hzeller/gmrender-resurrect/blob/master/INSTALL.md#commandline-options
Wants=network-online.target
After=network-online.target sound.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u 'be44fcef-43f6-4b60-85f1-9479df37c41a' -f 'DietPi3' --gstout-audiosink=alsasink --gstout-audiodevice=default --logfile=stdout -I "$ACTIVE_IP"

[Install]
WantedBy=multi-user.target
root@DietPi3:~#

LAN IP is not detected right after reboot, therefore GMediaRender is going to fail.
20200511_094206

@Joulinar
Agree. I did another step to delay network data estimation until network time sync has proven internet connectivity (in most cases): https://github.com/MichaIng/DietPi/commit/7fb8b09e0a3161289368b4a09142c97691304e08
Will also add the info refresh to all service starts which read the info file, so also on service restarts, when users e.g. connect to a different WiFi, or DHCP changed the IP, info will be also up-to-date.

Was this page helpful?
0 / 5 - 0 ratings