Ouya (ouya-ouya)

Safe Boot
We avoid flashing the  partition because a corrupted kernel would irreversibly brick the Ouya. We use a tool called Ouya BootMenu (source) that allows us to chain load the postmarketOS kernel using kexec.

Audio
There are two mechanisms to output audio through HDMI.
 * Tegra30 HDA
 * Tegra30 SPDIF

The HDA device is what is used by the downstream kernel and stock Ouya Android ROM. The SPDIF device only outputs to the left channel.

Audio output through the HDA device works on the downstream kernel. The HDA device is card 0 device 3. It can be tested by running. The SPDIF device is card 1 device 0. It can be tested by running.

The mainline kernel has a tegra30-hda driver but it isn't working on Ouya. There is no upstreamed driver for the Tegra30 SPDIF device.

The Tegra30 HDA driver writes 4 frames and then hangs.

The kernel PCM framework in  has a timeout waiting for the device to respond.

It is uncertain why the HDA device isn't working on mainline. Possible avenues to explore:
 * Compare pinmuxes to downstream kernel.
 * Are the necessary clocks enabled and at the correct frequency?

Ethernet
A random MAC address is generated by the kernel at each boot. This is because the smsc9500 Ethernet device does not have a valid mac address stored in EEPROM. To set a consistent MAC address, create the file  with the following udev rule.

Radio

 * The Ouya uses a BCM4330 radio chip for wifi and bluetooth. The downstream and mainline kernel use the same wifi firmware. The firmware shipped with the device is the only known firmware to work with the Ouya. The BCM4330 firmware in  does not work.


 * Two later releases (the completely white special edition and completely black 2nd generation) allegedly use a BCM4334 chipset. This needs to be implemented and tested at a future date.

Display Resolution
On the mainline kernel, display resolutions above 1280x720 are glitchy. The GPU is dependent on memory bandwidth but EMC scaling is not implemented in mainline. The Ouya bootloader sets the memory to 400 Mhz. Higher display resolutions work a bit better when the memory is set to 800Mhz but it is still glitchy.

A kernel patchset was committed on 2021-08-13 to add support for memory bandwidth management. This should be released in v5.15.

HDMI CEC
The Ouya is missing HDMI CEC support at the hardware design level.

References:
 * What remote controls do you want supported?
 * https://forum.kodi.tv/showthread.php?tid=186121

Other Notes

 * Splash screen doesn't appear
 * USB booting needs to be tested

How to enter flash mode
1. Connect Ouya to PC

2. Use  to enter recovery (or   to enter bootloader for fastboot commands)

Downloads
You'll need OneClickOuyaRecovery.zip from here (original link is dead)

pmbootstrap
1. Flash CWM and Ouya BootMenu.

2. Turn on Ouya, then press the power button many times until it scrolls to Bootloader, and then wait until the boot menu disappears.

3. Run the following using pmbootstrap:

4. Reboot Ouya, then press the power button many times until it scrolls to Recovery, and then wait until CWM appears.

6. Using CWM menu options, mount /data partition.

7. Copy postmarketOS boot.img to /sdcard as altboot.img:

8. Reboot Ouya, then press the power button many times until it scrolls to Alternate Boot, and then wait until postmarketOS appears.

Using data partition as rootfs
It is much more usable to flash rootfs to the data partition which is around 5.7GB in size.

Flashing to the data partition
Specify the partition to flash rootfs to with the  argument:

Boot the Ouya into Recovery and make sure to mount /system in recovery. Copy postmarketOS  to. Unmount /system.

Do note, if the rootfs is larger than ~750mb Ouya's fastboot won't be able to flash it. In that case you may need to use  to install the image from a usb drive. This can be done with adb shell in recovery. After you've ran  ouya-ouya.img will be in. Make sure to copy the actual files and not the links in.

Boot to recovery, then log into your Ouya with

Updating the kernel
When the  package manager updates the kernel package (e.g.   or  ) then the   will be regenerated with the new kernel. Run the following commands on device to install the updated :

For altboot.img on /sdcard:

For boot.img on /system:

Maintainer(s)

 * rendeko

Contributors

 * rendeko
 * ryang2678 (Decatf)
 * ollieparanoid

Links

 * Ouya BootMenu (source)
 * CWM
 * CyanogenMod documentation blog
 * Add mainline based kernel for Ouya