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

Mips port #5570

Merged
merged 8 commits into from
Feb 1, 2015
Merged

Mips port #5570

merged 8 commits into from
Feb 1, 2015

Conversation

rbalint
Copy link
Contributor

@rbalint rbalint commented Oct 25, 2014

The attached patches makes XBMC build on mipsel (tested on CI20) and the GUI also runs with the patches back-ported to Gotham.
Currently master can't be started on MIPS due to a crash in the internal FFmpeg copy.

Updated for Helix by Balint Reczey
@@ -0,0 +1,115 @@
/*
* Copyright (C) 2005-2011 Team XBMC

This comment was marked as spam.

@MartijnKaijser
Copy link
Member

@topfs2 @wsnipex perhaps to a brief look?

@wsnipex
Copy link
Member

wsnipex commented Oct 27, 2014

looks ok to me build system wise. No idea about the atomics.

@fritsch
Copy link
Member

fritsch commented Oct 27, 2014

Was that at least once run tested?

2014-10-27 11:44 GMT+01:00 Wolfgang Schupp notifications@github.com:

looks ok to me build system wise. No idea about the atomics.

Reply to this email directly or view it on GitHub
#5570 (comment).

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

@MartijnKaijser
Copy link
Member

@fritsch see PR description ;)

@rbalint
Copy link
Contributor Author

rbalint commented Oct 27, 2014

@fritsch
Copy link
Member

fritsch commented Oct 27, 2014

Oki - this patch is for Gotham, which won't receive a 13.3 release - therefore getting it working in master (while fixing upstream ffmpeg issues) would be the prefered way.

Could I see the crashlog? Is it our internal ffmpeg only? Is that reported ffmpeg upstream?

@MartijnKaijser
Copy link
Member

personally i have no objection in including this into master if it doesn't affect any other platforms/build systems and gives others a way to start working on it. Crashes/improvements can be done as successive PRs @topfs2 ?

@FernetMenta
Copy link
Contributor

We should never ever merge untested code. I'd rather remove some other dead code than integrate something not tested.

@fritsch
Copy link
Member

fritsch commented Oct 27, 2014

That code is tested on Gotham (as I have read inthe PR). But including it
to master, when the OA directly says: it will crash, is something we should
not do. We should rather file bugs with upstream (ffmpeg) and get those
fixed. Afterwards we can get the PR in with the result of a) fixed ffmpeg
b) mips support.

2014-10-27 16:10 GMT+01:00 Rainer Hochecker notifications@github.com:

We should never ever merge untested code. I'd rather remove some other
dead code than integrate something not tested.

Reply to this email directly or view it on GitHub
#5570 (comment).

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

@MartijnKaijser
Copy link
Member

ok, for further discussion please open a forum thread. provide some logs using master branch and likely other can help out.

@rbalint
Copy link
Contributor Author

rbalint commented Nov 2, 2014

I have opened a thread here:
http://forum.kodi.tv/showthread.php?tid=207865

@MartijnKaijser MartijnKaijser added the Type: Feature non-breaking change which adds functionality label Nov 12, 2014
@rbalint
Copy link
Contributor Author

rbalint commented Jan 5, 2015

I managed to run patched Kodi 14.0 using --with-ffmpeg=shared configure option with the ffmpeg packages here:
https://people.debian.org/~rbalint/ppa/xbmc-ffmpeg/xbmc-ffmpeg-wheezy-backports/
I can post a screenshot of the GUI running, but playing video still crashes in the vendor-provided libPVROGL_MESA.so.1.11.2580795 like with XBMC.
I have already reported the issue here:
https://groups.google.com/d/topic/mips-creator-ci20/zZOm38HX81g

@AndriyP
Copy link
Contributor

AndriyP commented Jan 13, 2015

I was little bit late with own pr #5759 :-) But it works fine. While this PR is not merged please include next fix:

Kodi builds libXBMC_addon-mips.so but during loading binary addons expects libXBMC_addon-mipsel-linux.so. And as result Kodi cant load any binary addon. So that names should be synced. Fix is below.

--- a/addons/library.xbmc.addon/libXBMC_addon.h
+++ b/addons/library.xbmc.addon/libXBMC_addon.h
@@ -55,8 +55,8 @@ typedef intptr_t      ssize_t;
 #define ADDON_HELPER_ARCH       "powerpc64-linux"
 #elif defined(__ARMEL__)
 #define ADDON_HELPER_ARCH       "arm"
-#elif defined(_MIPSEL)
-#define ADDON_HELPER_ARCH       "mipsel-linux"
+#elif defined(__mips__)
+#define ADDON_HELPER_ARCH       "mips"
 #else
 #define ADDON_HELPER_ARCH       "i486-linux"
 #endif

@AndriyP
Copy link
Contributor

AndriyP commented Jan 13, 2015

Currently master can't be started on MIPS due to a crash in the internal FFmpeg copy.

Maybe I can help, my build works with internal ffmpeg.

@rbalint
Copy link
Contributor Author

rbalint commented Jan 17, 2015

@AndriyP Thanks, I have added your patch to the PR. Do I understand correctly that this PR works for you? In that case @MartijnKaijser could it please be merged?

@AndriyP
Copy link
Contributor

AndriyP commented Jan 19, 2015

To be precisely, I am working with build that doesnt have asm mips atomic operations that you added in this PR. All rest changes are same, I didnt tried to pick up atomic operations because it works without as well. Will integrate them when this PR will be merged.

Regarding FFMPEG for our platform I had to disable some specific MIPS optimization. Here additional ffmpeg configure options added for internal build:

--disable-mips32r2 \
--disable-mipsdspr1 \
--disable-mipsdspr2

Maybe it make sense to disable them by default. It can be enabled for specific platform with that CPU features on demand.

@rbalint
Copy link
Contributor Author

rbalint commented Jan 19, 2015

@AndriyP Most probably those flags made the trick. They are used during the ffmpeg package build as well: https://buildd.debian.org/status/fetch.php?pkg=ffmpeg&arch=mipsel&ver=7%3A2.5.3-1&stamp=1421595399
Since those are platform specific I don't think they should be used in Kodi's build scripts by default.
@fritsch Could this PR please be merge since it has been tested by two of us?

*/

