Ubuntu on Ouya

I was testing Markus Tavenrath’s EGL branch of the XBMC on my Ouya and noticed that OMX_UseEGLImage segfaults on Debian but doesn’t on Ubuntu. The segfault happens inside the NVIDIA’s OMX binary, so there is not much to debug. And with Ubuntu 13.10 I had rendering issues. Then I tried Debian Jessie just to discover it is already using X.Org Video ABI 15.

So here is the summary of my discoveries:

  • Debian Wheezy: Segfault in OMX_UseEGLImage with XBMC.
  • Debian Jessie: X.Org Video ABI 15, no driver.
  • Ubuntu 12.04: Old.
  • Ubuntu 12.10: Old.
  • Ubuntu 13.04: No obvious issues.
  • Ubuntu 13.10: X.Org Video ABI 14, rendering problems.
  • Ubuntu 14.04: X.Org Video ABI 15, no driver.
HW accelerated video and GLES2.

HW accelerated video and GLES2.

I noticed that Totem has moved to GStreamer 1.0 so it does not use NVIDIA’s GStreamer plugins. I changed Parole to use nvxvimagesink instead of the de-facto xvimagesink and it works well. I’ve uploaded the binary to my tmp.

Pulseaudio seemed to cause slow playback and extra CPU consumption so I just removed it.

My instructions for creating Ubuntu Raring rootfs for Ouya can be found from github. Do leave a comment if there is anything broken with the instructions!

