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
839 stars 204 forks source link

"Illegal instruction" on raspbian wheezy #25

Closed psych0d0g closed 11 years ago

psych0d0g commented 11 years ago

Compiled on my Pi and when i want to run the binary, all i get is a "Illegal instruction" error. model B rev 2 PI

hzeller commented 11 years ago

I have this running on my Raspberry Pi, Rev B with wheezy, so there might be something fishy with your installation. Always make sure to update all the packages (sudo aptitude update ; sudo aptitude upgrade)

The problem is most likely not in gmediarender, but in on one of the gstreamer plugins. Are you using anything special here ? What is the gstreamer version you're using ? (1.0 or 0.10 ?). You are not saying when this is happening, on startup or when playing something ? Can you include a logfile as described in INSTALL.md ('Misc options') ?

Illegal instructions can happen if the compiled program uses instructions the processor does not understand. In the land of audio processing, that is often because there might be hand-optimized routines for decompressing certain encoding schemes; and if they have not been configured properly on compile, some instructions might be included that don't work on that processor (in particular ARM CPUs not always have all floating point instructions supported).

I have seen this on my CuBox once, but not on the Raspberry with the default wheezy. So either you have a custom compiled gstreamer, or you're including plugins that have troubles. Or you're playing files that I usually don't (usually, i am playing .flac files, more rarely .ogg files).

You can attempt to track down where this happens by running it with gdb. Ideally, you also make sure to include all symbols ./configure --enable-debug make clean ; make

Now, run it with gdb gdb src/gmediarender on the gdb prompt, type 'run' When it crashes with the illegal instruction, you can type the command 'bt' to get a backtrace. From there it should be possible to see where it happens.

psych0d0g commented 11 years ago

Thanks for the reply, i had it compiled on raspbian wheezy, tryed both gstreamer 1.0 and 0.10, ill give it another try now on archlinuxarm. ;) mainly using flac's and mp3's. ill drop you a not when im done with this try

psych0d0g commented 11 years ago

Okay i just installed the AUR build target from the arch user repository, and now it worked out of the box ;) Thanks for this Epic piece of software! :)

hzeller commented 11 years ago

Glad you got it working. Still it would be interesting to know where the illegal instruction was - did you run it with gdb in the non-working condition ?

psych0d0g commented 11 years ago

sadly not, im sorry, just fyi the exeption occured on deamon start, nothing got logged either, so it must have been at a pretty early part of the compiled program.

hzeller commented 11 years ago

Yeah, for logging, you actually need to switch on logging, otherwise it is pretty verbose (--logfile=...). Anyway, seems be resolved, closing this issue now.

aawilson commented 10 years ago

Jumping in to report that I also had this issue. I compiled with the 1.0 gstreamer libs from the wheezy-backports source list.

Here's gdb output:

Reading symbols from /home/pi/gmrender-resurrect/src/gmediarender...done.
(gdb) run
Starting program: /home/pi/gmrender-resurrect/src/gmediarender
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0xb6e2eebc in ?? () from /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0
(gdb) bt
#0  0xb6e2eebc in ?? () from /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0
#1  0xb6e2d146 in ?? () from /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0
#2  0xb6e2d146 in ?? () from /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I removed the 1.0 gstreamer versions from apt and replaced them with 0.10, and was able to get gmrender running. My guess is that libgstreamer 1.0 will have to come from a different source than I was using to work with Raspberry Pi.

christiscarborough commented 10 years ago

That's a pretty odd failure mode. If it helps, I have a working gmrender-resurrect compiled against gstreamer-1.2 at http://www.coraline.org/non-fiction/raspi-upnp-renderer (although there are a couple of outstanding bugs - occasionally losing the ALSA sink, and clipping off the beginning of some MP3 tracks - these may be bugs in ALSA or gstreamer - it's hard to tell);

colorsu commented 6 years ago

gmediarender 0.0.7-git started [ gmediarender 2018-03-11_cd283a2 (libupnp-1.6.19; glib-2.. Logging switched off. Enable with --logfile= (e.g. --logfile=/dev/stdout for co) random: nonblocking pool is initialized Ready for rendering. Illegal instruction

tryptophan0 commented 5 years ago

Hi. I am receiving the same error message. This is the output from running gmediarender under gdb. The hardware I am using is an Pi Zero W and pHAT DAC

pi@raspberrypi:~/gmrender-resurrect-master $ gdb src/gmediarender 
GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from src/gmediarender...done.
(gdb) run
Starting program: /home/pi/gmrender-resurrect-master/src/gmediarender 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
gmediarender 0.0.7-git started [ gmediarender 0.0.7-git (libupnp-1.6.19+git20160116; glib-2.50.3; gstreamer-1.10.4) ].
Logging switched off. Enable with --logfile=<filename> (or --logfile=stdout for console)
[New Thread 0xb51b1470 (LWP 1801)]
[New Thread 0xb49b1470 (LWP 1802)]
[Thread 0xb49b1470 (LWP 1802) exited]
[New Thread 0xb49b1470 (LWP 1803)]

(gmediarender:1798): GStreamer-CRITICAL **: gst_pad_new_from_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed

(gmediarender:1798): GStreamer-CRITICAL **: gst_pad_template_get_caps: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed

** (gmediarender:1798): CRITICAL **: gst_pad_set_caps: assertion 'GST_IS_PAD (pad)' failed

(gmediarender:1798): GStreamer-CRITICAL **: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
ERROR [2019-01-30 18:38:37.139790 | webserver] Could not stat '/usr/local/share/gmediarender/grender-64x64.png': No such file or directory
ERROR [2019-01-30 18:38:37.141083 | webserver] Could not stat '/usr/local/share/gmediarender/grender-128x128.png': No such file or directory
[New Thread 0xa8342470 (LWP 1821)]
[New Thread 0xa7b42470 (LWP 1822)]
[New Thread 0xa7342470 (LWP 1823)]
[New Thread 0xa6b42470 (LWP 1824)]
[New Thread 0xa6342470 (LWP 1825)]
[New Thread 0xa5b42470 (LWP 1826)]
[New Thread 0xa5342470 (LWP 1827)]
[New Thread 0xa4b42470 (LWP 1828)]
[New Thread 0xa4342470 (LWP 1829)]
[New Thread 0xa3b42470 (LWP 1830)]
Ready for rendering.
[New Thread 0xa2bff470 (LWP 1831)]
[Thread 0xa7b42470 (LWP 1822) exited]
[Thread 0xa4b42470 (LWP 1828) exited]
[Thread 0xa5b42470 (LWP 1826) exited]
[New Thread 0xa5b42470 (LWP 1832)]
[New Thread 0xa4b42470 (LWP 1833)]
[New Thread 0xa7b42470 (LWP 1834)]
[Thread 0xa7b42470 (LWP 1834) exited]
[New Thread 0xa7b42470 (LWP 1835)]
[Thread 0xa7b42470 (LWP 1835) exited]
[New Thread 0xa23ff470 (LWP 1836)]
[Thread 0xa23ff470 (LWP 1836) exited]
[New Thread 0xa23ff470 (LWP 1837)]
[Thread 0xa23ff470 (LWP 1837) exited]
[New Thread 0xa7b42470 (LWP 1838)]
[Thread 0xa7b42470 (LWP 1838) exited]
[New Thread 0xa237f470 (LWP 1840)]
[Thread 0xa237f470 (LWP 1840) exited]
[New Thread 0xa7b42470 (LWP 1841)]
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead
[New Thread 0xa237f470 (LWP 1842)]
[New Thread 0xa1aab470 (LWP 1843)]
[New Thread 0xa12ab470 (LWP 1844)]

Thread 25 "aqueue:src" received signal SIGILL, Illegal instruction.
[Switching to Thread 0xa237f470 (LWP 1842)]
0xaec2dad4 in ?? () from /usr/lib/arm-linux-gnueabihf/libopenal.so.1
(gdb) bt
#0  0xaec2dad4 in ?? () from /usr/lib/arm-linux-gnueabihf/libopenal.so.1
#1  0x00000800 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 
hzeller commented 5 years ago

I suspect one of the libraries was compiled for the Pi3, while the Pi Zero W has an older generation ARM with probably limited instruction set. In particular the gstreamer libraries probably use some optimized floating point operations that might not be available on the Pi.

I'd probably suggest to recompile gstreamer from scratch on your platform and not use the packages.

tryptophan0 commented 5 years ago

Wow, that's a fast reply :) From what you were suggesting, I suspected the culprit to be a part of the "bad" gstreamer1.0-plugins. I removed the package and the error has not appeared again. It still wasn't working (presumably from me, messing with the system too much), so I reinstalled Raspbian. This time I have installed the gmediarender, gstreamer1.0-libav and gstreamer1.0-alsa via apt-get. gstreamer1.0-plugins-base, gstreamer1.0-plugins-good have installed automatically (but not bad and ugly!). This time it works :tada: Thanks a lot!