Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed and running but not visible to UPnP-Controllers #240

Open
imforumman opened this issue Nov 3, 2021 · 11 comments
Open

Installed and running but not visible to UPnP-Controllers #240

imforumman opened this issue Nov 3, 2021 · 11 comments

Comments

@imforumman
Copy link

Hi, first off, if I can get this running on a Pi3, then this is exactly what I need to being an old but good AV-Reciever into the year 2021... thank you for this. But... I can't seem to get it up an running.

The RasPi was set up headless through ssh. I've followed INSTALL.md and have as far I can see, gotten no errors. A related blog-post (https://klenzel.de/1642) suggested checking for a running process, ps shows gmediarenderer up and running:

pi@gmrenderer-OG:~ $ ps aux | grep gmedia
pi 495 0.3 1.0 382076 9812 ? Ssl 08:58 0:00 /usr/local/bin/gmediarender -f gmrenderer -d -u 5c1cbfc93690fdf5781bdeb259158f66 --gstout-audiosink=alsasink --gstout-audiodevice=sysdefault --gstout-initial-volume-db=-10

gmrenderer seems to also be listening as intended:
pi@gmrenderer-OG:~ $ sudo netstat -tulpn | grep LISTEN
tcp 2 0 192.168.128.155:49494 0.0.0.0:* LISTEN 495/gmediarender
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 642/sshd
tcp6 0 0 fe80::1457:591d:f:49494 :::* LISTEN 495/gmediarender
tcp6 0 0 :::22 :::* LISTEN 642/sshd

Still, no control point in my network (Android phones and tablets with Bubble-UPnP and/or HiFi-Cast) can see "gmrenderer", other renderers (a TV, a modern AV-Reciever, LibreELEC-RasPis when I turn on the UPnP-function) appear when appropriate, so I'm ruling out a general network problem.

I don't want to start another LibreELEC just because it's overkill, I would rather use your solution. Do you have any idea where else I could start searching for the problem?

Thanks in advance!

@ingo-h
Copy link

ingo-h commented Nov 3, 2021

You may have a look at Howto install UPnP/DLNA media renderer.

@imforumman
Copy link
Author

Thanks for the link, that did not do it for me though. The local wav is played fine (through the headphone jack) and with the first couple of tones missing when using the hdmi-sound.

But, I found out that I can see the renderer in die control-points if I "gmediarenderer start" from the command line. Immediately the renderer appears in HiFiCast and dissappears when I stop "gmediarenderer stop". I still am getting a timeout as soon as I try to play anything, but this is a step forward.

If I copy the init.d script
cp scripts/init.d/gmediarenderer /etc/init.d/
and integrate it
update-rc.d gmediarenderer defaults
I see the process running as mentioned above, but it doesn't even show up on a control-point.

I don't know enough about the inner workings of Linux for my guess to be worth much, but could it be that something in the recent versions of Raspberry Pi OS has broken compatibility?

@mill1000
Copy link
Contributor

mill1000 commented Nov 4, 2021

I've run a RPi3 headless for years now. It's possible you are experiencing the issue described in #129

First, check if everything works as expected when you run gmediarender from the terminal. e.g. gmediarender --logfile=stdout. I suspect this will work fine since you are able to see the renderer when you manually call gmediarenderer start.

Second, ditch init.d scripts, and go with systemd. There is an example in the repo, and here's mine for reference: #129 (comment)

@imforumman
Copy link
Author

@mill1000 Thanks for your reply! I'm going to look into this systemd thing as soon as I can get it running from the terminal. After starting gmediarender everything looks fine, the control point finds the renderer and then... error.

ERROR [2021-11-05 10:47:44.109653 | gstreamer] openalsink0: Error: Unable to prepare device. (Debug: gstopenalsink.c(859): gst_openal_sink_prepare (): /GstPlayBin:play/GstPlaySink:playsink/GstBin:abin/GstOpenALSink:openalsink0:
ALC error: Invalid Device)
ERROR [2021-11-05 10:47:44.111426 | gstreamer] openalsink0: Error: The stream is in the wrong format. (Debug: gstaudiobasesink.c(1193): gst_audio_base_sink_preroll (): /GstPlayBin:play/GstPlaySink:playsink/GstBin:abin/GstOpenALSink:openalsink0:
sink not negotiated.)
ERROR [2021-11-05 10:47:44.112448 | gstreamer] source: Error: Internal data stream error. (Debug: gstbasesrc.c(3055): gst_base_src_loop (): /GstPlayBin:play/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
streaming stopped, reason not-negotiated (-4))

terminalstarted.log

via raspi-config the default sound out is the headphone jack. later I would like to attach the raspi via HDMI to the AVR.

What am I doing wrong?

@mill1000
Copy link
Contributor

mill1000 commented Nov 5, 2021

Are you specifying your audio sink on the command line? It looks like gstreamer is trying to use openalsink and you probably want alsasink instead.

@imforumman
Copy link
Author

nope, hadn't specified anything else. If I do, there is an error early in the log, from then on unchanged

pi@gmrenderer-OG:~ $ gmediarender --gstout-audiosink alsasink --logfile=stdout
INFO [2021-11-06 08:12:40.811477 | main] gmediarender 0.0.9 log started [ gmediarender 0.0.9_git2021-03-14_4ac7d89 (libupnp-1.8.4; glib-2.58.3; gstreamer-1.14.4) ]
INFO [2021-11-06 08:12:40.811655 | output] Using output module: gst (GStreamer multimedia framework)
INFO [2021-11-06 08:12:40.935898 | gstreamer] Buffering disabled (--gstout-buffer-duration)
INFO [2021-11-06 08:12:40.936036 | gstreamer] Setting audio sink to alsasink; device=
ERROR [2021-11-06 08:12:40.936072 | gstreamer] Couldn't create sink 'alsasink'

@mill1000
Copy link
Contributor

mill1000 commented Nov 6, 2021

Are you able to play a local file using gst-play-1.0?
e.g.

gst-play-1.0 some_local_wave_file.wav

I wonder if you're missing the gstreamer ASLA package. What is the output of gst-inspect-1.0 | grep alsa?

@imforumman
Copy link
Author

imforumman commented Nov 6, 2021

I wonder if you're missing the gstreamer ASLA package.

My hero! It's true, I installed that package again and it works, at least after a command-line start. I'm wondering how that happend. Can only alsa or pulse be installed, because I figure I probably installed them both.

Tomorrow (it's late in Germany) I will find out if init.d was also causing a problem (not being able to see gmediarender at all in the control points kinda seems like it did, and otherwise I will have to figure out how systemd works.

Thank you so much!!!

@imforumman
Copy link
Author

ok, so back to the original problem of the renderer not appearing in the control points: when using init.d something goes wrong. When using system.d with a 3 second delay, everything works (I didn't try systemd without the delay, but will report back if you wish or if I find just time just being curious).

For reference: this was on a clean fresh install of raspberry os lite brought up to date "apt full-upgrade" and local compile of version 0.0.9_git2021-03-14

Thanks @mill1000 for all your help and sorry about the gstreamer-alsa thing, I don't know how that happend.

@mill1000
Copy link
Contributor

mill1000 commented Nov 7, 2021

Most likely you are experiencing the issue described in #129 and #239. More or less, if gmediarender starts before the network is ready it fails to bind to the port and won't appear on the network. Although, since commit a836de4 there should be up to a minute of retries though

If you added the --logfile option to your init.d script you may get some more insights as to why gmediarender fails to start.

@ingo-h
Copy link

ingo-h commented Nov 8, 2021

Hi @mill1000 as your comment

I'm going to look into this systemd thing as soon as I can get it running from the terminal.

you may also have a look at #230.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants