Debian Jessie rootfs with GPU/VPU

Discussion in 'Debian' started by jas-mx, Dec 31, 2013.

  1. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Having just completed (today) a Debian Jessie rootfs with GPU/VPU support. I'm pleased to say it runs on my newly arrived UDOO Quad. It's not perfect but its a start!

    Update 09-06-2014: Updated rootfs to 13.10.17 GA release.
    Update 13-04-2014: Instructions for using a webcam with gstreamer-imx.
    Update 13-04-2104: Instructions for building and deploying the gstreamer 1.0 plugins (gstreamer-imx).
    Update 13-04-2014: Newer rootfs available with support for 3.10.17 BSP however it requires the experimental 3.10.17 kernel
    Update 01-02-2014: Intructions for cross compiling my kernel are below.
    Update 30-02-2014: Kernel updated with VT1631 audio drive, need to rebuild kernel to enable driver.
    Update 03-01-2014: Instructions for running Arduino IDE are also provided below.
    Update 07-01-2014: Uploaded SD card image and amended instructions. Image is using my kernel which doesn't include the EDID patches and contains a limited number of kernel modules.



    Instructions for deploying SD card image
    1. Download image. MD5: 8c6ba0f8f5aee043e0a5cea349038b5d
    2. unzip image file (udoo_jessie_xfce.img)
    3. Follow instructions to deploy image to SD card. Requires a 4GB card, actual image contents is around 3.5GB.
    4. By default the image will boot to a display resolution of 720p (60Hz). In the root directory there a uboot script file 'boot_1080p.scr' copy to boot.scr to change the resolution to 1080p(60Hz).
    5. By default serial console is enabled.
    6. If required you need to configure networking.



    Instructions for building an image :

    1. I built the 2013 Uboot and deployed to an SD card.
    2. Create a ext4 partition on the SD card and extract the rootfs (tar xvf jessie-xfce.tar.gz).
    3. Create a boot.scr file with the following on the SD card in /. Change 'video' value to your monitor/TV spec.

    Code:
    setenv bootargs 'console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw rootfstype=ext4 consoleblank=0 video=mxcfb0:dev=hdmi,1280x720M@60,bpp=32'
    run loaduimage
    bootm
    
    4. Convert the uboot script to image file

    Code:
    mkimage -A arm -O linux -T script -n "boot" -d boot.cmd boot.scr
    5. I'm currently using my own 3.0.35-4.1.0 kernel which has an older patched UDOO board file. You can build my kernel or take this patch into the official kernel and see if it works. Deploy kernel to /boot/uImage and kernel modules to /lib/modules.

    6. To get serial console output add the following line to /etc/inittab

    Code:
    T0:23:respawn:/sbin/getty -L ttymxc1 115200p
    7. Place SD card in UDOO and boot.

    8. More instructions on what to test for and its limitations are on the blog.


    Instructions to build my kernel and modules on linux:

    1. Retrieve kernel source from git.

    Code:
    git clone https://github.com/mtx512/linux-imx.git 
    cd linux-imx 
    2. Assumming you havea gcc armhf compiler installed, set the default udoo kernel config.

    Code:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- udoo_defconfig
    3. If you require additional kernel modules to be built select them.

    Code:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
    4. Build kernel image and modules. Replace -j4 with number of cores on the PC, eg for 2 cores -j2.
    Code:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
    5. Mount the sd card on your PC and the copy kernel and modules to rootfs

    Code:
    sudo cp arch/arm/boot/uImage <sd card mount>/boot/uImage
    sudo cp -r output/lib/modules/3.0.35-xxxx/  <sd card mount>/lib/modules
    sync
    6. Unmount sd card from PC and boot udoo with sd card.


    To run Adruino IDE:

    1. Download Oracle JDK (Linux ARM v6/v7 Hard Float ABI)
    2. Extract JDK under /usr/lib/jvm (create directory jvm if it doesn't exist).

    Code:
    cd /usr/lib/jvm/
    tar xvf  jdk-7u45-linux-arm-vfp-hflt.tar.gz 
    3. Create some links so that JDK is found

    Code:
    update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_45/bin/java" 1 
    update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_45/bin/javac" 1 
    
    3. Download and install UDOO Arduino IDE as per instructions

    4. We need to replace GCC ARM and bossac with armhf versions, so lets delete the existing ones:

    Code:
    cd  arduino-1.5.4/hardware/tools
    rm -rf arm-none-eab
    rm bossac
    5. Download bossac and copy:
    Code:
    cp bossac arduino-1.5.4/hardware/tools 
    6. Download GCC ARM and extract:
    Code:
    cd arduino-1.5.4/hardware/tools
    tar xvf arm-none-eabi-amrhf.tar.gz
    7. Lastly because we don't have the GTK look and feel installed, edit arduino launch file (arduino-1.5.4/arduino) and remove " -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel".

    8. Now launch and test.
     
  2. miousername

    miousername New Member

    Joined:
    Jun 23, 2013
    Messages:
    73
    Likes Received:
    0
    Great! I try your filesystem!

    I have to patch kernel! Which is the kernel svn version for the patch?
     
  3. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    git commit is ffa341821b1af7c12786820802b88de00b931d73

    make sure it is a 3.0.35-4.1.0 kernel
     
  4. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Finally got the Arduino IDE to fire up using the Oracle armhf JDK :) the next stumbling block is that the upload fails :(.
     
  5. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Finally the got Arduino IDE to upload to the SAM and tested with the blinking LED example :D .Instructions for installing are provided in the original post.
     
  6. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    As requested there is now a prebuilt image available, see original post.
     
  7. pizthewiz

    pizthewiz New Member

    Joined:
    Nov 30, 2013
    Messages:
    8
    Likes Received:
    0
    Thank you!
     
  8. schmidtbag

    schmidtbag New Member

    Joined:
    Dec 14, 2013
    Messages:
    23
    Likes Received:
    0
    Nice, I like how this seems to give significantly better performance than the other available disk images. Any chance you could include the egalax touch screen driver in the next release? That is currently the only thing I'm missing that I'm in need of.
     
  9. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    Thanks for putting this together. I spent about 1/2 a day getting my rolled system in order with expanded fs, web browser, compilers, vncserver, linphone, etc. However I've got two issues at the moment.

    1) Audio is not there. I've go no idea where to begin getting that in order. It looks like the kernel detects something but I'm missing a driver...

    2) The Arduino IDE installation didn't fully work for me. I got JDK and the IDE running without issues, but on compile I'm getting an error about a shared library not being present, specifically libmpc.so.2. I noticed that the 4.8.3 gcc binaries you provided lack the libexec folder that came with the arduino default installation. Not sure if that is another issue, but I've been unable to get anything compiled. I've tried three times now, I don't think I'm doing something wrong.

    Code:
    home/debian/Downloads/arduino-1.5.4/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.8.3/cc1plus: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory

    Any pointers or tips would be appreciated! Thanks again, this distro sure works better than the other deb one. My heatsink was too hot to touch running the GUI in SW mode (glxgears ~60fps) with this it's cool (glxgears ~300fps) and much happier. I'm actually surprised at how capable the little machine is.
     
  10. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Are you testing sound with hdmi, I haven't tested/configured audio for Analog output. I put some diagnostic notes on the blog for testing sound with hdmi. Can you try using the fsl video player to launch a movie file:

    Code:
     video-player.sh
    You can set the volume level using that the icon control on the player. If that fails can you test if the alsa setup is correct using:

    Code:
     aplay paino2.wav
    You most likely need to install the package libmpc2 if the file /usr/lib/arm-linux-gnueabihf/libmpc.so.2 is not present.

    Code:
     apt-get install libmpc2
    Thanks, I am surprised it is not listed on the official download page.
     
  11. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    Thanks for the pointers on libmpc2. It was late last night and I wasn't thinking about such a straightforward solution. As for the audio, yes I am trying to get analog input and ouput working as I'd like to be able to use linphone with my SIP service. Any pointers would be appreciated. Thanks for the quick response.
     
  12. rocketdude

    rocketdude New Member

    Joined:
    Jan 10, 2014
    Messages:
    11
    Likes Received:
    0
    so how do you get wifi networking going? I was able to get wired networking going by adding the following to /etc/network/interfaces
    auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp

    thanks for the image. It is the fastest so far. Pretty much usable as a desktop computer.
     
  13. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    My kernel is missing the VT1613 (AC'97 audio codec) driver, it is in the UDOO kerneland just needs to be back ported and tested. Another item to add to the TODO list.
     
  14. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Unfortunately haven't had time to look at wifi/bluetooth (again add to the TODO list) I'm preoccupied with getting a 3.10 kernel booting on this rootfs. Most likely it requires the correct kernel driver/firmware to be loaded for the RT5370 module.
     
  15. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    jas-mx, thanks again for undertaking this. If you are interested and want to stick your mods on github or something, I've done a few kernel compiles in my day….. It's been a good ten years since I've done anything major under the hood, but I could probably lend a hand if you'd be up for that.
     
  16. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    For wifi you can try using iwconfig, for example I tested connecting to a WEP enabled router (probably different for WPA) using the following

    Code:
    iwconfig wlan0 essid <essid> mode Managed key <WEP key>
    dhclient wlan0
    I've patched my kernel with the VT1613 driver for analogue audio and did a quick test to validate audio output. My kernel is in github and the branch is called imx_3.0.35_4.1.0-udoo. If you know how to build a kernel then you can test. By default I disabled the VT1613 driver so that hdmi audio is enabled by default. You can enable it in the kernel by selecting the following option:

    Code:
        System Type  --->
           Freescale MXC Implementations  ---> 
             UDOO Option  ---> 
               [ ] UDOO 'AC97 AUDIO CODEC VT161
    
     
  17. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,064
    Likes Received:
    9
  18. rcfgnu

    rcfgnu New Member

    Joined:
    Jan 17, 2014
    Messages:
    5
    Likes Received:
    0
    Hi,
    it would be nice to have an ssh server on boot to connect remotely.

    Great job,
    Thanks
     
  19. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    my ssh server was enabled by default. No configuration required. Have you confirmed that it isn't installed and running?
     
  20. rcfgnu

    rcfgnu New Member

    Joined:
    Jan 17, 2014
    Messages:
    5
    Likes Received:
    0
    The first time I tried it, was not start even if installed. I solved via chroot, changing the startup configuration. However, are not sure, maybe I was just impatient.. But I can do a test if it can be useful.

    I am now trying to run xbmc but I get an error, it seems not find the video driver for OpenGL support. Do you have any advice? I investigate, and in case I'll be able to run xbmc will report the results in the case can useful to other.
     

Share This Page