hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
851 stars 206 forks source link

Error compiling: fatal error: glib.h: No such file or directory #223

Open Finnitio opened 3 years ago

Finnitio commented 3 years ago

Hey,

trying to get gmrender-ressurct runing on my raspberry pi with buster. Unfortunately I can not compile it. Because of this Error:

fatal error: glib.h: No such file or directory

I found out that the sourcefile is part of libglib2.0-dev, so I installed it which didn't help. Any suggestions.

And another question: I've seen some older tutorials which suggest to install gstreamer 1.0, it seems like it is already included in buster?

mill1000 commented 3 years ago

Have you checked that the dependencies listed in the documentation are installed?

mill1000 commented 3 years ago

You may also want to look at this comment https://github.com/hzeller/gmrender-resurrect/issues/212#issuecomment-689446527

coldtobi commented 3 years ago

There is an official Debian package: https://tracker.debian.org/pkg/gmrender-resurrect, though 0.0.8 was not released when buster came out…

However, it should be easy to compile it for buster using the Debian source package, with no or little change; Give it a spin: (in a preferable empty directory, after installing packages devscripts and possibly build-essential. A Short description what it does is after the "#")

debcheckout gmrender-resurrect  # clone the Debian packaging repository
cd gmrender-resurrect/  
sudo mk-build-deps -i  # generates and installs a pseudo-package depending on all build dependncies declared in debian/control
dch --bpo ""  # generate a changelog entry with a nice backports line. This will ensure that you will get bullseye's version once it is released.
dpkg-buildpackage -b # build the package
sudo debi # install the generated packages  -- note that it also includes the dbgsym package; you probably want to uninstall it if you are not debugging on the pi, as it only takes up space then)

(Note that I have not tried whether the build dependencies are available on buster)

Let me know if that helps you or if there are problem

tobi (the maintainer of the Debian package)

Finnitio commented 3 years ago

Hello,

so I am a bit further. After installing the packages mentioned in https://github.com/hzeller/gmrender-resurrect/issues/212#issuecomment-689446527 and using ./configure --with-gstreamer. I now have gmediarendere running and am able connect with swyh. Unfortunately the soundquality was very bad. It was actually stuttering a lot.

@coldtobi I was not able to build your package as I would need to add the sources. How do I do that?

gmediarender 0.0.8 log started [ gmediarender 0.0.8_git2020-01-09_26d8f7e (libupnp-1.8.4; glib-2.58.3; gstreamer-1.14.4) ]

As you can see it seems to use gmediarender 0.0.8 how can I change that?

mill1000 commented 3 years ago

Personally I've had terrible luck with SWYH, I wish it worked better for me. So it may be worth experimenting with another source.

Finnitio commented 3 years ago

Is there another option to stream audio from windows to my rpi than SWYH? Couldn't find one.

I will try the buffer option but is it millisceonds or seconds. And is there any description of the available options of gmrener resurrect?

I use an hifiberry digi+ pro and toslink to my DSP.

mill1000 commented 3 years ago

I haven't found an alternative to SWYH for UPnP either.

The buffer duration is in seconds. The --help and --help-gstout should explain most the options.

~ $ gmediarender --help
Usage:
  gmediarender [OPTION...] - GMediaRender

Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gstout                     Show GStreamer Output Options
  --help-gst                        Show GStreamer Options

