Arch Linux Arm on Radxa Rock2 Square

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

Arch Linux Arm on Radxa Rock2 Square

Postby tomzooi » Wed Jan 06, 2016 3:49 pm

Hello,

Feel free to skip the following introduction about me, an almost finished Computer Science student happily running Arch Linux for well over half a decade on 64 bit laptops and desktops. I also had a couple of nice runins with the more popular ARM boards (raspberry pi and Beaglebone Black), first running wireless time server and ambient light detection for my clocks, the latter doing some ADC duty. But that's not why I'm here.

I wanted to make myself a proper HTPC, I ran a gigabyte RPI and a gigabyte Brix with arch and kodi with reasonable success, but I wanted something a bit more powerful (turns out that even the gigabyte Brix is not so good in video decoding somehow, primarily audio timing issues, figured it would do better as a swap in apache server). So I bought myself a MK902II from cloudsto (http://www.cloudsto.com/products/linux- ... etail.html).

It is not that I don't like ubuntu, but I wanted to run Arch so I set to work. It turns out there's no set recipe yet to install arch on this device, containing a radxa rock2 square motherboard(viewtopic.php?t=6967&p=39376).

But there was a debian package (called rabian) for this motherboard (http://wiki.radxa.com/Rock/prebuilt_images). Since I figured both should be pretty equal, I set to work on a nasty hack which turned out to be working:
First I downloaded the two tools nessecary:
- linux upgrade tool (http://wiki.radxa.com/Rock/download)
- rkflashtool (available from aur)
I then followed sort of this guide to install rabian (http://www.hagensieker.com/styled-26/index.html) with the rkflashtool
Then I created an empty image using dd (if=/dev/null) and followed the instructions from http://archlinuxarm.org/platforms/armv7 ... flip-c100p to create the linuxroot in aforementioned disk image.
Then I used the upgrade tool to only re-flash the linuxroot with the root image I created. Rebooted and hey presto, it worked! (which I honestly didn't expect).

Sharing this information is partly why I'm here, but unfortunately I am not finished yet, I have some issues I want to address, they are in approximately order of importance/annoyance:

1: Playing videos does not work, or only horribly slow. I tried installing xf86-video-armsoc-rockchip which caused lxdm to only black out and startxfce4 to fail. De-installing it again got it back to working. I tried installing mali drivers, but no luck (gpu is GPU - ARM Mali-T764 GPU). One of the problems is that lsmod lists nothing at all and lspci gives:
$this->bbcode_second_pass_code('', 'pcilib: Cannot open /proc/bus/pci
lspci: Cannot find any working access method.')
So I am totally at a los to find out what modules are loaded/used and which driver to use

2: Ethernet is working terribly slow, so slow that I opted to use a USB ethernet device(ASIX AX88772). The latter works fine, but only if I reboot (it somehow failes to load when inserted after boot and trying to start netctl, chainloader issues? I'm out of my league here). Also hard to pinpoint any trouble, anyone knows how to diagnose and fix this is very welcome to suggest any actions.

3: Wifi is not working, I have a "sit0" device:
$this->bbcode_second_pass_code('', '3: sit0: <NOARP> mtu 1480 qdisc noop state DOWN group default
link/sit 0.0.0.0 brd 0.0.0.0
')
but it won't work with wifi-menu, apparently the chipset is ap6335 (http://wiki.radxa.com/Rabian#Wifi), but it won't show up in my devices, I Guess I'm missing a (correct) driver, but how to install, I'm at a loss.
This is my lsusb:
$this->bbcode_second_pass_code('', 'lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet
Bus 003 Device 007: ID 045e:074f Microsoft Corp.
Bus 003 Device 006: ID 24ae:2000
Bus 003 Device 005: ID 0bda:0151 Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)
Bus 003 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
')
7 is my mouse, one of them is the hub I use with card reader(see 5) and of course the keyboard and usb ethernet device.

4: Overscan, even though the thing is connected over HDMI to a nice and new smarttv, I am missing the edges of my screen in xfce4, but also in terminal mode. I can't change any resolutions or whatsoever. I've tried a different (older) TV with worse results and running an hdmi->vga converter to my monitor yields unclipped but also very unsharm imagery unfortunately. This is my xrandr output:
$this->bbcode_second_pass_code('', 'xrandr: Failed to get size of gramma for output default
Screen 0: minimum 1920 x 1080, current 1920 x 1080, maximum 1920 x 1080
default connected 1920x1080+0+0 0mm x 0mm
1920x10880 60.00*
')

The original ubuntu/rabian installation had a set_screen.sh that supposedly ran on boot containing this:
$this->bbcode_second_pass_code('', 'echo 1920x1080p-60 > /sys/class/display/display0.HDMI/mode
fbset -a -xres 1920 -yres 1080 -vxres 1920 -vyres 1080')

//edit:
Partly solved by changing the TV settings (this only works on my newer TV, older TV didn't have a "fit screen" setting for HDMI unfortunately)

5: I half suspect a hardware problem, but the usb ports on the slave side of the device are not working (no power coming out). However, this shouldn't be a problem if 2 get's fixed.

6: Disk size / boot partition: it is supposed to have 16Gb, but I only have about 10, df -h:
$this->bbcode_second_pass_code('', 'Filesystem Size Used Avail Use% Mounted on
udev 1000M 0 1000M 0% /dev
tmpfs 404M 468K 404M 1% /run
/dev/mmcblk0p2 9.6G 2.4G 6.9G 26% /
tmpfs 1010M 0 1010M 0% /dev/shm
tmpfs 1010M 0 1010M 0% /sys/fs/cgroup
tmpfs 1010M 16K 1010M 1% /tmp
tmpfs 202M 4.0K 202M 1% /run/user/1001
')
even more weird, I a missing the boot partition in fdisk -L:
$this->bbcode_second_pass_code('', '
Disk /dev/mmcblk0: 14.5 GiB, 15518924800 bytes, 30310400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xac825b48

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 30310399 30308352 14.5G 83 Linux
')
(the linux partition wasn't there first also, I used testdisk and gparted to fix this somehow)

This is all I can think of for now, please suggest any action or reading to fix any of my problems.

Tom
tomzooi
 
Posts: 7
Joined: Fri Mar 27, 2015 3:37 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby tomzooi » Wed Jan 06, 2016 4:02 pm

I think I partly solved 1, but I do not know how (maybe the reboot fixed it with installing the mali drivers. However, I have no sound :(.

aplay -l gives me this for a list of sound cards:
$this->bbcode_second_pass_code('', '**** List of PLAYBACK Hardware Devices ****
card 0: RKHDMISPDIF [RK-HDMI-SPDIF], device 0: SPDIF PCM Playback rk-hdmi-spdif-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
')
alsamixer gives me no controls, displaying only " This sound device does not have any controls." so nothing to unmute or anything. speaker-test yields no sounds either, I am guessing dmesg is also trying to tell me something:
$this->bbcode_second_pass_code('', 'dmesg |grep spdif
[ 9.312275] rockchip-hdmi-spdif rockchip-hdmi-spdif.28: ASoC: CPU DAI (null) not registered
[ 9.329211] rockchip_hdmi_spdif_audio_probe() register card failed:-517
[ 9.346466] platform rockchip-hdmi-spdif.28: Driver rockchip-hdmi-spdif requests probe deferral
[ 11.159097] rockchip-hdmi-spdif rockchip-hdmi-spdif.28: ASoC: CPU DAI (null) not registered
[ 11.174330] rockchip_hdmi_spdif_audio_probe() register card failed:-517
[ 11.195523] platform rockchip-hdmi-spdif.28: Driver rockchip-hdmi-spdif requests probe deferral
[ 11.396392] rockchip-hdmi-spdif rockchip-hdmi-spdif.28: rk-hdmi-spdif-hifi <-> rockchip-spdif mapping ok
')
But I'll be damned if I understand it...
tomzooi
 
Posts: 7
Joined: Fri Mar 27, 2015 3:37 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby tomzooi » Wed Jan 06, 2016 6:41 pm

Turns out video decoding is done by software, only up to 720p, any more and playing gets very slow.

Someone got it to work though (http://wiki.radxa.com/News/2015/7/kodi- ... ck2-square):
$this->bbcode_second_pass_quote('', 'T')echnically I use
- Android's libraries: for access to the vpu device driver and for memory management – both encoding and decoding h264 byte-streams
- libhybris: to access these libraries on linux/ubuntu
- rga2 device driver for 2D HW accelerated blitting and converting frames (yuv/nv21 <=> rgb)
- ARMs OpenGL library, driver and examples (fbdev) to render rotated images using the GPU
- raw framebuffer device access to blit full-screen (full-screen player and recorder)
- avlib to demux movie containers (mp4/mov) to bytestreams (player) and vice versa (recorder)
- Movies from blender projects: http://archive.blender.org/features-gallery/movies/

Due to a clean low-level interface it should be quite easy to add video acceleration to xbmc, avlib-tools, gstreamer, vlc, … Also all hw supported formats should be supported (including HEVC).

Basically this should also work on RK3188 devices, as Androids libs are almost identical and libhybris is also working (my next project...)


I have no idea how he uses the "android libs" though...
tomzooi
 
Posts: 7
Joined: Fri Mar 27, 2015 3:37 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby hipboi » Fri Jan 08, 2016 3:13 am

To run Kodi on rock2 square, you can just download the script here and run it. It will install everything on a debian based system.

http://www.mac-l1.com/v0.1.1/install_mackodi.sh

For Arch, i am afraid you will have to install everything manually, just check the script.
hipboi
 
Posts: 1
Joined: Fri Jan 08, 2016 3:01 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby tomzooi » Fri Jan 08, 2016 3:55 pm

It's partly a help, but I think the main trouble lies deeper given that the support for the hardware isn't correct. I see the script also installs hybris, I'm gonna check out the hybris packages to see how I can install them on arch, unfortunately hard to find libhybris packages and the one I built doesn't seem to be working properly.

Mostly annoying is that I don't know how to test the hardware acceleration from command line or something alike.

I'm also considering building this: https://github.com/radxa/linux-rockchip as a kernel, but that would be a first for me changing the current linux linux-headers package so I'm still searching for a way to do so that I understand.
tomzooi
 
Posts: 7
Joined: Fri Mar 27, 2015 3:37 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby tomzooi » Sun Feb 21, 2016 8:44 pm

$this->bbcode_second_pass_quote('hipboi', 'T')o run Kodi on rock2 square, you can just download the script here and run it. It will install everything on a debian based system.

http://www.mac-l1.com/v0.1.1/install_mackodi.sh

For Arch, i am afraid you will have to install everything manually, just check the script.

This worked, but I have no audio unfortunately.... And cannot get it to work, aplay-l lists:
RKHDMISPDIF, device -: SPDF PCM PLayback rk-hdmi-spdif-hifi-o

I can select it in kodi/gnome-mplayer, but nothing will come out, even using speakertest or the likes.

//edit:
It seems like audio does make it to pulseaudio mixer, pavucontrol shows audio signals coming in when playing audio using gnome-mplayer. However, when I select the RK-HDMI-SPDIF Analog Stero (alsa) it doesn't want to play, nor will it show anything, selecting the RK-HDMI-SPDIF Analog Stero (pulseaudio) does show up as signals in pavucontrol, but not from my speakers, nor my a/v output. Haven't tested SPDIF yet , but I don't have much hope.
tomzooi
 
Posts: 7
Joined: Fri Mar 27, 2015 3:37 am

Re: Arch Linux Arm on Radxa Rock2 Square

Postby sunnystormy » Sat May 14, 2016 1:57 pm

I'm in the same boat, except I have the same SoC inside of a Chromebook. Installing pulseaudio makes the sound "work", except it is VERY fuzzy and extremely quiet. Adjusting controls in "alsamixer" doesn't help. : /

Have there been any updates on the kernel side to improve hardware support for audio in Rockchip SoCs?
sunnystormy
 
Posts: 7
Joined: Fri May 13, 2016 7:00 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 10 guests