https://redmine.graphics-muse.org/https://redmine.graphics-muse.org/favicon.ico?16278048512016-03-20T00:13:28ZGraphics Muse Issue TrackerPiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18482016-03-20T00:13:28ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>I just created the mjhammel/rpi2 branch for the pibox repo. This has the new xcc configurations on it.</p>
<p>Next I'll probably have to fix the firmware targets to copy all firmware to the DOS partition, as noted in RM <a class="issue tracker-8 status-2 priority-4 priority-default" title="Testing: Review BananaPi as replacement for RaspberryPi (In Progress)" href="https://redmine.graphics-muse.org/issues/460">#460</a>.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18512016-03-20T20:25:03ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>10</i> to <i>20</i></li></ul><p>I pushed the change to grab all the firmware with rpifw-pkg target. It's in the mjhammel/rpi2 branch.</p>
<p>Haven't tested it yet.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18802016-06-16T22:57:56ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>20</i> to <i>50</i></li></ul><p>I rebuilt today, just to get started again. The rebuild exposed bugs in libpibox and pnc builds which are now fixed. Both the rpi (galileo) and rpi2 (feynman) builds have completed and are ready for testing.</p>
<p>The rpi2 build in the mjhammel/rpi2 branch.</p>
<p>The rpi build is in master.</p>
I need to
<ol>
<li>Run metabuild on CentOS to get packages for the media server</li>
<li>generate the rpi2 image on CentOS </li>
<li>install and test on an rpi2 board</li>
</ol>
<p>I also need to test the images on an rpi to make sure it's still working correctly.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18812016-06-17T22:13:52ZHammelmjhammel@graphics-muse.org
<ul></ul><p>Ran metabuild on Fedora and CentOS. It failed in both places.</p>
<p>On Fedora it looks like this:<br /><pre>
/opt/rpiTC/bin/arm-unknown-linux-gnueabi-g++
--sysroot=/opt/rpiTC/arm-unknown-linux-gnueabi/sysroot -mfloat-abi=hard \
-mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s \
-mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 \
-mno-sched-prolog -march=armv6zk -std=c++0x -D__STDC_CONSTANT_MACROS \
-D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG \
-D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG \
-DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H \
-DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H \
-DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX \
-DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI \
-DUSE_EXTERNAL_LIBBCM_HOST \
-I/opt/rpiTC/arm-unknown-linux-gnueabi/sysroot/usr/include \
-I/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/target/opt/vc/include \
-I/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/target/opt/vc/include/interface/vcos/pthreads \
-I/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/target/opt/vc/include/interface/vmcs_host \
-I/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/staging/usr/lib/dbus-1.0/include \
-isystem/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/staging/usr/include \
-isystem/home/mjhammel/src/ximba/raspberrypi/bld/buildroot-2015.02/output/staging/usr/include/freetype2 \
-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I \
/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -c utils/log.cpp -o utils/log.o \
-Wno-deprecated-declarations
In file included from /opt/rpiTC/arm-unknown-linux-gnueabi/include/c++/4.8.5/random:38:0,
from /opt/rpiTC/arm-unknown-linux-gnueabi/include/c++/4.8.5/bits/stl_algo.h:65,
from /opt/rpiTC/arm-unknown-linux-gnueabi/include/c++/4.8.5/algorithm:62,
from ./utils/StdString.h:667,
from utils/log.cpp:26:
/opt/rpiTC/arm-unknown-linux-gnueabi/include/c++/4.8.5/cmath:1043:11: error: '::acoshl' has not been declared
using ::acoshl;
^
/opt/rpiTC/arm-unknown-linux-gnueabi/include/c++/4.8.5/cmath:1047:11: error: '::asinhl' has not been declared
using ::asinhl;
</pre></p>
<p>On CentOS is looks like this:<br /><pre>
/opt/rpiTC/bin/arm-unknown-linux-gnueabi-g++
--sysroot=/opt/rpiTC/arm-unknown-linux-gnueabi/sysroot -mfloat-abi=hard \
-mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s \
-mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 \
-mno-sched-prolog -march=armv6zk -std=c++0x -D__STDC_CONSTANT_MACROS \
-D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG \
-D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG \
-DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H \
-DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H \
-DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX \
-DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI \
-DUSE_EXTERNAL_LIBBCM_HOST \
-I/opt/rpiTC/arm-unknown-linux-gnueabi/sysroot/usr/include \
-I/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/target/opt/vc/include \
-I/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/target/opt/vc/include/interface/vcos/pthreads \
-I/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/target/opt/vc/include/interface/vmcs_host \
-I/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/staging/usr/lib/dbus-1.0/include \
-isystem/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/staging/usr/include \
-isystem/home/mjhammel/src/ximba/raspberrypi2/bld/buildroot-2015.02/output/staging/usr/include/freetype2 \
-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I \
/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -c BitstreamConverter.cpp -o \
BitstreamConverter.o -Wno-deprecated-declarations
In file included from DllAvFormat.h:27:0,
from BitstreamConverter.h:27,
from BitstreamConverter.cpp:26:
DllAvCodec.h:79:64: error: 'PixelFormat' has not been declared
virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0;
</pre></p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18822016-06-17T22:50:17ZHammelmjhammel@graphics-muse.org
<ul></ul><p>I think the Fedora one is <a href="https://lists.nongnu.org/archive/html/mingw-cross-env-list/2013-02/msg00019.html" class="external">a mixture of headers from host and target</a>. If so, that may also be the problem on the CentOS box.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18842016-06-23T22:18:29ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>50</i> to <i>60</i></li></ul><p>Found the problem: I was mixing toolchains and staging trees. I found when I built on Fedora by specifying XI= and SD= that omxplayer built correctly with the master branch of PiBox. However, after some testing I found that /opt/rpiTC is not the original and may be the rpi2 toolchain. So it's fubar. Similar problem on CentOS. I also found that the oxmplayer configs were incorrectly forcing the use of /opt/rpiTC and that broke the build if the wrong staging tree was specified too.</p>
<p>So I fixed omxplayer on fedora to work with the master branch build of PiBox. Now I'm building the rpi2 branch from scratch (after merging with master) on both Fedora and CentOS. I'm finding minor problems in the build, like expired packages. But once these complete I can retry omxplayer with rpi2 on both distros.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18852016-06-24T21:58:38ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>60</i> to <i>80</i></li></ul><p>Fixed dev platform build (pibox repo) and metabuild. The latter required updates to the cross.sh script in various app repos, along with specifying env vars on make command lines for other app repos.</p>
<p>The fedora build is complete, both disk image and app opkgs, and ready for testing on an RPi2. The CentOS omxplayer build still fails, but for a different reason now:</p>
<pre>
In file included from DllAvFormat.h:27:0,
from BitstreamConverter.h:27,
from BitstreamConverter.cpp:26:
DllAvCodec.h:79:64: error: 'PixelFormat' has not been declared
virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0;
^
DllAvCodec.h:84:34: error: 'PixelFormat' has not been declared
virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height)=0;
^
DllAvCodec.h:101:51: error: 'PixelFormat' has not been declared
virtual int avpicture_alloc(AVPicture *picture, PixelFormat pix_fmt, int width, int height)=0;
</pre>
<p>It's unclear what this problem is. The two builds should be using the same headers and toolchains.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18862016-06-25T20:21:42ZHammelmjhammel@graphics-muse.org
<ul></ul><p>Test boot on RPi2</p>
<p>Basically it worked if I used the prebuilt kernel provided in the firmware release. However....</p>
<ol>
<li>Firmware build doesn't copy all necessary files, I think. Just copy all files and then remove the prebuilt kernels.</li>
<li>PiBox kernel is built incorrectly so doesn't boot. I need to use bcm2709_defconfig for RPi 2 and RPi 3.</li>
<li>Kernel name will need to be kernel7.img, not kernel.img.</li>
<li>Copy kernel in after copying in firmware.</li>
<li>Audio doesn't play out of the combined audio/mic port. (audio plays fine through HDMI, which is the use case for the server but not the player).</li>
<li>GLES build (pibox.cmake) has hard coded values for RPi 1 arch. This needs to be configured with tags so glex.mk can set replace the tags with the appropriate architecture based on the HW setting of the build.</li>
</ol>
<p>That's it for now. I noticed that, when using the prebuilt kernel, that the stability of the system was suspect. psplash, for one, doesn't seem to work at all. I can just remove that one or make sure it's building against the right kernel perhaps.</p>
<p>The Media Player UI doesn't work correctly with a USB cabled keyboard but that is probably completely unrelated to this port. I'll have to try with a FAVI keyboard to be certain.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18872016-07-02T02:10:22ZHammelmjhammel@graphics-muse.org
<ul></ul><p>My kernel boots and the system basically worked. However, I'm back to the "X.org keyboard doesn't work" problem. I still have S01Xearly and S98Xearly to run X once and then S99UI to start it a second time, which works on the original RPi B+. After some experimentation I found that moving S99UI to inittab runs as "wait" after all sysinit complete works correctly, allowing the keyboard to work again.</p>
I still have a couple of other problems however.
<ol>
<li>Keyboard navigation in videofe doesn't work for wired USB or FAVI keyboards. The ESC and Enter keys work, however. Sounds like a keymap problem.
<ol>
<li>Fixed: set focus and default for view widget in videofe app.</li>
</ol>
</li>
<li>Exiting omxplayer kills the X server and we end up at the login prompt.
<ol>
<li>Fixed: didn't kill X, just went to the wrong vt. Now vtsrc should be "3" instead of "2" in videofe.cfg.</li>
</ol>
</li>
<li>videofe's parse() doesn't handle filenames with spaces. This can be fixed by parsing the command, dropping the last arg (%s) and then replacing it with the filename.
<ol>
<li>Fixed: parse only configured command, but not with filename, then do filename substitution in args[] list for %s in configured command.</li>
</ol>
</li>
<li>The default kernel is huge: 9M, not including driver modules. I'm sure this could be slimmed down.</li>
</ol>
<p>I need to fix these and the issues above and push to the rpi branch. Then I'll look into the omx keyboard issue.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=18942016-07-11T04:09:17ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Severity</strong> changed from <i>03 - Medium</i> to <i>01 - Critical</i></li></ul> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19032016-07-14T03:36:34ZHammelmjhammel@graphics-muse.org
<ul></ul><p>Except for the kernel image size, everything else is done. I used the RPi 2 on a camping trip this past week and it worked quite well. The VideoFE was more responsive than on the RPi 1.</p>
<p>I've merged these changes into a build for RPi 1 and test booted. This failed initially because I accidently built the latest kernel (4.4.y) instead of the original (3.14.y). Using the new kernel (and likely the new firmware) requires copying all the firmware files just as with RPi 2. Eventually I'll need to remove files to find out which ones are not required.</p>
<p>Once I got this booted the rootfs ran except for starting X. The init script fails with "illegal instruction", however running xinit manually works. So I need to dig through the init script to find out what has the illegal instruction.</p>
<p>What this tells me is that most of the changes for RPi 2 will work with RPi 1, even using the same kernel. The main difference is the toolchain. In the process of porting I found bugs with the various applications and with the meta build to make sure I was building against the correct staging trees.</p>
<p>So this is nearly done. I have to cleanup the RPi 1 build and then merge with upstream master. I still need to test the opkgs on the RPi 1 and that may show problems, however.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19042016-07-19T00:13:31ZHammelmjhammel@graphics-muse.org
<ul></ul><p>The illegal instruction comes from /opt/vc/bin/tvservice which is being used to determine if the HDMI is plugged in or not.<br />The illegal instruction is likely do to the settings used for -mcpu and -mfpu. I currently use</p>
<pre>
CPU=generic-armv7-a
MFPU=vfpv4
</pre>
<p>But according to the <a href="https://github.com/raspberrypi/userland/issues/214" class="external">userland forum</a> (also see the <a href="https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=98354" class="external">raspberry pi forum</a>) I should use this (for gcc 4.8 or later)</p>
<pre>
MCPU=cortex-a7
MFPU=neon-vfpv4
</pre>
<p>So I need to rebuild everything, since the toolchain needs to be rebuilt. Might be a good time to upgrade the kernel used for the toolchain too, as it's 3.14 and the new RPI/RPI2 kernel is 4.4. I'm already using gcc 4.8.5 (mainline, not linaro) so that should be fine with these updates.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19052016-07-19T00:18:58ZHammelmjhammel@graphics-muse.org
<ul></ul><p>Ugh. So while that's an issue for performance, my issue with withe RPI 1 build (not RPI2) so that won't fix it. The problem might be with the kernel used in the toolchain for rpi1. What I need to do is bump down to the 3.14.y kernel for rpi1 and make sure <strong>that</strong> is being used and not the 4.4.y kernel used for rpi2.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19062016-07-20T03:20:11ZHammelmjhammel@graphics-muse.org
<ul></ul><p>The problem was that the wrong cpu, fpu and arch were set in pibox.cmake for the gles (re: userland) component. Fixing that boots the rpi b+ normally.</p>
<p>However, I noticed that the inittab change is not in the core system. And that makes sense because it's only needed if you use the pmsui package. So I need to add a preinst script to the pmsui package that saves the old inittab and installs a new one and a postrm script that restores the saved inittab.</p>
<p>I also found that the videofe.cfg settings are not board specific. So I need to fix the install to handle setting the vtsrc correctly for each board type.</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19082016-07-23T22:18:41ZHammelmjhammel@graphics-muse.org
<ul></ul>Full build test for rpi1 and rpi2:
<ol>
<li>With latest firmware and 4.4.y, mkinstall.sh needs to copy all firmware (except overylays directory) files to boot partition now. It can then remove the two kernel files before install the HW-specific kernel file.</li>
<li>videofe now needs to be changed to have vtsrc set to 3 instead of 2. This is applicable to both HW builds.</li>
</ol>
<p>After that I may be done with the port. Finally!</p> PiBox - Action Item #511: Port PiBox to Raspberry Pi 2https://redmine.graphics-muse.org/issues/511?journal_id=19102016-07-24T22:12:19ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>100</i></li></ul><p>Verified fixes on both platforms. All changes committed and pushed.</p>
<p>Closing issue.</p>