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

Merge UxPlay gstreamer renderer into RPiPlay, allowing generic linux builds #146

Merged
merged 20 commits into from Sep 4, 2020

Conversation

dougg3
Copy link

@dougg3 dougg3 commented Jul 26, 2020

I stumbled upon issue #98 where @antimof announced the creation of UxPlay, which is a port of RPiPlay that uses gstreamer for rendering rather than Pi-specific libraries. It works really well on my generic Linux machines -- thanks @antimof! I'm also aware of issue #24 where generic Linux support has been discussed. I wanted to figure out a way to merge UxPlay's gstreamer renderer back into the original project.

This branch is my first attempt at this. I believe I've preserved the commit history and original author info for UxPlay in the process. Is this the most appropriate way to do this? UxPlay isn't considered a fork on GitHub, so merging is a little tricky.

The strategy I went with is to supply the renderer as a compile-time option to CMake when you build it. (Anybody have any better suggestions?) Here is my build command:

cmake .. -DRENDERER=gstreamer

I made it default to use the existing OpenMAX renderer if you don't supply the -DRENDERER option, so nothing changes automatically for people who build it for Pi.

Is this an acceptable strategy for choosing the renderer? I didn't want to break anybody's existing workflow. I considered figuring out how to autodetect the Pi and automatically choose which renderer to use based on that, but I've also seen some interest in trying out the gstreamer renderer on the Pi itself, so I thought the solution I ended up with might work best.

I've updated README.md with basic compilation instructions for the generic Linux version. @antimof I hope you don't mind me doing this merge -- I think you did a fantastic job on the gstreamer renderer! I wanted to see your work get upstreamed.

This is untested on the Pi itself. I've been running it on a generic Ubuntu 18.04 machine. Unfortunately I don't have a Pi that is new enough to test this. Here's hoping this leads to more experimentation with other renderers!

@FD-
Copy link
Owner

FD- commented Jul 26, 2020

Thanks for all this effort! I wasn’t sure what @antimof’s plans on UxPlay were, since he originally promised to upstream his work once it got to a certain point of maturity, yet the development seems to have stalled. The build flag seems like a great choice for adding this in an unobtrusive way! I’ll have a closer look in the following days!

@FD-
Copy link
Owner

FD- commented Jul 27, 2020

I'm afraid I can't get this to work on my Pi 3B+ with the last Raspbian Lite build before it was renamed Raspberry OS (from March 2020; the OS I already had on an sd card). Initially, RPiPlay reported the lack of the autodetect plugin:

Required gstreamer plugin 'autodetect' not found
rpiplay: /home/pi/rpiplay/RPiPlay/renderers/video_renderer_gstreamer.c:63: video_renderer_init: Assertion `check_plugins ()' failed.
Aborted

I had only followed the steps you included for Ubuntu, so I figured I just had to install some more gstreamer plugins, so I installed a few that seemed like they could be required:

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-pulseaudio

At this point, the program was starting successfully, I just couldn't get it to render any audio or video. The screen just stayed on the console display. I also installed the gstreamer1.0-omx-rpi package via apt, but that didn't change anything. I'm afraid I know far too little about libgstreamer. Do I have to manually specify what plugin I want it to use?

@dougg3
Copy link
Author

dougg3 commented Jul 27, 2020

Hmmm...I agree with everything you did at first to get past the missing plugins. The next step in my mind would be to run rpiplay with the GST_DEBUG environment variable set to something:

GST_DEBUG=3 ./rpiplay

As soon as you connect, it should print some info about what is failing inside of GStreamer.

@FD-
Copy link
Owner

FD- commented Jul 27, 2020

We're getting somewhere! This is the output I saw initially:

GST_DEBUG=3 ./rpiplay -n ABC
0:00:00.517250932  9801  0x1675f80 WARN                gleglgbm gstgl_gbm_utils.c:472:gst_gl_gbm_find_and_open_drm_node: Found no matching DRM devices
0:00:00.517391505  9801  0x1675f80 ERROR              gldisplay gstgldisplay_gbm.c:394:gst_gl_display_gbm_new: could not find or open DRM device
0:00:00.521005702  9801  0x1675f80 WARN                glwindow gstglwindow.c:293:gst_gl_window_new: Could not create window. user specified (null), creating dummy window
0:00:00.521717989  9801  0x1671b50 WARN               glcontext gstglcontext.c:1244:gst_gl_context_create_thread:<glcontextegl0> Failed to create context
0:00:00.521826009  9801  0x1675f80 WARN             glimagesink gstglimagesink.c:1012:_ensure_gl_setup:<sink> error: Failed to initialize egl: EGL_NOT_INITIALIZED
0:00:00.524010944  9801  0x1671bb0 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<video_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.565032784  9801  0x1675f80 WARN                   pulse pulsesink.c:615:gst_pulseringbuffer_open_device:<autoaudiosink0-actual-sink-pulse> error: Failed to connect: Connection refused

So, it seems like gstreamer is trying to use an OpenGL video renderer and the Pulse audio renderer. The latter is sure to fail, because Raspbian doesn't include a Pulse server. I uninstalled the gstreamer1.0-pulseaudio package, and now it seems audio on the HDMI is working via omx:

GST_DEBUG=3 ./rpiplay -n ABC
error: XDG_RUNTIME_DIR not set in the environment.
0:00:00.212003227  9990   0x9a5da0 WARN                gleglgbm gstgl_gbm_utils.c:472:gst_gl_gbm_find_and_open_drm_node: Found no matching DRM devices
0:00:00.212164372  9990   0x9a5da0 ERROR              gldisplay gstgldisplay_gbm.c:394:gst_gl_display_gbm_new: could not find or open DRM device
0:00:00.215625498  9990   0x9a5da0 WARN                glwindow gstglwindow.c:293:gst_gl_window_new: Could not create window. user specified (null), creating dummy window
0:00:00.216379295  9990   0x9a0750 WARN               glcontext gstglcontext.c:1244:gst_gl_context_create_thread:<glcontextegl0> Failed to create context
0:00:00.216483201  9990   0x9a5da0 WARN             glimagesink gstglimagesink.c:1012:_ensure_gl_setup:<sink> error: Failed to initialize egl: EGL_NOT_INITIALIZED
0:00:00.218659438  9990   0x9a07b0 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<video_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
0:00:00.240935869  9990   0x9a0860 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<audio_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Accepted IPv4 client on socket 26
Local: 192.168.178.77
Remote: 192.168.178.23
Accepted IPv4 client on socket 28
Local: 192.168.178.77
Remote: 192.168.178.23
Found an unknown parameter: volume
raop_rtp_mirror starting mirroring
0:00:03.833962367  9990   0x9a0780 WARN               decodebin gstdecodebin2.c:4640:gst_decode_bin_expose:<decodebin0> error: no suitable plugins found:
Missing decoder: H.264 (video/x-h264, stream-format=(string)byte-stream)

0:00:03.848140512  9990   0x9a07b0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<video_source> error: Internal data stream error.
0:00:03.848770144  9990   0x9a07b0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<video_source> error: streaming stopped, reason not-linked (-1)
0:00:03.849538213  9990   0x9a07b0 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue0> error: Internal data stream error.
0:00:03.850013939  9990   0x9a07b0 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue0> error: streaming stopped, reason not-linked (-1)
raop_rtp starting audio
0:00:17.520965182  9990 0x6e4039b0 WARN               audiosink gstaudiosink.c:218:audioringbuffer_thread_func:<autoaudiosink0-actual-sink-omxhdmiaudio> failed to set thread priority
^CStopping...
Removing connection for socket 26
Destroying connection
Removing connection for socket 28
Destroying connection
0:01:34.458623087  9990   0x9a0630 WARN                   libav gstavauddec.c:670:gst_ffmpegauddec_drain:<avdec_aac0> send packet failed, could not drain decoder

Even better, I removed the gstreamer1.0-omx-rpi package, and could get ALSA audio to work:

sudo GST_DEBUG=3 ./rpiplay -n ABC
error: XDG_RUNTIME_DIR not set in the environment.
0:00:00.421232346 10306  0x15cac20 WARN                gleglgbm gstgl_gbm_utils.c:472:gst_gl_gbm_find_and_open_drm_node: Found no matching DRM devices
0:00:00.421389220 10306  0x15cac20 ERROR              gldisplay gstgldisplay_gbm.c:394:gst_gl_display_gbm_new: could not find or open DRM device
0:00:00.424803977 10306  0x15cac20 WARN                glwindow gstglwindow.c:293:gst_gl_window_new: Could not create window. user specified (null), creating dummy window
0:00:00.425673135 10306  0x15d3550 WARN               glcontext gstglcontext.c:1244:gst_gl_context_create_thread:<glcontextegl0> Failed to create context
0:00:00.425776155 10306  0x15cac20 WARN             glimagesink gstglimagesink.c:1012:_ensure_gl_setup:<sink> error: Failed to initialize egl: EGL_NOT_INITIALIZED
0:00:00.427926133 10306  0x15d35b0 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<video_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.445963401 10306  0x15d2060 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<audio_source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Initialized server socket(s)
*** WARNING *** The program 'rpiplay' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Accepted IPv4 client on socket 26
Local: 192.168.178.77
Remote: 192.168.178.23
Accepted IPv4 client on socket 28
Local: 192.168.178.77
Remote: 192.168.178.23
Found an unknown parameter: volume
raop_rtp_mirror starting mirroring
0:00:06.597888616 10306  0x15d3580 WARN               decodebin gstdecodebin2.c:4640:gst_decode_bin_expose:<decodebin0> error: no suitable plugins found:
Missing decoder: H.264 (video/x-h264, stream-format=(string)byte-stream)

0:00:06.607278887 10306  0x15d35b0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<video_source> error: Internal data stream error.
0:00:06.607892996 10306  0x15d35b0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<video_source> error: streaming stopped, reason not-linked (-1)
0:00:06.608659551 10306  0x15d35b0 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue0> error: Internal data stream error.
0:00:06.609157462 10306  0x15d35b0 WARN                   queue gstqueue.c:988:gst_queue_handle_sink_event:<queue0> error: streaming stopped, reason not-linked (-1)
raop_rtp starting audio
0:00:19.238077575 10306  0x15d3430 WARN                    alsa conf.c:4871:parse_args: alsalib error: Unknown parameter AES0
0:00:19.238907202 10306  0x15d3430 WARN                    alsa conf.c:5031:snd_config_expand: alsalib error: Parse arguments error: No such file or directory
0:00:19.239482352 10306  0x15d3430 WARN                    alsa pcm.c:2565:snd_pcm_open_noupdate: alsalib error: Unknown PCM default:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:19.277220260 10306  0x15d3430 WARN                    alsa pcm_hw.c:1355:snd_pcm_hw_get_chmap: alsalib error: Cannot read Channel Map ctl
: No such file or directory
0:00:19.286450742 10306 0x727037b0 WARN               audiosink gstaudiosink.c:218:audioringbuffer_thread_func:<autoaudiosink0-actual-sink-alsa> failed to set thread priority

Still, I don't know what it takes to get some video renderer to work. Preferably, I'd like to see the omx-rpi video renderer working.

(I also initially saw some traces of a failed attempt to use the X renderer, but I don't have a copy of the output I saw and have since uninstalled the gstreamer X module, since I'm on a Raspbian Lite system without an X server)

@FD-
Copy link
Owner

FD- commented Jul 27, 2020

Well, seems like gstreamer-omx has been broken on the Pi for years: https://www.raspberrypi.org/forums/viewtopic.php?t=193152

@dougg3
Copy link
Author

dougg3 commented Jul 28, 2020

Interesting...it looks like in your latest traces, the problem is it can't find a plugin for H.264 decoding:

Missing decoder: H.264 (video/x-h264, stream-format=(string)byte-stream)

I haven't tried testing this without an actual X server running, so there might be more work to get it to actually run on the Raspberry Pi itself, especially without a window server. The link you found about gstreamer-omx is interesting too. I noticed that in some of the sample GStreamer pipelines, they are manually specifying omxh264dec. I wonder if we have to do something similar on this. I might be able to play a little bit with a super old Raspberry Pi Model B, not sure if that's even going to be compatible...but I can try at least!

@dougg3
Copy link
Author

dougg3 commented Jul 28, 2020

I played around on my Pi Model B (Raspbian 10). Stock RPiPlay works pretty well. If I build my branch, it actually does work if you run it within X11, but it's super slow, almost like it's not using hardware decoding. It can't keep up with all of the frames, so it ends up with a huge backlog of frames. Here is what I have installed relating to gstreamer:

pi@raspberrypi:~/RPiPlay/build $ apt list --installed | grep gstream

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gir1.2-gstreamer-1.0/stable,now 1.14.4-1 armhf [installed,automatic]
gstreamer0.10-alsa/testing,now 0.10.36-2 armhf [installed,automatic]
gstreamer0.10-plugins-base/testing,now 0.10.36-2 armhf [installed,automatic]
gstreamer1.0-alsa/stable,now 1.14.4-2 armhf [installed]
gstreamer1.0-gtk3/testing,now 1.14.4-1+rpt1 armhf [installed,automatic]
gstreamer1.0-libav/stable,now 1.15.0.1+git20180723+db823502-2 armhf [installed]
gstreamer1.0-omx-rpi-config/testing,now 1.14.4-1+rpt1 armhf [installed,automatic]
gstreamer1.0-omx-rpi/testing,now 1.14.4-1+rpt1 armhf [installed,automatic]
gstreamer1.0-omx/testing,now 1.14.4-1+rpt1 armhf [installed]
gstreamer1.0-plugins-bad/stable,now 1.14.4-1+b1 armhf [installed]
gstreamer1.0-plugins-base/stable,now 1.14.4-2 armhf [installed]
gstreamer1.0-plugins-good/testing,now 1.14.4-1+rpt1 armhf [installed]
gstreamer1.0-vaapi/stable,now 1.14.4-1 armhf [installed]
gstreamer1.0-x/stable,now 1.14.4-2 armhf [installed]
libgstreamer-gl1.0-0/stable,now 1.14.4-2 armhf [installed,automatic]
libgstreamer-plugins-bad1.0-0/stable,now 1.14.4-1+b1 armhf [installed,automatic]
libgstreamer-plugins-base0.10-0/testing,now 0.10.36-2 armhf [installed,automatic]
libgstreamer-plugins-base1.0-0/stable,now 1.14.4-2 armhf [installed,automatic]
libgstreamer-plugins-base1.0-dev/stable,now 1.14.4-2 armhf [installed]
libgstreamer0.10-0/testing,now 0.10.36-1.5 armhf [installed,automatic]
libgstreamer1.0-0/stable,now 1.14.4-1 armhf [installed,automatic]
libgstreamer1.0-dev/stable,now 1.14.4-1 armhf [installed]
libreoffice-avmedia-backend-gstreamer/now 1:6.1.5-3+rpi1+deb10u2 armhf [installed,upgradable to: 1:6.1.5-3+rpi1+deb10u6+rpt1]

Here is a link to a screenshot of it in action.

Obviously not usable on the Pi in its current state unless we can figure out how to accelerate it...but it does run great on desktop Linux.

@FD-
Copy link
Owner

FD- commented Aug 4, 2020

Ok, even if the gstreamer renderers don't provide any advantage on the Pi, I'm still willing to merge them in. I'm just not sure whether I should do that on the master branch or on an extra branch. What are your thoughts?

@pallas
Copy link
Collaborator

pallas commented Aug 4, 2020

I've looked at both gstreamer and ffmpeg, and it seems like omx_mmal is supported by the latter but not the former. I was trying to figure out how to do ffmpeg intergation, but an alternative path is to add a switch that either chooses the existing code or the gstreamer code. I'd rather not have to install gstreamer if I'm using the OMX code though.

tl;dr: a CMake flag is probably good? but better would be to use ffmpeg or to integrate OMX MMAL into gstreamer.

@pallas
Copy link
Collaborator

pallas commented Aug 4, 2020

Also: this is a great step forward!

@dougg3
Copy link
Author

dougg3 commented Aug 5, 2020

I played around with GStreamer on my Pi some more over the weekend and came to the conclusion that GStreamer currently doesn't support displaying to the screen on the Raspberry Pi the way that OMXPlayer does. It does seem to support hardware H.264 decoding/encoding, but the accelerated playback seems to depend on OpenGL stuff which I couldn't figure out how to get working properly.

Yeah...@pallas I think this might be what you are already saying, but it would be cool to make a GStreamer sink that displays video the same way that OMXPlayer (and RPiPlay) does it. I think that would be the ultimate awesome solution to actually enable using gstreamer on this project on the Pi. Does FFmpeg by itself actually support displaying anything? I was kind of under the impression it was more of a decoding library, in fact I believe gstreamer can use it.

I thought more about the renderer selection and CMake vs. runtime: One idea is we could refactor things a bit to make the renderer a runtime selection, and then compile renderers into RPiPlay based on their availability. So if the OMX libraries are available, it would compile the OMX renderer. If gstreamer is available, it would compile the gstreamer renderer. If they're both available, it would compile both. With an optional runtime switch to choose which one (it would default to the OMX renderer if available). This would make it easy because no matter what platform you're on, you just do cmake and make.

My personal reason for trying to get this merged back into the main project was simply to allow RPiPlay to operate on platforms other than Raspberry Pi (despite the name, haha). From that perspective I think it would be cool if it was in the master branch with special build instructions for non-Raspberry-Pi systems. (Although if we implement what I said above and auto-detect which renderers to build, special build instructions might not even be necessary...)

I would be willing to spend more time cleaning things up if there are any style/usability/documentation/etc. hesitations about the current state of my branch being merged into the master...or if we need me to do something like the refactor described above before it gets merged. What do you guys think? Or am I barking up the wrong tree about wanting to make it so RPiPlay is by default compatible with other types of systems? Whew, sorry for the long-winded comment! Thanks!

@FD-
Copy link
Owner

FD- commented Aug 5, 2020

Thanks for your comments! I agree the compilation system you describe would be convenient, but as long as the gstreamer renderer is lacking in functionality (most of the additional display flags are unsupported), having to explicitly enable the gstreamer build is perfectly adequate IMHO. I'll have a final closer look with regards to coding style etc and will merge the PR in the following days.

@dougg3
Copy link
Author

dougg3 commented Aug 7, 2020

Thanks, I look forward to finding a way to merge this back in!

I don't know if there's any interest in this, but I thought I would mention that I just finished an experimental refactor in another branch that allows runtime selection of different renderers. It compiles every available renderer based on what CMake can find at compile time. You can even do OpenMAX video and gstreamer audio, for example, although they get out of sync. For example:

./rpiplay -n PiTest -vr rpi -ar gstreamer

https://github.com/dougg3/RPiPlay/tree/refactor-renderers

@wegank
Copy link

wegank commented Aug 10, 2020

I managed to build UxPlay on macOS by fixing several CMakeLists, however the OpenGL render window would not open unless I add a GLib event loop in uxplay.cpp, according to this. I wonder if it's possible to add a patch somewhere else to avoid conflict with this project.

Here’s my repo. Hope that helps.

@dougg3
Copy link
Author

dougg3 commented Aug 11, 2020

Nice work @wegank! Seems like it would be a good idea to merge your changes into this too, so it would build properly for macOS. It would be cool to get it working on Windows too.

@wegank
Copy link

wegank commented Aug 12, 2020

@dougg3 It actually does work on Windows, but one has to install the GStreamer runtime (custom installation in order to select gst-libav) and Bonjour services, then add GStreamer/bin folder to PATH. Painful though.

@ragazzonoioso
Copy link

ragazzonoioso commented Aug 17, 2020

raop_ntp receive timeout

@wegank, the audio works but there is not any video on Ubuntu 20.04.

➜ build git:(master) ./ludimus
Initialized server socket(s)
*** WARNING *** The program 'ludimus' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
Accepted IPv4 client on socket 30
Local: 192.168.0.100
Remote: 192.168.0.107
Accepted IPv4 client on socket 34
Local: 192.168.0.100
Remote: 192.168.0.107
Found an unknown parameter: volume
raop_rtp_mirror starting mirroring
raop_ntp receive timeout

@wegank
Copy link

wegank commented Aug 17, 2020

raop_ntp receive timeout

the audio works but there is not any video on Ubuntu 20.04.

➜ build git:(master) ./ludimus
Initialized server socket(s)
*** WARNING *** The program 'ludimus' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
Accepted IPv4 client on socket 30
Local: 192.168.0.100
Remote: 192.168.0.107
Accepted IPv4 client on socket 34
Local: 192.168.0.100
Remote: 192.168.0.107
Found an unknown parameter: volume
raop_rtp_mirror starting mirroring
raop_ntp receive timeout

I think this may help.

@dougg3
Copy link
Author

dougg3 commented Aug 17, 2020

@ragazzonoioso The ntp receive timeout is something I noticed as well and have an experimental fix in another branch. Doesn't seem to really hurt the mirroring functionality though.

Have you installed gstreamer1.0-plugins-bad? I noticed it wouldn't work without it.

@ragazzonoioso
Copy link

ragazzonoioso commented Aug 17, 2020

@ragazzonoioso The ntp receive timeout is something I noticed as well and have an experimental fix in another branch. Doesn't seem to really hurt the mirroring functionality though.

Have you installed gstreamer1.0-plugins-bad? I noticed it wouldn't work without it.

@dougg3, @wegank, Thank u so much! Now it work!

p.s.
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c

apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

@FD-
Copy link
Owner

FD- commented Aug 22, 2020

@dougg3 Do you still want me to merge this PR in or are you working on another PR for the dynamic renderer selection? @wegank Would you be willing to upstream your changes to support macOS builds?

@wegank
Copy link

wegank commented Aug 22, 2020

@FD- I couldn't find a way to avoid calling GLib / GStreamer in rpiplay.cpp, so it seems inappropriate to upstream certain changes that can mess up files other than renderers...

@dougg3
Copy link
Author

dougg3 commented Aug 22, 2020

If everyone's in agreement, I personally think the dynamic renderer selection capability would be better than merging this pull request. (It's just another commit on top of this one though). It's basically there, I just need to give it another pass to make sure I got everything and bring the documentation up to date. It might be nice to figure out a way to detect other missing GStreamer plugins too -- it seems as though it's common for people to not have the correct GStreamer packages installed for H.264 decoding support.

On the macOS front -- could we figure out a way to use the glib main loop instead of the "while (running)" loop when a gstreamer renderer is being used? I imagine it wouldn't be too hard to figure out, and I doubt it would adversely affect the Linux build, especially if it was only used when a gstreamer renderer was being selected.

@wegank
Copy link

wegank commented Aug 22, 2020

@dougg3 I‘m actually using the GLib main loop instead btw.

@dougg3
Copy link
Author

dougg3 commented Aug 23, 2020

Ah, that's cool @wegank! I think I saw an earlier version before you got it fully replaced. I personally think we could figure out a way to incorporate that code going forward whenever a gstreamer renderer is in use.

@FD- I have merged the dynamic renderer selection into this same pull request. I also found some style issues and fixed them. Let me know if you would rather do this a different way.

@FD-
Copy link
Owner

FD- commented Sep 2, 2020

Sorry for the delay! Tested to still work on Pi now, so about to push the button.

@FD-
Copy link
Owner

FD- commented Sep 2, 2020

Well, wait, there seem to be conflicts that prevent merging?

@dougg3
Copy link
Author

dougg3 commented Sep 2, 2020

I wonder if it has something to do with the way that I tried to preserve @antimof's commit history when I created my branch. I had to do some trickery allowing UxPlay to merge into my branch, even though they don't have a common history.

It's weird because GitHub says it has no conflicts with the base branch...

@FD-
Copy link
Owner

FD- commented Sep 2, 2020

Yeah, I bet it’s related to that. GitHub tells me:

This branch cannot be rebased due to conflicts
Rebasing the commits of this branch on top of the base branch cannot be performed automatically due to conflicts encountered while reapplying the individual commits from the head branch.

@dougg3
Copy link
Author

dougg3 commented Sep 3, 2020

Drats, thanks for the heads up. I will play with things when I have some free time and try to figure it out.

@pallas
Copy link
Collaborator

pallas commented Sep 3, 2020

Can you rebase in your local repo vs. FD-'s master branch?

@pallas
Copy link
Collaborator

pallas commented Sep 3, 2020

Also, I'm pretty excited for this!

antimof and others added 20 commits September 2, 2020 19:35
After merging the gstreamer renderers from UxPlay, this project needed a
method for choosing which renderer to build into the program. I opted
for supplying a CMake variable describing which renderer you wish to
use. For backwards-compatibility, it defaults to selecting the openmax
renderer that RPiPlay has historically used.

Because the gstreamer renderer doesn't support several of the options
that are supported by the openmax renderer, those options are removed
from the help output in a gstreamer build.
This change makes it possible to select video and audio renderers at
runtime. It's also possible to mix and match different renderers for
audio versus video.

All available renderers are automatically compiled into the renderers
library. It should always succeed with at least the dummy renderer.
This adds an explanation for how to choose different renderers.
This plugin contains the H.264 parser required for video to work
properly. This is the easiest way to require that
gstreamer1.0-plugins-bad has to be installed.
Tried to match the rest of the project's code style.
Also documents the -vr and -ar options.
%llu isn't correct on 64-bit Linux, where it should actually be %lu.
On 32-bit systems, %llu is correct. A simple way to work around this is
to use the PRIu64 format specifier introduced in C99.
@dougg3
Copy link
Author

dougg3 commented Sep 3, 2020

Hey, thanks for the tip @pallas! I think I got it figured out and updated the pull request. Doing a "git push -f" scared the heck out of me, but it looks like the end result is the same as it used to be. From what I can tell, the list of commits is way cleaner now too, so yay. Also, I figured out how to fix the first commit from UxPlay that was previously mistakenly attributed to "No Name" and now it's attributed to @antimof.

@FD- I think this is ready for reals now.

@FD- FD- merged commit 576c5a6 into FD-:master Sep 4, 2020
@FD-
Copy link
Owner

FD- commented Sep 4, 2020

Fantastic! Thanks a lot for your contribution!

@dougg3 dougg3 deleted the merge-uxplay branch September 5, 2020 03:33
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

Successfully merging this pull request may close these issues.

None yet

6 participants