Banana Pi: Autostart things

Banana Pi: Autostart things
This is what worked:
Make a file called "XXX.desktop" that looks something liike:

[Desktop Entry]
Name=HotelCity Autostart
Exec=/home/hotelcity/Desktop/HotelCityContent/autostart.sh
Type=Application
Terminal=false

Save it in:
/etc/xdg/autostart

The actual script referred to above can have logic in it, etc...




Run script after login (couldn't get this to work)
edit /etc/rc.local

export DISPLAY=:0
export VDPAU_DRIVER=sunxi

/home/hotelcity/Desktop/autostart.sh

Autostart after login (couldn't get this to work)
Add a .desktop file to your ~/.config/autostart directory (create one if not available) like:
[Desktop Entry] 
Type=Application
Exec=/home/user/Desktop/script.sh

Automatically at lightDm startup:
(Note this is NOT what you want if you want a script to run after login, for that see above)
Edit: /etc/lightdm/lightdm.conf
Add: session-setup-script =/home/pi/Desktop/SCRIPT.sh

Auto-login account

SSH without password

Banana Pi: Quiet Boot

Banana Pi: Quiet Boot
Eliminate boot messages:
edit uEnv.txt. Replace console=tty0 with console=/dev/null

Note the tux logo is not removable (it's compiled into the kernel)


Custom splash:
In theory you can use plymouth, but I never got it to work properly.

You can also use something like FBI (frame buffer image) but I never got this to work properly either:

Enable insserv:
sudo ln -s /usr/lib/insserv/insserv /sbin/insserv

Do this:
http://www.edv-huber.com/index.php/problemloesungen/15-custom-splash-screen-for-raspberry-pi-raspbian

After:
update-rc.d a_splashscreen defaults 98 02

Burning Images

Burning Images
For SBC using SD cards (all of them?). Use dd. On the mac, it's nicer to use pv (pipe viewer) because it gives you feedback on the progress.

Note: There are certain weird images (android on banana pi which I never got to work anyway) that apparently cannot be written this way. Use a windows machine and PhoenixCard instead. 

Basic procedure:
- insert card
- figure out which disk it is 
- unmount it
- write using pv or dd
- eject

diskutil list
diskutil unmountDisk /dev/diskX
pv < SOURCE > DEST
diskutil eject /dev/diskX

Alternate syntax:
pv < /dev/sda > /dev/sdb

dd if=IMAGEFILE| pv | sudo dd of=/dev/rdiskN bs=1m


Banana Pi: Boot from USB Stick

Banana Pi: Boot from USB Stick
WARNING: I never got this to work (functions but won't complete boot, seems something wonky with my USB stick). Trouble is that once you edit the file, if you can't boot back in you can't fix it and must re-burn (unless you have an ARM Linux distro handy)

Per this thread
http://my5cent.spdns.de/en/banana-pi/banana-pi-bananian-von-festplatte-booten.html

Mount the boot partition and edit the startup params:
mount /dev/mmcblk0p1 /mnt/
pico /mnt/uEnv.txt

Change the parameters
from:
root = /dev/mmcblk0p2

to (or what you like):
root = /dev/sda1 

Banana Pi: Resolution Problems

Banana Pi: Resolution Problems
Pi attempts to auto-detect resolution, but not all monitors push this data. If they don't, you'll end up with a weird resolution and no option to change. Googling refers you to xrandr, etc, but I didn't find this helpful. Instead:

Per this thread:
http://forum.lemaker.org/thread-1577-1-1.html

Disable EDID (auto detection. Be aware this disables autodetection (duh)):
mount /dev/mmcblk0p1 /mnt/
pico /mnt/uEnv.txt

Look for:
disp.screen0_output_mode=EDID:1280x1024p60

Remove "EDID," optionally specify the resolution you want


Related:
xrandr --output CRT0 --brightness 0.7 --crtc CRT0 --gamma 1:1:1 --newmode "800x600_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync 

Banana Pi: Accelerated Video

Banana Pi: Accelerated Video
PART 1: CEDRUS

VLC didn't work

Status (out of date):


This worked:
http://linux-sunxi.org/Cedrus



NOTE: I began with the stock bananapi image:
Lubuntu_1404_For_BananaPi_v3_1_1.img


Regarding modprobe:
to find the module (name changes depending on hardware):
find /lib/modules | grep cedar 
check to see if the dev exists now:
ls /dev/cedar_dev

To ensure modprobe runs at startup
add modprobe sunxi_cedar_mod to /etc/modules


Using:
* Could only get mpv to work (mplayer seems to be missing vdpau support?)*

Also might need to do this manually:

sudo modprobe sunxi_cedar_mod
chmod 666 /dev/cedar_dev
chmod 666 /dev/disp

Add these to /etc/bash.bashrc 
export DISPLAY=:0
export VDPAU_DRIVER=sunxi

MPV:
Finally, this:
mpv --vo=vdpau --hwdec=vdpau --hwdec-codecs=all --fs --loop=inf melina.mp4

mpv --vo=vdpau --hwdec=vdpau --hwdec-codecs=all --fs --loop=inf ./*
To get it to play automatically at lightDm startup:
Edit: /etc/lightdm/lightdm.conf


PART 2: FBTURBO
Above lets us playback videos but we can also accelerate other stuff (like X), do this:
http://wiki.lemaker.org/BananaPro/Pi:GPU