MayaPosch/NymphCast

Player quit immediately after pushing on play button.

Aftabx opened this issue ยท 21 comments

Hello,

Player quit immediately after pushing on the play button.
below you can find the trace on Server Side.

The server is running on Raspberry PI3, and Client as well.
Any idea, how can I make it work?

Thank you in advance for your help :)

Starting new session for file with size: 392744673
Stopping timer...
Destroying texture...
Destroying renderer...
6 - 22724.0 NymphRemoteClient 260 Calling callback method: MediaReadCallback - src/remote_client.cpp
6 - 22724.0 NymphMessage 219 Serialising message with flags: 0x4 - src/nymph_message.cpp
6 - 22724.0 NymphSession 217 Sent 46 bytes. - src/nymph_session.cpp
Destroying window...
Quitting...
Erreur de segmentation

Hello, and thank you for checking out NymphCast :)

Could you provide more details about the steps you took before you got this crash?
Please provide details on the player-side log (if available), and anything else that might be relevant, such as what version of Raspbian or other OS on the Raspberry Pi 3.

I will try to replicate the issue on my end with a Raspberry Pi 3 and hopefully report back on this soon.

I have confirmed the issue. I'll be working on a fix as soon as the cause has been identified.

A number of fixes have been implemented which should resolve the issue.
Please test it and let me know if it works for you now :)

Hello,

I apreciate your quick reply, thank you :)

Due to lockdown, I was working from home.
After a full day being on laptop, I don't had motivation to do anything else :(

I appreciate your feedback, I will try to get the latest version and test :)

Hi,

I face the same issue (same error in the log) on my system (Odroid C2 - Ubuntu Mate 18.04).
After reading this discussion, I rebuild my nymph server with your latest update but I got the same result:

Starting new session for file with size: 99812688
Stopping timer...
Destroying texture...
Destroying renderer...
Destroying window...
6 - 19676.0 NymphRemoteClient 260 Calling callback method: MediaReadCallback - src/remote_client.cpp
6 - 19676.0 NymphMessage 219 Serialising message with flags: 0x4 - src/nymph_message.cpp
6 - 19676.0 NymphSession 217 Sent 46 bytes. - src/nymph_session.cpp
Quitting...
Segmentation fault (core dumped)

Note: I tried to play a .mp4 video from my client installed on my desktop (windows 10).
How can I get more logs to understand the issue?

On the other hand, I run also the server using a service. When I look to the journalctl, I have some additional logs like this:

Apr 05 18:12:50 odroid nymphcast_server[6842]: error: XDG_RUNTIME_DIR not set in the environment.
Apr 05 18:12:50 odroid nymphcast_server[6842]: error: XDG_RUNTIME_DIR not set in the environment.
Apr 05 18:12:50 odroid nymphcast_server[6842]: Could not create renderer: Invalid window

Note: I create a user "nymph" and I grant the ownership for the nymph_server. But I have the same issue using root user.
I had also the user "nymph" to groups: audio, video, avahi-autoipd, lightdm, pulse

Could it be a clue? But I don't know that to do with that.

I saw that there is a nymphcast_server.debug now. Is it a package to have more verbose? How I use it to debug this issue?

Thanks.

I saw that there is a nymphcast_server.debug now. Is it a package to have more verbose? How I use it to debug this issue?

The .debug binary is the same as the nymphcast_server executable, though with the debug symbols still included. In this scenario it'd be mostly useful to run it with gdb:

gdb nymphcast_server.debug

Then

run -c nymphcast_config.ini

Use the NymphCast server as usual, then when it crashes, it'll return to the gdb command line, where with bt full you can get the full backtrace.

I'll attempt to reproduce it on my end as well.

Unfortunatelly, for me it is stopping here:

Starting program: /root/NymphCast/src/server/bin/nymphcast_server.debug -c /root/NymphCast/src/server/nymphcast_config.ini
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x0000007fb59414c8 in ?? () from /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1

(gdb) bt full
0 0x0000007fb59414c8 in () at /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
1 0x0000007fb5adb908 in () at /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1

Tried to find some information but there are beyond my understanding. :(

I find something here: monero-project/monero#4452

I suspect this is the issue I was having where it was compiling with crypto extensions on ARMv8, when the Odroid C2's chip doesn't support hardware AES.

I think you have to do export NO_AES=1 before compiling. I'm hoping to fix this soon in CMakeLists.txt

Or, i find something also here in stackoverflow to get more information but as I do not understand it, I prefer to not run it. (and not sure it is related) So I will work on that to understand a little bit better.

Hope that could bring you some valuable information. Let me know if I can provide you additional logs.

I change my strategy after reading the gdb man.
I start my server and then I pug gdb on the PID. And I get another resultat:

0x0000007fa2a1b22c in futex_wait_cancelable (private=, expected=0, futex_word=0x7fda8ea520) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
88 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.

I am still looking on this.

Actually, I just saw that the display is currently done with my remote client (mobaxterm) and if I kill the x server on mobaxterm, I do not have display... I will look on my display configuration.

I just tested NymphCast server in a Debian Buster VM and in Raspbian on a Raspberry Pi 3B. Player ran on Windows 7.

Both MPEG and MP4 videos played without issues in either configuration. Transition between screensaver to video and back to screensaver also saw no issues.

After doing git pull in the NymphCast project folder, you can try running export UPDATE=1 before ./setup.h to ensure that the current version of NymphRPC is installed.

I will re-install all my system and see.

Interestingly, I seem to have encountered the original crash on a different Raspberry Pi 3B system, using the same Raspbian SD card, no less:

Starting new session for file with size: 59501376
Stopping timer...
Destroying texture...
6 - 953.0 NymphRemoteClient 260 Calling callback method: MediaReadCallback - src/remote_client.cpp
6 - 953.0 NymphMessage 219 Serialising message with flags: 0x4 - src/nymph_message.cpp
Destroying renderer...
6 - 953.0 NymphSession 217 Sent 46 bytes. - src/nymph_session.cpp
Destroying window...
Quitting...

Thread 20 "nymphcast_serve" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x647fba90 (LWP 975)]
0x66147574 in ?? ()
(gdb) bt full
#0 0x66147574 in ()
#1 0x725ff990 in vcos_dummy_thread_cleanup (cxt=0x63a01610) at /home/dom/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:104
i =
thread = 0x63a01610
#2 0x74efe2fc in __nptl_deallocate_tsd () at pthread_create.c:301
data =
level2 = 0x647fbb1c
idx =
round = 0
cnt =
self = 0x647fba90
#3 0x74efe4a4 in start_thread (arg=0x647fba90) at pthread_create.c:497
pd = 0x647fba90
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {70375868, 346130812, 1996482920, 1686092432, 1838843088, 338, 2130694818, 1686092432, 0, 1686091212, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call =
#4 0x74e81578 in () at ../sysdeps/unix/sysv/linux/arm/clone.S:73

The one Raspberry Pi 3B board is a 'Make in the UK' model, the other 'Made in PRC'. On the former I have no issues with playback, on the latter board I get the listed segmentation fault in a system library related to pthreads.

It's unclear what the cause of this crash may be.

@Aftabx Is your Raspberry Pi 3 a 3B model, and is it made in the UK or PRC? (should be listed on the board)

The line in question can be seen here: https://github.com/raspberrypi/userland/blob/master/interface/vcos/pthreads/vcos_pthreads.c#L104

thread->at_exit[i].pfn(thread->at_exit[i].cxt);

This means the issue is apparently in the Video Core OS (VCOS) API, with seemingly invalid thread handles or structures being accessed, which causes the SIGSEGV signal.

Maybe something is out of sync with the firmware on the GPU side of the SoC?

Hi Maya,

So eventually I changed my OS to Armbian Buster (1st try with Ubuntu Mate 18.04) and now nymphcast is working :)
My client is not killed after running video (I tried with .avi and .mp4). So great!

But still I have some issues:

  • the client do not automatically find the server now but not a big deal as I can manually enter the IP of the server
  • I just manage to run nymphcast on remote display ... it does not work via hdmi. But I guess that is because the resource is already used by my desktop. I have the same issue for the sound with a clear error message saying resource busy
    So I will try fixing my configuration regarding resource now. Thanks for your work.

By the way, I got the SIGSEGV signal too ... I fixed it with a firmware update.

@BatBat81

  • There's an Avahi service script that will announce the NymphCast instance on the LAN. It's found under src/server/avahi along with an installation shell script. This also gets installed with the install_linux.sh shell script in the root of the project, which will also install the server to system folders (/usr/bin, etc.).
  • I'm not entirely sure what you mean with the HDMI issue. NymphCast server should open a new window on the desktop for its output when video output is enabled in its .ini file. Are you getting SDL error messages?

Ok, thanks for the tips for Avahi service. I will look to that.

Regarding the HDMI, I don't know how to describe it. In fact, when I start NymphCast in SSH or via service, it cannot open a window unless I have my X fordarwing activated. But if I am connected physically on the system on the desktop and I start NymphCast, the window is created...
So I'm looking about something in my Xorg conf but as I know little about that it is just a mess for me.
If you have some ideas, I will be glad to look at them. Thanks.

Hi,
So, I find a solution to my issue to run nymphcast as service (systemd). I modified nymphcast.service to add some environment variable:

[Unit]
Description=NymphCast audio/video casting server
After=graphical.target

[Service]
User=USER_RUNNING_NYMPHCAST
Environment="DISPLAY=:0"
Environment="XAUTHORITY=~/.Xauthority"
ExecStart=/path/to/nymphcast_server -c /path/to/nymphcast_config.ini -a /path/to/apps/ -w /path/to/wallpapers/
Restart=always
RestartSec=5

[Install]
WantedBy=graphical.target

Like this for me the service is started without issues.
Hope that could help.

In any case, regarding the main topic of this issue, today, I have no more the quit after running MP4. I launch AVI and MP4 on my server.

@BatBat81 Glad to hear that you got it fixed :)

It might be something specific with Armbian, perhaps? I got a Banana Pro board with Armbian that I can try it on, see whether I get the same issues with X forwarding as you did.

Thanks for sharing the modified service file at any rate! :)

I am answering a bit late :)

I have a Raspberry Pi 3B.

since your update, I have not tried it, but I should do some new test soon :)

Stange, I can't build the client anymore -->

Download or clone the project repository
Build the libnymphcast library in the src/client_lib folder using the Makefile in that folder: make lib.

When I follow those steps :

โžœ client_lib git:(master) โœ— sudo make lib mkdir -p lib mkdir -p obj/shared mkdir -p obj/static g++ -c -o obj/static/nymphcast_client.o nymphcast_client.cpp -I src -g3 -std=c++17 -O0 -lnymphrpc -lPocoNet -lPocoUtil -lPocoFoundation -lPocoJSON clang: warning: -lnymphrpc: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lPocoNet: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lPocoUtil: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lPocoFoundation: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lPocoJSON: 'linker' input unused [-Wunused-command-line-argument] In file included from nymphcast_client.cpp:13: ./nymphcast_client.h:22:10: fatal error: 'nymph/nymph.h' file not found #include <nymph/nymph.h> ^~~~~~~~~~~~~~~ 1 error generated. make: *** [obj/static/nymphcast_client.o] Error 1 โžœ client_lib git:(master) โœ—

Did I miss something?

@Aftabx

Stange, I can't build the client anymore -->

Download or clone the project repository
Build the libnymphcast library in the src/client_lib folder using the Makefile in that folder: make lib.
[..]
Did I miss something?

That sounds like it cannot find the nymph.h header file for NymphRPC. Did you build and install NymphRPC?