23 thoughts on “Ubuntu on Ouya

  • March 24, 2014 at 2:00 pm
    Permalink

    Will give ago on weekend would be good to see ghow xbmc goes…could allow to run apps in background sickbeard, transmission etc.

    Reply
    • March 24, 2014 at 2:05 pm
      Permalink

      XBMC isn’t usable yet. The UI works quite well, but the video playback doesn’t. There seem to be problems with audio/video sync and the playback is extremely slow. Videos without audio track plays better.

      I’m happy to give pointers, if there are OMX gurus around :)

      Reply
  • March 28, 2014 at 12:27 am
    Permalink

    Am wondering with the new CM11 and rom development if we’ll start seeing liniu roms at least its starting to move along.\

    Gotta as tuomas some good bloody work.

    Reply
  • April 14, 2014 at 6:52 pm
    Permalink

    If I understand correctly, the best supported installation would be debian jessie or ubuntu 14.04 ?

    Is it possible to use this kernel image to boot an existing debian jessie installation ? (I already have one that I run in a chroot on my Ouya)

    If yes then it would solve my problem.

    I tried to use your debian kernel image but it wants to boot from the second partition of my usb drive (the first one being the swap parition), but my debian is on the first partition.

    However, this installation doesn’t use a swap partition, so I’m guessing the kernel wants to boot on the first partition, which would work with my setup.

    If not, then I’ll either have to remake/reorder my partitions, or remake the kernel image.

    What do you think is the best/easiest way to solve my problem ?

    Also, do you plan updating this kernel image ?

    Reply
    • April 14, 2014 at 7:08 pm
      Permalink

      Ubuntu 13.04 is currently the best. Jessie and 14.04 both have too recent X.Org and there is no Tegra driver for them. It is possible to use those but not with any hardware acceleration.

      Choosing the boot partition is a trivial change to kernel. My latest kernel boots from the first partition and the swap is just a file, not partition.

      What kinds of kernel updates you are looking for?

      Reply
  • April 14, 2014 at 7:23 pm
    Permalink

    What do I need to do to change the boot partition ? Is it simpler to use the Ubuntu kernel ? I don’t care for graphics for now, I only want to run my Ouya as a server.

    Reply
  • April 14, 2014 at 7:31 pm
    Permalink

    You can take the Ubuntu kernel. Changing the boot partition is actually the only change compared to the “older” Debian kernel.

    Reply
  • April 14, 2014 at 8:08 pm
    Permalink

    Thanks a lot for the quick answer. I greatly appreciate the work you put into this.

    If I wanted to change the boot partition, I’m guessing I would need to recompile the kernel ? Considering that I’m a noob at kernel compiling, how hard of task would that be, starting from your work ?

    As for the updates, I was interested in making Bluetooth work. Because the kernel is almost the same from the debian installation, I’m guessing the issues noted in the September post are the same ? Or does hciconfig work now ?

    Reply
  • April 14, 2014 at 8:51 pm
    Permalink

    Compiling kernel is quite easy as it already supports cross compilation well. I can provide the commands if you want to try it out. But as I said, the only difference between my -tk3 (“debian kernel”) and the -tk4 (“ubuntu kernel”) is the boot partition.

    I’ve tried couple of times to get the BT working but I haven’t succeeded on it. Others have, even with my kernel, so it should be possible.

    Reply
    • April 14, 2014 at 9:14 pm
      Permalink

      I’d like to try it out, that would be a fun weekend project :)

      Just saying, could be a great subject for a blog post ! If not then just a quick reply here or on the email address I used to post would be perfect.

      Thank you very much again.

      Reply
      • April 15, 2014 at 9:57 am
        Permalink

        The first thing is to get the cross compiler to your desktop Linux. In Ubuntu: apt-get install gcc-arm-linux-gnueabihf

        It seems that there is something wrong when getting the zip file from github, so you need to clone the source slowly with all the git history: git clone https://github.com/kulve/ouya_1_1-kernel.git

        • If you want to change e.g. the rootfs partition, look for “root=/dev/sda1″: vi arch/arm/configs/ouya_linux_defconfig
        • Choose my Ouya config: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- ouya_linux_defconfig
        • Optionally make other configuration changes: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
        • Compile the kernel and kernel modules: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules -j4
        • Install modules temporarily to /tmp: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/tmp/ouya/ modules_install

        Now you should have the kernel in arch/arm/boot/zImage and the modules in /tmp/ouya/lib/modules/3.1.10-tk4+/. You probably should e.g. tar the modules and copy that to the device. Using something like scp -r will follow links and actually copy the whole kernel source tree.

        Reply
  • April 16, 2014 at 12:09 am
    Permalink

    I was thinking about booting from a disk image (containig linux file system) that would be stored on Ouya’s android filesystem. The reason is the usb connector on my ouya is quite wobbly now. Every slight touch on the usb disk that in turn moves the usb cable a bit breaks the usb connection which is fatal – the os just hangs. Any ideas how to do it? Maybe the romfs embedded into the android kernel (which is used for dualbooting) could do the initial mounting of the disk image….

    Reply
    • April 16, 2014 at 12:33 pm
      Permalink

      Normal initrd images on PCs mounts a read-only RAM rootfs initially, then loads the needed kernel modules from there and finally mounts the real rootfs and chroots into it. Something similar could probably be used for your use case as well.

      I guess it’s not possible for the kernel to mount directly an image file or directory from some partition (Ouya’s /data/) as the rootfs so probably the initrd option is the only way to go.

      I don’t usually use the initrds so I can’t help in creating one.

      Reply
  • April 27, 2014 at 5:14 pm
    Permalink

    I have a Tegra 3 based tablet, Asus TF300T, running Ubuntu 13.10 (dual-boot with Android 4.1)

    I’ve managed to somewhat fix the rendering problems (missing text) by disabling the RENDER (XRender) extension through /etc/X11/xorg.conf.d/
    I believe this should work for other Tegra 3 devices too.

    Some apps don’t work without XRender (like MATE’s Task manager and LXDE’s terminal app), but most apps are unaffected.

    Btw, Thanks a ton for your XBMC OpenMAX patches ! At last I got 1080p hardware decoding to work on Linux.
    Could never get it to work myself.

    Reply
    • April 28, 2014 at 8:32 am
      Permalink

      Good to know the XRender issue.

      For me the XBMC works somewhat for videos without audio tracks. There’s still something wrong with seeking and that might be also related to the issue with audio tracks.

      Reply
      • April 29, 2014 at 5:02 am
        Permalink

        Interesting. Audio works fine for me with PulseAudio backend.
        But there are some problems with video:
        1. Some videos play at full speed but there’s a lot of corruption and dropped frames.
        2. Some videos play too slowly, although audio plays fine.

        For example this trailer
        http://www.digital-digest.com/movies/Enders_Game_1080p_Theatrical_Trailer.html
        plays too slowly for me.

        What configure options do you use for XBMC ?

        The OMX decoder is working fine for me with gstreamer.

        Reply
        • April 29, 2014 at 4:02 pm
          Permalink

          GStreamer is working very well for me too.

          What configure options do you mean, build time or something from the XBMC’s Settings menu?

          Reply
          • April 29, 2014 at 5:21 pm
            Permalink

            Sorry, I wasn’t clear enough.
            I meant build time options, for the configure script.

            Reply
            • April 29, 2014 at 5:50 pm
              Permalink

              This it what I’ve used:


              ./bootstrap && ./configure --prefix=/usr/local/xbmc --enable-openmax --enable-neon --enable-gles --disable-gl --disable-vdpau --disable-vaapi && make -j4

              Reply
  • May 2, 2014 at 4:56 am
    Permalink

    I did some tinkering with old XBMC 11.0 Eden source code. By applying your NPOT fix, I could get OpenMAX to work. It’s far from perfect, but it works much better than your version.
    There’s no corruption or slow playback, but there are framesync issues in some videos (as if xbmc is trying to play them too fast). However, some videos (even 1080p ones) play fine.

    Had to modify configure script (change softfp to hard and mfpu to neon) to get it to build.

    Reply
  • August 10, 2014 at 4:05 pm
    Permalink

    Hi,
    in case anybody is interested in booting linux form linux image (single file) stored directly on ouya’s flash (without connected usb disk, preserving ouya’s android filesystem intact) the solution exists here:

    https://github.com/linux-shield/bbinitramfs

    to make it work on ouya you have to modiy the init script and change:

    DATAPART=/dev/mmcblk0p9
    ROOTIMG=$DATAMOUNT/media/linux_root.img

    next you have to copy your linux image to android’s “/sdcard” directory:
    adb push linux_root.img /sdcard/linux_root.img
    (that takes several tens of minutes depending on the image size)

    then you can boot the linux like that:
    fastboot boot zImage ramdisk.img.gz

    alternatively you can bundle the ramdisk image with the kernel via
    xperiaboottools (google it) to produce android kernel which can be
    autostarted via ouya dual boot. To do that:
    copy the whole content of the bbinitramfs project into “my_ramdisk” directory
    then create android kernel like this:
    ./repack-bootimg.pl zImage my_ramdisk kernelA2.img

    hope it helps.

    Reply
  • August 11, 2014 at 11:23 am
    Permalink

    Thanks for the update!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Why ask?