Application Options:
  --version                         Output version information and exit
  -I, --ip-address                  The local IP address the service is running and advertised (only one, 0.0.0.0 won't work)
  -p, --port                        Port to listen to; [49152..65535] (libupnp does not use SO_REUSEADDR, so might increment)
  -u, --uuid                        UUID to advertise
  -f, --friendly-name               Friendly name to advertise.
  -o, --output                      Output module to use.
  -P, --pid-file                    File the process ID should be written to.
  -d, --daemon                      Run as daemon.
  --mime-filter                     Filter the supported media types. e.g. Audio only: '--mime-filter audio'. Disable FLAC: '--mime-filter -audio/x-flac'.
  --logfile                         Debug log filename. Use 'stdout' or 'stderr' to log to console.
  --list-outputs                    List available output modules and exit
  --dump-devicedesc                 Dump device descriptor XML and exit.
  --dump-connmgr-scpd               Dump Connection Manager service description XML and exit.
  --dump-control-scpd               Dump Rendering Control service description XML and exit.
  --dump-transport-scpd             Dump A/V Transport service description XML and exit.

~ $ gmediarender --help-gstout
Usage:
  gmediarender [OPTION...] - GMediaRender

GStreamer Output Options
  --gstout-audiosink                GStreamer audio sink to use (autoaudiosink, alsasink, osssink, esdsink, ...)
  --gstout-audiodevice              GStreamer device for the given audiosink.
  --gstout-audiopipe                GStreamer audio sink to pipeline(gst-launch format) useful for further output format conversion.
  --gstout-videosink                GStreamer video sink to use (autovideosink, xvimagesink, ximagesink, ...)
  --gstout-buffer-duration          The size of the buffer in seconds. Set to zero to disable buffering.
  --gstout-initial-volume-db        GStreamer initial volume in decibel (e.g. 0.0 = max; -6 = 1/2 max)
mill1000 commented 3 years ago

Alright so I was able to get SWYH to work on my RPi3, but I wasn't able to just select the renderer from SWYH's context menu. I had to use my control point to tell the render to play from SWYH.

Otherwise the quality was fine and I had no stuttering.

It appears that SWYH attempts to set the TransportState to Play before it provides the AVTransportURI. I don't know if this is an invalid operation or not.

** (gmediarender:1976): WARNING **: cannot set NULL uri
ERROR [2020-12-16 12:34:29.410097 | gstreamer] setting play state failed (2)
ERROR [2020-12-16 12:34:29.410231 | upnp] upnp_set_error: Playing failed (704)
INFO  [2020-12-16 12:34:29.489341 | transport] AVTransportURI: http://192.168.1.158:63657/stream/swyh.wav
INFO  [2020-12-16 12:34:29.489460 | transport] NumberOfTracks: 1
INFO  [2020-12-16 12:34:29.489513 | gstreamer] Set uri to 'http://192.168.1.158:63657/stream/swyh.wav'
INFO  [2020-12-16 12:34:29.489772 | transport] LastChange: <?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<AVTransportURI val="http://192.168.1.158:63657/stream/swyh.wav"></AVTransportURI>
<NumberOfTracks val="1"></NumberOfTracks>
</InstanceID>
</Event>
INFO  [2020-12-16 12:34:29.573209 | connmgr] Query ConnectionID='0'
Finnitio commented 3 years ago

Okay it works, sorry for being so stupid, didn't see the --help-gstout in the install.md. I think for me it was the buffering which was not set. Now it works with SWYH though it does not connect as nicely as I would which (need to reconnect sometimes). I get the same errors in stdout.

Now how to I have to enable the buffer in the init.d script, I honestly tried but I don't knwo how to find out the propder option name.

mill1000 commented 3 years ago

Your system is without a doubt running systemd. The start up script will likely be located here: /etc/systemd/system/gmediarender.service

Edit the ExecStart field. e.g. a sample from my system where I run buffered and unbuffered renderers

[Service]
ExecStart=/usr/local/bin/gmediarender -f "%H (Buffered)" --mime-filter audio --gstout-buffer-duration=1.0 --uuid %m_1
Finnitio commented 3 years ago

I was using the init.d file provided in this repository, since I compiled it myself. So what else do i need to include in the systemd file? If I use that instead of init.d (that works too but I don't know how to set the options in the scriptfile).

sorry this is somehow over my head since I am not too well known with linux. Would I be able to install the same package via apt-get install gmediarender?

mill1000 commented 3 years ago

Yes you can install via sudo apt install gmediarender. That will install the package maintained by @coldtobi. It's a bit out of date though. (No fault of his own of course! It's just timing of releases.)

There are systemd scripts in the repo here: https://github.com/hzeller/gmrender-resurrect/tree/master/dist-scripts/debian