Ubuntu on Ouya

[Update 2014-09-20]: The latest patches from Markus for the Jetson TK1 work also for Tegra3!

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!

38 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
  • September 20, 2014 at 9:37 pm
    Permalink

    I just tested that the latest XBMC patches from Markus for Jetson TK1 works also very well on the Ouya! I can provide instructions to compile it or maybe even a .deb if there’s interest for them.

    Reply
    • September 25, 2014 at 9:43 pm
      Permalink

      Yes please (regarding the .deb)!! I want to test it ;)

      Reply
      • September 27, 2014 at 12:31 pm
        Permalink

        Which version of Ubuntu are you running?

        Reply
        • September 27, 2014 at 3:27 pm
          Permalink

          Raring, as per your instructions. Should I upgrade? Thank you.

          Reply
          • September 28, 2014 at 4:06 pm
            Permalink

            I’m using Raring too. Unfortunately I’m not sure if Canonical provides packages for that anymore.

            You can get the Kodi (XBMC) tar ball from here: http://tuomas.kulve.fi/tmp/xbmc-13.99-git-56ccc8b.tar.gz2

            Extract it to /usr/local (it will create the xbmc subdirectory).

            You may need the following dependencies:

            sudo apt-get install gcc-4.4 libasn1-8-heimdal libasound2 libasyncns0 libavahi-client3 libavahi-common3 libbluetooth3 libbz2-1.0 libc6 libcap2 libcdio13 libcomerr2 libdbus-1-3 libegl1-mesa libflac8 libfreetype6 libfribidi0 libgcc1 libgcc-4.7-dev libgcrypt11 libgles2-mesa libgnutls26 libgpg-error0 libgssapi3-heimdal libgssapi-krb5-2 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libjpeg-turbo8 libjson0 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 liblzo2-2 libmicrohttpd10 libmysqlclient18 libogg0 libp11-kit0 libpcre3 libpcrecpp0 libpulse0 libpython2.7 libroken18-heimdal libsasl2-2 libsmbclient libsndfile1 libsqlite3-0 libssh-4 libssl1.0.0 libstdc++6 libtag1-vanilla libtalloc2 libtasn1-3 libtdb1 libtinyxml2.6.2 libudev1 libva1 libvorbis0a libvorbisenc2 libwbclient0 libwind0-heimdal libwrap0 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxrandr2 libxrender1 libxslt1.1 libyajl2 zlib1g

            Reply
            • September 28, 2014 at 7:48 pm
              Permalink

              Thanks a lot!!! It works really well. Additionally I had to install libnfs1, mesa-utils and libcurl3-gnutls.
              H264 and MPEG2 decoding works well. VC1 have problems. Also I tried to switch the refresh rate but the Ouya doesn’t detect correctly the refresh rates available on my TV.

              Thanks again!

              Reply
              • September 29, 2014 at 2:37 pm
                Permalink

                Another question… Are you dual booting? If so, how?
                Thanks.

                Reply
                • September 29, 2014 at 2:41 pm
                  Permalink

                  I’m not. Currently I’m just manually reading the Linux kernel image to RAM and starting it from there. At some point I need to follow up on those XDA threads to replace the kernel permanently.

                  Reply
                  • September 30, 2014 at 3:47 pm
                    Permalink

                    Thanks again Tuomas. Where I can get the xbmc source code? Is there any special branch + patches or is master?

                    Reply
                  • October 1, 2014 at 5:37 pm
                    Permalink

                    Hi Tuomas.
                    Finally I’ve my ouya dual booting with stock rom and raring.
                    I installed Boot Menu (from milaq on xda) and make an “android kernel image” with your zimage using bootimg_tools_7.8.13.zip
                    Here is the link for the generated image.
                    https://dl.dropboxusercontent.com/u/1561637/altboot.img

                    Regarding xbmc, as I said it works pretty well. I switched TV so now I’ve working passthrough (ac3 and dts, not hd) and refresh rate switching.

                    On some videos I get “pixelated” image (no matter the bitrate / codec), specially on panning scenes.

                    Cheers!
                    Frank

                    Reply
  • September 28, 2014 at 6:46 pm
    Permalink

    hi tuomas!
    I’m noob with linux, and need some advice, can you help me with bellow questions?
    I want to make headless low power little server with SMB, FTP, torrent server, bittorrent sync, maybe owncloud. I need to know if I can use Ouya for that with debian or ubuntu, and which of this will be more preferable and more simple in configuring?

    Reply
    • September 28, 2014 at 7:02 pm
      Permalink

      Ouya is easily brickable and doesn’t contain any expansion connectors, so it’s not that good choice for a server. Certainly it can be used for such, even with the risks ands limitations. There’s not much difference between Ubuntu and Debian. Personally I prefer Debian.

      E.g. Olimex has cheap boards with SATA, they might be better for that kind of use cases. E.g.: https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2-4GB/open-source-hardware

      Reply
      • September 28, 2014 at 9:10 pm
        Permalink

        Thanks, Ouya with one usb 1.8″ hdd 120gb without external power is enough for my needs.
        I understand that ouya is highly brickable, but I installed Ouya boot menu some months ago and try CM11 and Olin’s Ubuntu 12.04 after that, so the most dangerous things is over as I think.

        Reply
        • September 29, 2014 at 11:18 am
          Permalink

          I think choosing between Ubuntu and Debian is a matter of opionion. For Ubuntu 14.04 LTS there probably are more instructions and forums about setting up stuff. I have worked more on Debian and I like how well Debian has handled security other updates at least for the common server applications.

          If you prefer a particular server application for Torrent etc. check which versions are available on which distro and what kind of documentation you find for each. Then pick you distro based on that.

          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?