RaspberryPI support #1282

merged 62 commits into from Sep 4, 2012

This PR brings RaspberryPI support to XBMC. :

1.) Library wrapper for the host and omx implementation.

2.) EGL windowing support.

The EGL windowing needed some enhancments to get the full fange of display modes. Android needs testing if the changes do not break it.

3.) Additional pseudo 3D display modes for the PI.

We are able to use 3D modes on the PI. XBMC does not render the GUI double, this done by the firmware. For this there are new 3D modes.

4.) OMXPlayer.

OMXPlayer is an aditional player for the PI, close based on DVDPlayer. The player does not use AE out of the OMX nature. It is also able to use hardware audio decoding when the user has the licence for it.

5.) Changes to the player selection.

The default player selection in xbmc is too cosy with DVDPlayer.

6.) Build infrastructure simmiliar to android.

The forgotten points are in the source ..... ;)

huceke added some commits Aug 10, 2012
@huceke huceke [rbp] added raspberrypi toolchain support files 3cbb14a
@huceke huceke [rbp] added raspberrypi platform support files e2f5d99
@huceke huceke [rbp] added raspberrypi support to system globals 88ad708
@huceke huceke [rbp] added linux event for sdle less builds 0384505
@huceke huceke [rbp] added to non asm version of mathutils 9871aca
@huceke huceke [rbp] added raspberrypi support to xbmc app af49207
@huceke huceke [rbp] adadded raspberrypi openmax support 5dda4e6
@huceke huceke [rbp] AE enable rapsberrypi and disable asm in converter 14a4011
@huceke huceke [rbp] added raspberrypi EGL support plus a pseudo 3D mode for 3D output b0f57b8
@huceke huceke [rbp] added raspberrypi as.xml settings b144fd2
@huceke huceke [rbp] added raspberrypi guisetting tweaks 05cee69
@huceke huceke [rbp] include refresh rate in resolution check so we see all and get …
…the right one
@huceke huceke [rbp] added missing EGL files from b0f57b850b5b51710f84e94e94a5125d82…
@huceke huceke [rbp] added raspberrypi omxplayer a91e874
@huceke huceke [rbp] fix blending with gui during hw-rendered playback d7b9041
@huceke huceke [rbp] added raspberrypi omx image decoding 8bd067d
@huceke huceke [rbp] added raspberrypi support to our configure system 6b37a4c
@huceke huceke [rbp] cec: added support for the Raspberry Pi. needs libCEC v1.8.0+. …
…other targets are still supported by libCEC 1.7.0
@huceke huceke [rbp] added a minimal doc file 5182b60
@huceke huceke [rbp] fixed linux compile d9a4065
@huceke huceke [rbp] fixed protect return vales in peripherals too bedd4af
@huceke huceke [rbp] changed limit jpeg decoding to half width and height. this is a…
… workaround for the PI's limited memory
@huceke huceke [rbp] fixed channel mapping. thx popcornmix for finding it 1892d3d
@huceke huceke [rbp] fixed crash in thumbnail extraction. disable all ffmpeg cpu opt…
…ions for now, until we figgured out which ones are safe to use on the PI arm core
@huceke huceke [rbp] changed, we can now turn on optimizations. configure doesn't me…
…ss anymore with our settings
@huceke huceke [rbp] fixed channel mapping for hwdecode path. thx popcornmix for fin…
…ding it
@huceke huceke [rbp] fixed do not force dvdplayer for rtmp streams d11a167
@huceke huceke [rbp] fixed only volume boost on downmix. thx popcornmix for finding it 7d0e8be
@huceke huceke [rbp] changed playercorefactory should be more friendly to other play…
…ers than DVDPlayer only

@opdenkamp : Do so. Thx


@Memphiz : https://github.com/huceke/xbmc/blob/6b37a4c8ec605689aee9b8625aec0c41764f21b4/configure.in#L895 comes out of the android merge. It is not PI speciffic.

Edit: My bad, missunderstanding.

huceke and others added some commits Aug 13, 2012
@huceke huceke [rbp] added missing mode from b0f57b850b5b51710f84e94e94a5125d82017580 7faf411
@huceke huceke [rbp] fixed, removed redudant grypt check and default use_alsa for al…
…l platforms.
@huceke huceke [rbp] fixed, hanewin patch not needed for libnfs 1.3.0 88960bd
@huceke huceke [rbp] fixed, do not hardcode library in omx library wrapper. 297988b
huceke [rbp] fixed asm usage in AEConvert. i was told that this is NEON code. acbfa94
huceke [rbp] fixed libsquish native arm compile 8b6af54
@huceke huceke [rbp] fixed acbfa940dc07911d1658ce16b06fa4b9e972eb35 the asm works on…
… ARM NEON and VFP. thx Cory
@huceke huceke [rbp] fixed 8b6af545b317b5b0cd792f1c77e17cb95a60fe69. propper compile…
… fix for libsquish. thx Cory
@huceke huceke [rbp] revert c853cb6614ac8367fa3c7ace04a943af84882199 and added refre…
…shrate to WinSystem base so we can store and check it in the EGL windowing. My understanding how XBMC handles refreshrates was wrong, missed the point with the start parameter --standalone
@huceke huceke [rbp] fixed omxcore using wrong wait f3d9b77
@huceke huceke [rbp] changed texture loading assign original size after we sucessful…
…l decoded and allocated the picture.
@huceke huceke [rbp] changed be consistent with Texture.cpp in enable the omx jpeg d…
@huceke huceke [rbp] changed pause thumbjobs but do not wait for running jobs to be …
@huceke huceke [rbp] fixed don't apply overscan settings in 3d mode. it just kills it. 0b50307
@huceke huceke [rbp] fixed omx fillbuffer, deinit of components, some wrong event wa…
…its, port enabled/disabled detection

Changed the way we wait for fillbuffer. A semaphore is more relaiable.
Fixed some wrong event waits. Should speedup some omx operations.
Deinit of components was wrong. Special free the buffers.
Changed port enableed/disabled detection to use omx functions and no internal statetracking.
Some cosmetics and removed some duplicate code.
@huceke huceke [rbp] added omxplayer Makefile to .gitignore b8e3dd7
@huceke huceke [rbp] changed EGL refactoring to match closer the generic EGL impleme…
…ntation and moake log messages more consitent.
@huceke huceke [rbp] fixed move RBP platform init after setup of the environment oth…
…erwise a debug build will assert in specialprotocoll.
@huceke huceke [rbp] fixed host side forced hdmi mode. when on the host side hdmi mo…
…de is forced, we should not touch the hdmi settings.
@huceke huceke [rbp] fixed move bcm_host_deinit after omx deinit. treat libbcm_host …
…wrapper as external library. we are already linked against libbcm_host.

I believe some of your work here includes a fix for downmixing AC3 audio from 5.1 to 2.0? If so, would it be more beneficial to put it into its own pull request? There are many who are suffering this issue on the various Raspberri Pi XBMC distro's (OpenElec) and it looks like this pull request is quite large!


Please have patience. Prio number one is to nail critical bugs down and get the merge done.


No problems huceke. Is there an ETA on this pull request?


a bit longer into the future than it used to be due to all these useless questions you guys keep nagging us with. eta is when it is ready and not a minute before.


@Pezmc I'm sure we're a lot of people waiting for this to get merged, but I'd rather wait for a proper merge than having a broken main repository that might take weeks to trace bugs in (and code that doesn't follow the XBMC standards). Let them work in peace, I'm sure they'll announce it once they got it all sorted out. :)


@peol Can't this be split into some of the major problems as separate pull requests. E.g. the force HDMI and Downmixing AC3

@huceke huceke was assigned Sep 4, 2012
@huceke huceke merged commit 45fe6fc into xbmc:master Sep 4, 2012
Team Kodi member

@opdenkamp Hi Lars, I'm afraid that you forgot to upload the file to the server. If this is automated and just takes some time, I apologize.

Team Kodi member

yeah indeed, there's a comment about this on the original commit/pr. i've asked in the internal irc channel whether someone can upload it.

Team Kodi member

all - there's an issue with this - all video now plays at half-height (platform = Windows). Reverting this PR solves it for me.

Team Kodi member

I saw something similar on linux.

moved .xbmc away - restart - still an issue - moved .xbmc back - restart - all fine. Not sure what was wonky there.

Team Kodi member

Did some investigation. Changes in BaseRenderer seem to be wrong. I always get a wrong refresh rate chosen.

Team Kodi member

same it doesn't switch at all (stays at 60 hz). And now i got the state again where the movie height is wrong...

Team Kodi member

see this screeny https://dl.dropbox.com/u/30371861/wrongheight.png

somehow the size info is missing in the osd too isn't it?

Team Kodi member

i only get this on linux as it seems...

Team Kodi member

I had it on Windows (Release) but not in the debug build... beats me :-)

Team Kodi member

correction - the wrong height also happens on osx ... its different from start to start...

Team Kodi member
Team Kodi member
Team Kodi member

@huceke this breaks other arm builds.

ffmpeg should be figuring out which arm instructions to use based on the cpu it's provided with (we already pass that in). We'll need to revert this unless you can give an example of something that's not detected correctly.

With arm flags :

grep ARM lib/ffmpeg/config.h
#define ARCH_ARM 1
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 0
#define HAVE_ARMVFP 1

Without arm flags :

grep ARM lib/ffmpeg/config.h
#define ARCH_ARM 1
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 0
#define HAVE_ARMVFP 1

So i assume it should be save for the PI to revert the arm configure flags.

Please leave use_hardcoded_tables alone. This is needed on the PI. Without hardcoded tables ffmpeg crashes on the PI.

Team Kodi member

Perfect, thanks.

Team Kodi member

friendly reminder here, arm flags are still there and because of that we can't play stuff on android now ( http://pastebin.com/EkJDJRX8 )
removing them fix that on android, but I would like someone who actually know what he's doing to look at it ;)

@christian667 christian667 referenced this pull request in mazkolain/spotimc Oct 17, 2012

Make spotimc compatible to XBMC 12 (Frodo) #66


Hi huceke, it seems this change has caused some playback problems for my Rdio plugin in Frodo.
Forum discussion: http://forum.xbmc.org/showthread.php?tid=152538&pid=1304505
Trac issue: http://trac.xbmc.org/ticket/13864

It seems that with this change PAPlayer now handles my rtmp stream, and it fails with "Unable to Init codec". Just trying to understand the change and how I can get my plugin working again? Are you able to provide any insight?

@huceke, I'm working on a fix :) stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment