This post is about running Debian GNU/Linux on the Mesada/Flexiview FV-1 “AndroidTV” unit. This post has been a bit delayed, I got very sidetracked with other things this month!

By following these steps, you should be able to use the FV-1 a bit like a normal desktop Linux computer. However, it’s still a long way from my dream goal of running XBMC for Linux.

Android TV front

(Edit 11 March – added a couple more notes about exactly how poor the UI graphics performance is.)

What This Is

A lightly customised installation of Debian Wheezy, set up initially with a minimal “LXDE core.” Kernel is 3.3rc from linux-samsung-soc, plus some minor patches for FV-1 hardware support.

Debian Installation

This configuration has the kernel loaded into the internal flash of the FV-1. However, the root filesystem with Debian is external – on either a USB device or an SD card.

If you want to reverse back to Android after testing Debian, you should be able to perform a normal FV-1 firmware upgrade using their “SDtool” to prepare an SD card.

In theory, it should also be possible to install Debian into the internal flash. However, the m-boot bootloader is quite peculiar so I haven’t tried.

How to install

1) Download an SD card image to flash the kernel – use this one if you to boot Debian from an SD card, and this one to boot Debian from a USB device. The only difference between the two is the kernel commandline in the config, you can see the configs here.

2) Work out what device name your SD card reader in your computer has. It will probably look like /dev/sdX (for USB card readers) or /dev/mmcblkX (for built-in card readers). I’ll be using /dev/sdX for the sample commands here. You can probably work this out by inserting an SD card, waiting for it to mount on the desktop, and then typing “mount” to see what is mounted.

3) Flash your SD card with the kernel upgrade. This will erase any content already on the card.
umount /dev/sdX1
dd if=kernel-boot-usb.img of=/dev/sdX
sync

4) Remove the SD card and insert it into the FV-1. Power on the FV-1. The red light will come on, followed by the green light. After 1 minute or so the green light will start blinking. This means the new kernel has finished flashing. Power off the FV-1 and remove the SD card.

5) Download the rootfs tarball. This is the filesystem that the kernel will boot into.

6) You then unpack the rootfs, to your SD card or USB device. If you only have one SD card, you can reuse the one which you just used for the kernel (although you’ll need to repartition and reformat it.) I suggest formatting as ext3.

7) Once your SD card is ready, unpack the rootfs:

cd /media/[path-to-my-SD-card-mountpoint]
sudo tar zxvf ~/path/to/rootfs.tgz
sync
cd ..
eject [path-to-my-SD-card-mountpoint]

8) Insert the card back to the FV-1, and power on.

9) The FV-1 will boot to a login screen, using the lightdm login manager. Alternatively, if you don’t have a screen then you can connect an ethernet cable – the FV-1 will establish a connection using DHCP and you will be able to ssh into it.

10) The default username is ‘user’ and the password is ‘android’

11) The stock image only has a very basic LXDE GUI desktop (lxde-core.) When you first log in, go to the LXDE menu (bottom-left) and choose Accessories -> LXTerminal.

12) Use “passwd” to change the default password.

13) Optionally, use “sudo adduser (username)” to add a new user then “sudo usermod -aG sudo (username)” to give them sudo. Then reboot and login as your new user, and “sudo deluser user” to remove the initial user.

14) If you’re not in the US, edit /etc/apt/sources.list and change to a local mirror for packages.

15) To install a full GUI LXDE environment, run “sudo apt-get update” then “sudo apt-get install lxde”. It may also be possible to remove lxde-core and install other desktop environments like Xfce4, GNOME, KDE – as described in the Debian documentation.

16) When installing LXDE (or any other environment), the gdm3 package may prompt you to choose a default login manager. Keep the current “lightdm”. Any new manager will need to be preconfigured to use Xwrapper.sh to launch X (see below.)

17) Happy computing! From now on, everything should behave like a standard Debian Wheezy system.

Keep reading for the status of the hardware support.

Things That Work

X11 graphics

Up to 1920×1080 over HDMI, 16-bit colour.

USB, ethernet, SD card slot.

Things That Might Work

HDMI audio output

I’m using an HDMI->DVI cable and a computer monitor, so I haven’t been able to test audio output.

Things That Don’t Work

Wifi & Bluetooth

This is another case where having the actual GPL source release would be very helpful. The wl12xx_sdio driver detects the chip correctly, sometimes successfully uploads firmware, and very occasionally I’ve managed to get it to associate and send/receive packets. More commonly it just crashes with MMC read/write errors.

My vague theories for why it is not working include:

  • An incorrectly set clock frequency (if I force lower the SDIO frequency it becomes more reliable but not 100% reliable.)
  • Samsung HSMMC driver bug of some kind.
  • A floating GPIO line that I don’t know about.
  • Unpublished differences between Samsung’s SWB-T37 chip and the original TI WL1271.

Changing screen resolution normally

The X server is launched via a custom wrapper script, /usr/local/bin/Xwrapper.sh, that sets the screen resolution for the HDMI output before X starts. Out of the box it is set for 720p (1280×720), but you can edit that file to get 1080p (1920×1080) or 480p (720×480.)

Detecting available screen resolutions

The mainline kernel has no support for DDC/EDID (receiving monitor identification data) over HDMI on the Samsung S5PV210 SoC.

Blanking/unblanking the screen

This includes restarting the X server – any time HDMI output is disabled and then reenabled it hard locks the system. I’ve committed a note on the fv1_hacks branch showing where the system locks the second time around, but I haven’t worked anything else out yet.

To work around the issue there’s also a custom xorg.conf installed, disabling all screen blanking functions.

I think the lockup may be related to the fact that (unlike fancier hardware) the FV-1 has no system-controlled voltage regulators. This means some HDMI subsystems that would otherwise be disabled when HDMI output stops stay running, and cause problems. This is only a theory, though.

Video acceleration

This is the big one. Currently single buffered, software acceleration only – means any graphics-intensive or interactive operations tend to use a lot of CPU time and can be very jerky.

The videobuf2-fb driver that the XServer runs on (ie a framebuffer driver that maps to a V4L2 output device) is only a proof of concept, made by Samsung. It would be possible to add some more features, at least in principle. Or alternatively to write an Xorg driver that outputs directly to v4l2 (this is how Android does it.)

3D acceleration

I’ve been messing with the PowerVR drivers for the SGX540 core, but it’s all a closed-source restricted mess and very unlikely it can be made to work. Hopefully the FSF will get some traction behind their goal of open source PowerVR SGX drivers.

SD card plugging & unplugging

For some reason the Card Detect interrupt doesn’t work on the SD card slot. An SD card will work fine if its inserted at boot time, but not if it’s plugged/unplugged later on. I’ve committed what I think should work to a branch (can even see the CD line changing state and attach the interrupt to it), but I can’t make it actually work.

RF remote control

I spotted data from this coming in over the i2c bus but I haven’t tried to decode it, or work out functions like pairing, or discover if it has its own GPIO interrupt line. There’s a kernel driver for the remote in the vendor’s kernel, but due to GPL violation that’s not of any help.

Restarting

The system won’t reboot, you have to shutdown and then cycle the power by plugging/unplugging the cord!

That’s All

I hope this is of some use. Patches are very welcome if anyone works any of the issues out. :)

23 thoughts on “Debian on Flexiview FV-1

  1. Sebas,

    Good question! It’s quite snappy, the only things that can slow it down are fast graphics (I don’t think I’ll be able to watch video on it, for example) and slow USB/SD disks.

    I’ll try and make a short video to upload.

    – Angus

  2. On seconds thoughts, interacting with most programs is a bit jerky and it tends to get bogged down rendering to the screen. So probably not a good choice for most interactive display uses, at least not at this stage. :/

  3. hi,

    i’m just looking for a cheap debian box to upgrade from my old hacked dockstar (runs debian CLI only and squeezebox server etc) so wifi, hdmi etc i’m not too bothered about as ill administer it over SSH

    I’m really just looking for a non GUI debian distro with SSH server running, not being a linux techie whats the best way to get the latest 3.3 debian non GUI on it

    thx

    • Hi Ian,

      Sounds like a very good use for one (without more development it’s probably not that useful as a desktop-style computer anyhow.) I think you’ve got two options:

      – If you follow my instructions above, you can log in via ssh using the default credentials and then change them (the FV-1 will default to getting an IP address from your DHCP server.) Then if you run ‘apt-get autoremove lxde-core’ then it will uninstall LXDE and the related X11 graphical packages. Reboot, and now it’s a headless machine!

      – For a more advanced/pure approach, You can build your own Debian rootfs from scratch using Debootstrap, as described here:
      http://wiki.debian.org/EmDebian/CrossDebootstrap (although you may need to use qemu to configure SSH if you’re not going to plug in a serial console.) This would let you use Debian 6 Squeeze (aka stable) instead of Wheezy (aka testing.)

      The first approach would be much easier, second approach is less hacky but probably requires more Linux/Debian technical knowledge.

      Please let me know how you go, either way.

      – Angus

  4. Hi, I tried to execute the steps described above but I have some problems when I try to install the “rootfs” filesystem. I have not a Linux pc and I used my Windows7 to format the SD card and to install the kernel. After this, I tried to unpack the “rootfs.tar” but I had to format my SD in FAT32, to use it on my PC. When I inserted the SD card in the FV-1 nothing happens and I think the problem is that the SD should be formatted in ext3. But If I formatted it in EXT3 I cannot use it.
    Could you please help me? Could you please make an image of the “rootfs” filesystem so I can write it on the SD card?

    Thanks
    Alex

    • Hi Alex,

      The card definitely needs to be ext2 or ext3. I haven’t provided an image because an image would be tied to a single filesystem size, and also because it takes a lot longer to copy an image to every block of a device, compared to just unpacking files onto an existing filesystem.

      I suggest you grab a Virtual Machine environment like VirtualBox (virtualbox.org) and your Linux ISO image of choice and boot Linux inside Windows that way. For just this task you could boot a Live CD ISO directly, but long term you might find it useful to install a virtual Linux machine you can bring up when you need it.

      Cheers,

      Angus

  5. any chance of getting android 2.3 ported to flexivew fv-1 because theres an early build of xbmc for android out but it requires android 2.3 and the flexiview only has android 2.2

    • Hi Steve,

      No need to both email me and post on my blog, I get emails for blog comments too. :)

      I think it would be possible for someone to port Android 2.3, after all the FV-1 hardware is pretty similar to a Samsung Galaxy S i9000. It’s not super easy, though.

      Bear in mind that even with Android 2.3, the FV-1 won’t have video decoding support in XBMC. So you’d be stuck with standard definition playback at best.

      – Angus

  6. Great thanks Gus, someone has managed to port android 4.0 on a device with the same cpu and gpu as the flexiview fv-1 so it definitely seems possible ill keep my fingers crossed…. see links below for the device specs and youtube vid of it in action.

    http://pjlee-em.blogspot.com/2012/01/android-40-on-mango210-s5pv210.html

    http://www.youtube.com/watch?v=lhONuYdnQbk&list=UUWIHb09Krw9US6aZxqtEbBQ&index=4&feature=plcp

    http://www.youtube.com/watch?v=6zQL3AIm6lg&list=UUWIHb09Krw9US6aZxqtEbBQ&index=7&feature=plcp

  7. Hi,
    I got this fv-1 .. Can u please let me know what to do since i have win 7 64.
    I tried to copy to the sd card and it was blinking first time after 1 min.
    Later after restarting it doesnt blink nor does it . i tried to burn the image to usb but both images cant be accessed on win. Any image which i can burn directly on win 7 64x.Can we update to android 4 to get latest apps or is the model restricted to 2.3

  8. Hello.
    I know its a little bit late for asking informatiom about this device. Firstly i must thank you for giving me to use debian on this. Its a little bit laggy and when i read your blog i had an idea about using this as debian headless box. Its very usefull and i will starting to use but when i try to mount ntfs format hdd i got an error about fuse not found (using with ntfs-3g). I run command “modprobe fuse” and i got “FATAL: Module fuse not found.”. After a little search i found i need to compile kernel with fuse support. I am newbie about compiling kernel.. Can you help me with fuse enabled kernel or if i did something wrong can you help me for fixing it?

    • Hi Munir,

      I think headless is a great use for this device! Sorry to hear I didn’t enable FUSE in the first place.

      This could be a great opportunity to learn how to configure and build a new kernel (or at least new kernel modules.) There are lots of resources out there for configuring and cross-compiling a kernel, the basic steps for Raspberry Pi should work with minor adapation. Once you have the kernel source from https://github.com/projectgus/linux-samsung-fv1 you can download a kernel config from here http://projectgus.com/files/fv1/debian/ and then name it “.config” in the bottom level of the source tree. Enable the FUSE module by editing the configuration (you can find guides to doing this online), “make modules”, then copy the modules it builds over to the FV-1 SD card (no need to replace the main kernel, just the modules.) Sounds complex but it’s not too bad once you get the hang of it. :)

      Let me know if you get stuck on any particular point.

      – Angus

      • Hello again Angus,

        Thanks for hints of compiling kernel and modules. I make a little search and find resource for compiling kernel over cross platform. But i had another problem when i compiled from your kernel source and creating modules i got a different kernel number then current root.tgz. In your package i got //lib/modules/3.3.0-rc3+ but when i compiled from your source of kernel i got //lib/modules/3.3.0-rc3 . I try to copy all of lib folder except build and source links but after that it wont run. After that i try to copy only fs folder for fuse.ko file and modifying other than .bin files for enabling fuse but it will open but i fuse didnt enabled. I am a little confused about it what am i missing ??

  9. Did anyone get linux running on this box? As I have two and am trying to get XBMC on to them. Thank you for your help. By the way loved the write up and strip down as I am a old technician.

  10. Thanks, that gives a new life to my FV1

    I could not get the audio working via the HDMI.
    However, compiling the SND_USB_AUDIO module allows to use external usb audio adapter.

  11. Thanks for this Debian edition. I’ve put it on my box and it starts and runs pretty well on it, (despite some packages are missing from the start). However, I’ve ran into trouble when trying to update the system with “sudo apt-get update” and “upgrade” afterwards. Here, apt naturally suggests me to get all the available new packages of the Debian repository. Unfortunately, after going through all that install process and restarting the box, it won’t boot up as prior to the upgrade. I’m totally unsure, why that happens. My guess is that either the configuration for lightdm or for the xserver is broken at some point in the upgrade process. But it also can be something else – can’t say what as I’m totally inexperienced with it. Can someone help out? Would really love to use my box as sort of a NAS server on my home network with external hard drives connected to it. Thanks!

    • Hi Bob, very sorry to hear that! I’m sorry to admit I haven’t plugged mine in for yours, so I can’t really guess at what the problem might be. Hopefully someone else may have some advice. Do you get any output at all when you restart?

      Angus

      • Hi angus, and all the others. Altogether, I’ve ran into two results here that differ slightly from each other. By taking the radical measures and simply upgrading everything pending in apt, after a restart with pulling the power cable out, I didn’t get any output onward of pushing the cable back in. From another machine in my local network (from which I could seamlessly access my box via ssh prior of upgrading it) I also couldn’t reach it anymore with “No route to host” error message. However, whenever I tried to install, say, synaptic first (which also offers me to install a whole bunch of dependencies packages – so I just carry on) to eventually be in better control of what to upgrade and what not to, the next time I hard-restart my box, there is some output. In particular, until the point where it’s at the login box. And the background color is lime-green from there on. That’s the biggest difference noticeable. But after I enter user and then android – boom. No output anymore. And, btw, I also recall upgrading this once merely over the ssh session completely (the full-upgrade version of my story). Then, after restart, there’s also that lime-green colored screen and the login box. But after logging in – no output. And ssh doesn’t work from there on, too, but I think the error message is different. “No response from host” as I recall. Anyway, gonna return it to Android, if this persists. But, hopefully, someone else knows what I’m doing wrong here. Thanks again, until then, bye.

      • Hello again! I actually found out what package caused the problem. It’s almost too obvious, but as you’ve mentioned in 16th bullet point, the current “lightdm” needs to be kept as the default login manager.
        Well, here I didn’t particularly change the login manager. However, upgrading it caused something to go wrong and eventually broke the boot setup. I’m still not sure whether simply some file needs to be edited to point to Xwrapper.sh script (on the prompt asking me about the modified lightdm.conf version, I press ‘N’ to tell it to use my configuration and not of the package distributor) or the hard-coded binary program doesn’t work as it should – anyhow upgrading “lightdm” was the cause. This is why I now set it to hold back from upgrade using “sudo apt-mark hold lightdm” command. From now on, everything else works as expected! :)
        Pardon for being impatient and starting to comment before finding it out on my own.

  12. Hello Angus! It’s Bob again.. this time I have a different problem.

    Now, long story short: The wheezy image you provide here comes with Linux kernel known as ‘3.3.0-rc3+’ and afaik there are no corresponding headers for it. The actual problem is that it seems to have no support for mounting NTFS volumes (of external drives connected via USB to the FV-1 – had no problem mounting FAT32/exFAT volumes, though) and, if I’m right, that’s either because there are no FUSE modules in /lib/modules/3.3.0-rc3+/kernel/fs/ (where /fs/fuse/fuse.ko isn’t present at all) or because this kernel has no NTFS support.

    If I try to mount NTFS drives it fails with:
    “exit code 21: FATAL: Module fuse not found.
    fuse: device not found. try ‘modprobe fuse’ first.”

    I’ve already installed all possibly related packages from Debian main repository (ntfs-3g, too) and worked through various guides, including configure/make/install modules from libfuse sources and some guide with module-assistant in order to make modprobe work. But without any luck so far.

    Are there any ways to take a different kernel that has NTFS support or is this one hacked in a certain way disallowing its upgrades? Is it really because of the lacking NTFS support and can I manually add that later?
    I’d be grateful for any advice.

    Thanks in advance!
    Bob

    • Hi Bob,

      The kernel source tree I used is here: https://github.com/projectgus/linux-samsung-fv1

      … you should be able to use that tree to either install kernel headers, or adjust the configuration and build more modules.

      Unfortunately I don’t remember any specific fine details about building suitable kernels, if there were any to keep in mind. Hopefully it goes smoothly.

      Angus

Leave a Reply

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