#ifndef __ATOMIC_MIPS_H_
#define __ATOMIC_MIPS_H_

This comment was marked as spam.

@AndriyP
Copy link
Contributor

AndriyP commented Jan 19, 2015

Since those are platform specific I don't think they should be used in Kodi's build scripts by default.

Have same opinion. So maybe it make sense to change this in this PR?

@rbalint
Copy link
Contributor Author

rbalint commented Jan 19, 2015

@AndriyP No, I mean we should not add "--disable-mips32r2" etc. , just use the defaults like now.

@wsnipex
Copy link
Member

wsnipex commented Jan 19, 2015

please add the needed flags to https://github.com/xbmc/xbmc/blob/master/tools/depends/target/ffmpeg/Makefile
if native building on mips should be supported, then in https://github.com/xbmc/xbmc/blob/master/tools/depends/target/ffmpeg/autobuild.sh as well

@AndriyP
Copy link
Contributor

AndriyP commented Jan 19, 2015

@rbalint I thought that mipsr2 and dsp support is platform specific. And "default" is minimum optimisation to cover more platforms.

@rbalint
Copy link
Contributor Author

rbalint commented Jan 21, 2015

Kodi starts and plays video using SW rendering with the patches in the PR:
http://balintreczey.hu/blog/xbmc-from-debian-running-on-mips-ci20-dev-board
@AndriyP I meant we could ask FFmpeg leave mipsr2 and dsp support disabled by default (use GCC's default), but I have added the configure flags here now..

@rbalint
Copy link
Contributor Author

rbalint commented Jan 28, 2015

@MartijnKaijser @fritsch @wsnipex @FernetMenta Is there anything missing I should do in this PR?

@wsnipex
Copy link
Member

wsnipex commented Jan 28, 2015

its fine from my side. jenkins build this please

@FernetMenta
Copy link
Contributor

I am fine with it, thanks

@rbalint
Copy link
Contributor Author

rbalint commented Jan 28, 2015

@MartijnKaijser sorry fixed the date now
@wsnipex the build seems to be failing due to a problem elsewhere and the problem has been fixed in an other PR already

@MartijnKaijser
Copy link
Member

jenkins build this please

@MartijnKaijser
Copy link
Member

You still have the old header in it. The address mentioned there is wrong. Fix it and squash into the correct commit

@rbalint
Copy link
Contributor Author

rbalint commented Jan 29, 2015

@MartijnKaijser done.

@MartijnKaijser
Copy link
Member

thx
jenkins build this please

@wsnipex
Copy link
Member

wsnipex commented Jan 31, 2015

jenkins build this please

@bkuhls
Copy link
Contributor

bkuhls commented Jan 31, 2015

Hi, just a comment: using buildroot with a Sourcery CodeBench toolchain (mips-2014.11-22-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2), current Kodi git master, your patch and a tweaked Kodi buildroot package (to enable mips support) I could compile a mips binary. Due to lack of mips hardware I could not do a run-time test though.


Kodi Configuration:

Kodi Version: 15.0-ALPHA1
git Rev.: db54f53
Debugging: No
Profiling: No
Optimization: Yes
SWIG Available: Yes
JRE Available: Yes
Doxygen Available: No
Crosscomp.: Yes
target ARCH: mips
target CPU:
OpenGL: Yes
ALSA: Yes
DBUS: No
VDPAU: No
VAAPI: Yes
VTBDecoder: No
OpenMax: No
Joystick: No
XRandR: Yes
Waveform: Yes
Spectrum: Yes
GOOM: Yes
RSXS: Yes
FishBMC: Yes
ProjectM: No
Touch skin: No
X11: Yes
Wayland: No
Bluray: Yes
TexturePacker:Yes
MID Support: No
ccache: No
ALSA Support: Yes
PulseAudio: No
DVDCSS: Yes
Google Test Framework Configured: Yes
Avahi: No
mDNSEmbedded: No
Non-free: Yes
ASAP Codec: No
MySQL: No
Webserver: Yes
libssh support: No
libRTMP support: Yes
libsmbclient support: Yes
libnfs client support:Yes
libafpclient support: No
AirPlay support: Yes
AirTunes support (libshairplay): Yes
UPnP support: Yes
Optical drive: Yes
libudev support: Yes
libusb support: No
libcec support: Yes
libcap support: No
additional players: No
additional codecs: No
PVR add-ons: No
prefix: /usr

$ file output/target/usr/lib/kodi/kodi.bin
output/target/usr/lib/kodi/kodi.bin: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.32, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, not stripped

wsnipex added a commit that referenced this pull request Feb 1, 2015
@wsnipex wsnipex merged commit b217174 into xbmc:master Feb 1, 2015
@rbalint rbalint deleted the mips branch February 1, 2015 10:51
@MartijnKaijser MartijnKaijser modified the milestone: I******* 15.0-alpha1 Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature non-breaking change which adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants