Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Picuntu on CX919ii (J22) working with Wifi & Mali 3D support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Picuntu on CX919ii (J22) working with Wifi & Mali 3D support

    Hello,

    I bought cx919ii android tv stick and set my personal goal to make it working correctly with picuntu distribution. I couldn't find one place on net explaining how to do this and as I succeeded I decided to share this on this forum. Some points might not be straight forward therefore if you spend some time challenging them probably you will succeed as I did

    1) Download Ubuntu VirtualBox image targeted to AMD64 processor
    2) Compile the kernel doing below commands

    apt-get install git mc
    mkdir /cx919ii
    cd /cx919ii

    [ Put here *.patch files from cx919ii.zip attachment ]


    git clone https://github.com/phjanderson/marvin.git
    git clone https://github.com/phjanderson/Linux3188
    git clone https://github.com/phjanderson/Kernel-3188.git
    git clone https://github.com/Galland/rk30_linux_initramfs
    mv rk30_linux_initramfs initramfs


    cd marvin
    git apply --stat ../marvin_j22.patch
    git apply --check ../marvin_j22.patch
    git am --signoff ../marvin_j22.patch
    cd ../Kernel-3188
    git apply --stat ../kernel3188_j22.patch
    git apply --check ../kernel3188_j22.patch
    git am --signoff ../kernel3188_j22.patch
    cd ../Linux3188
    git apply --stat ../Linux3188_j22.patch
    git apply --check ../Linux3188_j22.patch
    git am --signoff ../Linux3188_j22.patch

    cd ../marvin
    ./marvin install_builddep
    ./marvin platform picuntu3188
    ./marvin config J22 1080p ddr667


    mcedit ../Linux3188/.config

    [ find CPU Frequency Scaling section and make sure it looks like presented below ]

    #
    # CPU Frequency Scaling
    #
    CONFIG_RK_CPU_312=n
    CONFIG_RK_CPU_312_VOLT=900
    CONFIG_RK_CPU_504=n
    CONFIG_RK_CPU_504_VOLT=925
    CONFIG_RK_CPU_816=n
    CONFIG_RK_CPU_816_VOLT=1000
    CONFIG_RK_CPU_1008=n
    CONFIG_RK_CPU_1008_VOLT=1075
    CONFIG_RK_CPU_1200=n
    CONFIG_RK_CPU_1200_VOLT=1150
    CONFIG_RK_CPU_1416=n
    CONFIG_RK_CPU_1416_VOLT=1250
    CONFIG_RK_CPU_1608=n
    CONFIG_RK_CPU_1608_VOLT=1350
    CONFIG_RK_CPU_1704=n
    CONFIG_RK_CPU_1704_VOLT=1375
    CONFIG_RK_CPU_1800=y
    CONFIG_RK_CPU_1800_VOLT=1375
    # CONFIG_RK_CPU_1896 is not set
    # CONFIG_RK_CPU_1920 is not set
    # CONFIG_RK_CPU_2016 is not set

    [ find GPU Frequency Scaling section and make sure it looks like presented below ]



    #
    # GPU Frequency Scaling
    #
    CONFIG_RK_GPU_133=n
    CONFIG_RK_GPU_133_VOLT=975
    CONFIG_RK_GPU_200=n
    CONFIG_RK_GPU_200_VOLT=1000
    CONFIG_RK_GPU_266=n
    CONFIG_RK_GPU_266_VOLT=1025
    CONFIG_RK_GPU_300=n
    CONFIG_RK_GPU_300_VOLT=1050
    CONFIG_RK_GPU_400=y
    CONFIG_RK_GPU_400_VOLT=1100
    CONFIG_RK_GPU_600=n
    CONFIG_RK_GPU_600_VOLT=1250
    # CONFIG_RK_GPU_798 is not set

    ./marvin build

    [ You should see below message ]

    Your kernel is ready in:
    /root/cx919ii/marvin/platform/picuntu3188/output/kernel_marvin_J22


    3) Download Picuntu 4.5 http://www.g8.net/download/4.5/picun...sicgui-nand.7z
    4) Replace kernel.img from extracted package by the one we just compiled
    5) Install picuntu on cx919ii android tv stick

    PS1. The Kernel-3188 is android kernel source. It is not necessary for this picuntu build. I prepared kernel-3188_j22.patch file based on this post entry: http://www.freaktab.com/showthread.p...159#post114159

    PS2. I applied the changes then to Linux3188 branch and set-up marvin J22 config file based on various entries found on net. Initially my cx919ii stick was working correctly with wifi therefore every 1-2h it automatically rebooted. I then found CPU & GPU frequency scaling in configuration as well as ddr667 option - after tweaking it the way shown above picuntu started to work perfectly

    6) Please boot your picuntu from your tv stick

    7) If you wish you may stop now - your stick fully operates with WiFi. Let's try to configure xwindows to support Mali400 GPU coprocessor.

    SETTING UP MALI DRIVER

    8) Please follow instruction provided here (http://www.freaktab.com/showthread.p...l=1#post157509) being logged on your picuntu and see my notes

    a) After putting modules under /lib/modules/3.0.36+/kernel/drivers I edited /etc/rc.local file and added below lines below "modprobe rkwifi":

    modprobe ump
    modprobe mali
    modprobe drm
    modprobe mali_drm

    b) after going through full procedure I added picuntu user to "video" group:
    usermod -a -G video picuntu
    [reboot]

    c) apt-get install glmark2-es2 mesa-utils-extra

    d) run es2_info and es2gears to check if the set-up is working for you

    PS3. At the beggining it didn't work for me as I was logged in as picuntu user in xwindows. After checking the rights on top of /dev/mali I noticed that video group has rights to it.

    SETTING UP WIFI (FIXED IP)

    1) wpa_passphrase WIFI_ID YOURPASSWORD > /etc/wpa_supplicant.conf

    2) mcedit /etc/network/interfaces

    [ make content look like below ]

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    auto wlan0
    iface wlan0 inet static
    address 10.0.254.253
    netmask 255.255.255.0
    wireless-essid WIFI_ID
    gateway 10.0.254.1
    pre-up wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant

    [ picuntu IP is set to be fixed -> 10.0.254.253. Gateway 10.0.254.1 (router IP) ]
    [ just customize to your needs ]

    3) [ reboot ] and enjoy wifi set-up

    Take Care
    Attached Files
    Last edited by ixoobb; 12 April 2014, 13:44.

    #2
    Originally posted by ixoobb View Post
    Hello
    Thank you, everything work, but flash not work in browser. How I can install adobe flash player?

    Comment


      #3
      FlashPlayer for chrominium

      Originally posted by DarkDante View Post
      Thank you, everything work, but flash not work in browser. How I can install adobe flash player?
      Hey,
      I just made quick look and found this post : http://allhailtothepenguin.blogspot.com [Chrominum browser plus flash].
      I found libepflashplayer.so over here: https://mega.co.nz/#!wIpDQbxK!PgMGvP...ew3CnMbOrFZKco

      1) I downloaded the libepflashplayer.so
      2) cp libepflashplayer.so /usr/lib
      3) created startbrowser.sh and filled with below stuff:

      chromium-browser --ppapi-flash-path=/usr/lib/libpepflashplayer.so --ppapi-flash-args=enable_hw_video_decode=0,enable_stagevideo_au to=0,enable_trace_to_console=0 --disable-flash-3d

      4) chmod +777 startbrowser.sh

      Once I executed this script flash started to work in the browser
      I hope it will work for you too.

      Comment


        #4
        Nginx & ssl bug

        Setting up NGINX on Picuntu & removing heartbleed bug (ssl)


        1) curl https://www.openssl.org/source/openssl-1.0.1g.tar.gz | tar xz && cd openssl-1.0.1g && ./config && make && make install
        2) ln -sf /usr/local/ssl/bin/openssl `which openssl`

        3) "openssl version" command should return:
        OpenSSL 1.0.1g 7 Apr 2014

        [ reboot ]

        NGINX

        1) apt-get install libpcre3-dev libssl-dev
        2) curl http://nginx.org/download/nginx-1.7.1.tar.gz | tar xz && cd nginx-1.7.1
        3) sudo adduser --system --no-create-home --disabled-login --disabled-password --group nginx
        4) ./configure --prefix=/usr/nginx --user=nginx --group=nginx --with-http_ssl_module
        5) make && make install

        6) open /usr/nginx/conf/nginx.conf and add first line to the file -> "user nginx;"

        7) create file /etc/init/nginx.conf and fill it with following stuff:

        # nginx
        description "nginx http daemon"
        author "Philipp Klose <me@'thisdomain'.de>"

        start on (filesystem and net-device-up IFACE=lo)
        stop on runlevel [!2345]

        env DAEMON=/usr/nginx/sbin/nginx
        env PID=/usr/nginx/logs/nginx.pid

        expect fork
        respawn
        respawn limit 10 5
        #oom never

        pre-start script
        $DAEMON -t
        if [ $? -ne 0 ]
        then exit $?
        fi
        end script

        exec $DAEMON

        8) start nginx server by performing "initctl start nginx" command

        Comment


          #5
          rk3188t

          Hi, does this work with t version? Also, could you share compiled img?

          Comment


            #6
            Originally posted by Johandersen View Post
            Hi, does this work with t version? Also, could you share compiled img?

            I learned that rk3188t chip is slower than rk3188 version and has 1.4GHz. As asked I am attaching the precompiled kernel versions for both CPUs (1.8GHz & 1.4GHz) and both resolutions (720p & 1080p). I am using 1.8GHz & 1080p. Please check if any of those will work for your RK3188T chip.

            Good Luck
            Attached Files

            Comment


              #7
              Success

              Thank you sooo much! 720p 1.4 ghz works perfectly, I haven't tested the others
              My PCB is cyxtech 909 v1_1

              Comment


                #8
                Setting up VPN for iPhone/Android device

                1) apt-get install xl2tpd openswan ppp
                2) mcedit /etc/sysctl.conf and add below lines:

                net.ipv4.ip_forward = 1
                net.ipv4.conf.all.accept_redirects = 0
                net.ipv4.conf.all.send_redirects = 0
                net.ipv4.conf.default.rp_filter = 0
                net.ipv4.conf.default.accept_source_route = 0
                net.ipv4.conf.default.send_redirects = 0
                net.ipv4.conf.wlan0.send_redirects = 0
                net.ipv4.icmp_ignore_bogus_error_responses = 1
                net.ipv4.conf.default.accept_redirects = 0
                net.ipv4.conf.wlan0.accept_redirects = 0

                3) Create a file called "ipsec.vpn" in "/etc/init.d/" and put below data :

                case "$1" in
                start)
                echo "Starting my Ipsec VPN"
                iptables -t nat -A POSTROUTING -o wlan0 -s 10.0.254.0/24 -j MASQUERADE
                echo 1 > /proc/sys/net/ipv4/ip_forward
                for each in /proc/sys/net/ipv4/conf/*
                do
                echo 0 > $each/accept_redirects
                echo 0 > $each/send_redirects
                done
                /etc/init.d/ipsec start
                /etc/init.d/xl2tpd start
                ;;
                stop)
                echo "Stopping my Ipsec VPN"
                iptables --table nat --flush
                echo 0 > /proc/sys/net/ipv4/ip_forward
                /etc/init.d/ipsec stop
                /etc/init.d/xl2tpd stop
                ;;
                restart)
                echo "Restarting my Ipsec VPN"
                iptables -t nat -A POSTROUTING -o wlan0 -s 10.0.254.0/24 -j MASQUERADE
                echo 1 > /proc/sys/net/ipv4/ip_forward
                for each in /proc/sys/net/ipv4/conf/*
                do
                echo 0 > $each/accept_redirects
                echo 0 > $each/send_redirects
                done
                /etc/init.d/ipsec restart
                /etc/init.d/xl2tpd restart


                ;;
                *)
                echo "Usage: /etc/init.d/ipsec.vpn {start|stop|restart}"
                exit 1
                ;;
                esac




                4) chmod 755 ipsec.vpn
                5) update-rc.d -f ipsec remove
                6) update-rc.d ipsec.vpn defaults

                7) make "/etc/ipsec.conf" file look like below:

                config setup
                nat_traversal=yes
                protostack=netkey
                plutostderrlog=/tmp/log.txt


                conn L2TP-PSK
                authby=secret
                pfs=no
                rekey=no
                type=tunnel
                esp=aes128-sha1
                ike=aes128-sha-modp1024
                ikelifetime=8h
                keylife=1h
                left=10.0.254.253
                leftnexthop=%defaultroute
                leftprotoport=17/1701
                right=%any
                rightprotoport=17/%any
                rightsubnetwithin=0.0.0.0/0
                auto=add
                dpddelay=30
                dpdtimeout=120
                dpdaction=clear




                7) make "/etc/ipsec.secrets" file look like below:

                %any %any : PSK "somegoodpassword"

                8) make " /etc/xl2tpd/xl2tpd.conf" file look like below:

                [global]
                auth file = /etc/l2tpd/l2tp-secrets
                debug network = yes
                debug tunnel = yes


                [lns default]


                ip range = 10.0.254.201-10.0.254.240
                local ip = 10.0.254.253
                require chap = yes
                refuse pap = yes
                require authentication = yes
                name = <ENTER SOME NAME HERE>
                ppp debug = yes
                pppoptfile = /etc/ppp/options.xl2tpd
                length bit = yes

                9) make "/etc/ppp/options.xl2tpd" file look like below:

                ipcp-accept-local
                ipcp-accept-remote
                ms-dns 10.0.254.1
                noccp
                auth
                crtscts
                idle 1800
                mtu 1410
                mru 1410
                nodefaultroute
                debug
                lock
                proxyarp
                connect-delay 5000


                10) make "/etc/ppp/chap-secrets" file look like below:

                * * thisissomesecretpassword *

                11) sysctl -p
                12) /etc/init.d/ipsec.vpn restart
                13) /etc/init.d/xl2tpd restart

                14) open below ports on your main router : 500/udp 4500/udp 1701/udp

                15) configuring the iPhone :
                a) go to settings -> general -> network -> vpn (at the bottom). Choose 'Add VPN Configuration..."
                b) The 'account' field can be anything you like.
                c) Leave RSA SecurID off.
                d) The Password is the PPP password configured in /etc/ppp/chap-secrets
                e) The IPSec secret (/etc/ipsec.secrets) goes into the 'Secret' field.
                f) Keep 'Send All Traffic' enabled.

                References:
                1) http://louwrentius.com/setting-up-a-...and-linux.html
                2) https://help.ubuntu.com/community/L2TPServer







                Comment


                  #9
                  Originally posted by ixoobb View Post


                  I learned that rk3188t chip is slower than rk3188 version and has 1.4GHz. As asked I am attaching the precompiled kernel versions for both CPUs (1.8GHz & 1.4GHz) and both resolutions (720p & 1080p). I am using 1.8GHz & 1080p. Please check if any of those will work for your RK3188T chip.

                  Good Luck
                  I got the same J22 stick and I want to boot Picuntu from SDcard, can u make a RFS img for me? B.t.w. the kernel_J22_1080p_1.8ghz.zip u uploaded is corrupted and lubuntu 14.04 or above is better.

                  Comment

                  Working...
                  X