December 14, 2019, 09:20:04 pm

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


Cubian Video Kiosk with Mplayer on CB2

Started by classdroogies, October 12, 2013, 07:00:30 pm

Previous topic - Next topic

classdroogies

October 12, 2013, 07:00:30 pm Last Edit: December 01, 2013, 04:49:17 pm by classdroogies
Hi,
A tutorial for create a basic video kiosk on CB2 with mplayer, for fun  :)

I use Cubian up to date with the last kernel :
https://github.com/cubieplayer/Cubian/wiki/Wiki-Index

Install and run cubian-update :
sudo apt-get update
sudo apt-get install cubian-update
sudo cubian-update
sudo reboot


Packages installation :
sudo apt-get upgrade
sudo apt-get install xserver-xorg-core xinit xserver-xorg-video-sunximali slim alsa-utils mplayer2 gcc make pkg-config libvdpau1 libvdpau-dev


Add sunxi_cedar_mod in /etc/modules for activate cedar.

Install libvdpau-sunxi library for mplayer :
git clone https://github.com/linux-sunxi/libvdpau-sunxi.git

cd libvdpau-sunxi
make
sudo make install


Add environment variable VDPAU_DRIVER=sunxi in /etc/environment.

Add udev rules for change the permission on /dev/disp and /dev/cedar_dev in /lib/udev/rules.d/90-sunxi-disp-permission.rules :
KERNEL=="disp", MODE="0777", GROUP="video"
KERNEL=="cedar_dev", MODE="0777", GROUP="video"


Add your user to the video and audio groups :
sudo usermod -G sudo,video,audio cubie

Login auto with slim :
login_cmd exec /bin/sh - ~/.xinitrc
default_user cubie
auto_login yes


Create video folder :
mkdir ~/video

Download Sintel's trailer for a test :
wget http://ftp.nluug.nl/ftp/graphics/blender/apricot/trailer/sintel_trailer-1080p.mp4 -O ~/video/sintel_trailer-1080p.mp4

Create ~/.xinitrc to launch mplayer :
mplayer -fs -ao alsa:device=hw=1.0 -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau -loop 0 /home/cubie/video/*.mp4

Reboot and  8)

patwood

This is really great.  I've tried to get mplayer working on linaro, but when I try running it with

mplayer -fs -ao alsa:device=hw=0.0 -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau sintel_trailer-1080p.mp4


I get the following message:

  Error opening/initializing the selected video_out (-vo) device.
...
  Video: no video

Then it goes on to play the audio, but no video.  Did you ever see this?

classdroogies

October 13, 2013, 03:18:15 am #2 Last Edit: October 13, 2013, 03:22:59 am by classdroogies
Hi patwood,

I see this message with mplayer on debian. If I list the outputs videos :
mplayer -vo help

vdpau output doesn't exist, because mplayer is not build with.

mplayer2 support vdpau by default try it.


Bangonkali

Very nice tutorial. But it's strange that I can play Video and no Audio. Any notes I may have missed in this? I'm using Gnome install GUI over my Cubian.

patwood

Quote from: Bangonkali on October 13, 2013, 04:32:20 pm
Very nice tutorial. But it's strange that I can play Video and no Audio. Any notes I may have missed in this? I'm using Gnome install GUI over my Cubian.


cat /proc/asound/cards

Modify the alsa:device setting to use your HDMI alsa card.

cubieplayer

October 16, 2013, 10:45:42 pm #5 Last Edit: February 11, 2014, 10:41:38 pm by cubieplayer
very nice tutorial

Bangonkali

Quote from: patwood on October 13, 2013, 08:39:55 pm
Quote from: Bangonkali on October 13, 2013, 04:32:20 pm
Very nice tutorial. But it's strange that I can play Video and no Audio. Any notes I may have missed in this? I'm using Gnome install GUI over my Cubian.


cat /proc/asound/cards

Modify the alsa:device setting to use your HDMI alsa card.


Thanks Patwood! Somehow I got it to work.

tman

November 26, 2013, 11:15:51 am #7 Last Edit: November 26, 2013, 01:17:53 pm by tman
Quote from: classdroogies on October 13, 2013, 03:18:15 am
Hi patwood,

I see this message with mplayer on debian. If I list the outputs videos :
mplayer -vo help

vdpau output doesn't exist, because mplayer is not build with.

mplayer2 support vdpau by default try it.


I get the same error (audio, but no video), I am running mplayer 2 (2.0-554-gf63dbad-1+b1 on debian):


Available video output drivers:
        vdpau   VDPAU with X11
        xv      X11/Xv
        gl_nosw OpenGL no software rendering
        x11     X11 ( XImage/Shm )
        xover   General X11 driver for overlay capable video output drivers
        sdl     SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)
        gl      OpenGL
        gl_sdl  OpenGL with SDL
        dga     DGA ( Direct Graphic Access V2.0 )
        fbdev   Framebuffer Device
        fbdev2  Framebuffer Device
        aa      AAlib
        caca    libcaca
        v4l2    V4L2 MPEG Video Decoder Output
        dfbmga  DirectFB / Matrox G200/G400/G450/G550
        null    Null video output
        directfb        Direct Framebuffer Device
        mpegpes MPEG-PES to DVB card
        yuv4mpeg        yuv4mpeg output for mjpegtools
        png     PNG file
        jpeg    JPEG file
        gif89a  animated GIF output
        tga     Targa output
        pnm     PPM/PGM/PGMYUV file
        md5sum  md5sum of each frame


I allowed all the steps in the OP, but couldn't get it to work  :(

Also, I think I'm unable to load the cedar module:
lsmod | grep cedar
yields nothing (after modprobe) and /dev/cedar_dev doesn't exist.                   

GeorgeIoak

Could you perhaps make a SD or NAND image of your setup so we can test it easily?

patwood

Quote from: tman on November 26, 2013, 11:15:51 am
Also, I think I'm unable to load the cedar module:
lsmod | grep cedar
yields nothing (after modprobe) and /dev/cedar_dev doesn't exist.                   


Do you get an error from modprobe?  What does "uname -a" say?  What does "find /lib/modules | grep cedar" say?  What does "grep cedar /lib/modules/*/modules.builtin" say?  What does "dmesg | grep cedar" say (after the modprobe)?

tman

November 27, 2013, 12:46:44 pm #10 Last Edit: November 27, 2013, 12:54:40 pm by tman
Quote from: patwoodDo you get an error from modprobe?


cubie@Cubian:~$ modprobe --first-time sunxi_cedar_mod
ERROR: could not insert 'sunxi_cedar_mod': Module already in kernel


Quote from: patwoodWhat does "uname -a" say?


cubie@Cubian:~$ uname -a
Linux Cubian 3.4.67+ #4 SMP PREEMPT Wed Nov 6 08:31:09 CST 2013 armv7l GNU/Linux


Quote from: patwoodWhat does "find /lib/modules | grep cedar" say?


cubie@Cubian:~$ find /lib/modules | grep cedar
/lib/modules/3.4.43+/kernel/drivers/media/video/sunxi/sunxi_cedar_mod.ko


Quote from: patwoodWhat does "dmesg | grep cedar" say (after the modprobe)?

Nothing. It appears the cedar module is already compiled in the kernel. I am using the updated Cubian distro.

Relevant devices:

cubie@Cubian:~$ ls /dev/disp /dev/cedar_dev
ls: cannot access /dev/cedar_dev: No such file or directory
/dev/disp


libvdpau seems to be installed correctly:

cubie@Cubian:~$ find /usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_sunxi.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1.0.0

patwood

Quote from: tman on November 27, 2013, 12:46:44 pm
Quote from: patwoodDo you get an error from modprobe?


cubie@Cubian:~$ modprobe --first-time sunxi_cedar_mod
ERROR: could not insert 'sunxi_cedar_mod': Module already in kernel


Quote from: patwoodWhat does "uname -a" say?


cubie@Cubian:~$ uname -a
Linux Cubian 3.4.67+ #4 SMP PREEMPT Wed Nov 6 08:31:09 CST 2013 armv7l GNU/Linux


Quote from: patwoodWhat does "find /lib/modules | grep cedar" say?


cubie@Cubian:~$ find /lib/modules | grep cedar
/lib/modules/3.4.43+/kernel/drivers/media/video/sunxi/sunxi_cedar_mod.ko


Quote from: patwoodWhat does "dmesg | grep cedar" say (after the modprobe)?

Nothing. It appears the cedar module is already compiled in the kernel. I am using the updated Cubian distro.

Relevant devices:

cubie@Cubian:~$ ls /dev/disp /dev/cedar_dev
ls: cannot access /dev/cedar_dev: No such file or directory
/dev/disp


libvdpau seems to be installed correctly:

cubie@Cubian:~$ find /usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_sunxi.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1.0.0



Okay, first, if there's a .ko file, that means the module probably isn't baked into the kernel; it could be loaded at startup via /etc/modules. Also, if the module is built in, you will get something from "grep cedar /lib/modules/*/modules.builtin"; if it's not, you'll see entries in modules.order.

Second, even if the module's built-in, you should see something like this from dmesg:

[    2.430857] [cedar dev]: install start!!!
[    2.438009] [cedar dev]: install end!!!


So the question is why isn't it initializing.  If the module is listed in /etc/modules, comment that out and try modprobe again from a command line.  If you have a serial port, see if any errors pop up there.

Oh, and what's your kernel command line look like (cat /proc/cmdline)?  You're not setting sunxi_ve_mem_reserve=0 to save memory, are you?

tman

Quote from: patwood on November 27, 2013, 02:42:13 pm
Oh, and what's your kernel command line look like (cat /proc/cmdline)?  You're not setting sunxi_ve_mem_reserve=0 to save memory, are you?


I might have...  ::)

I added the memory save parameters without thinking of the consequences. You're right about the cedar module, it's being loaded according to /etc/modules. It works perfectly now, thanks!

patwood

Quote from: tman on November 27, 2013, 04:09:32 pm
Quote from: patwood on November 27, 2013, 02:42:13 pm
Oh, and what's your kernel command line look like (cat /proc/cmdline)?  You're not setting sunxi_ve_mem_reserve=0 to save memory, are you?


I might have...  ::)

I added the memory save parameters without thinking of the consequences. You're right about the cedar module, it's being loaded according to /etc/modules. It works perfectly now, thanks!


Well, the reason I asked is because I did the same thing a while back!  The cedar module should probably generate some log message if the memory isn't available.

GeorgeIoak

I got some time to try this out and I'm not getting it to work. I'm trying this on a CB1 and using the latest Cubian release. What's odd at this point is that when I try to debug what is going on I can no longer issue a sudo command. It comes back and says
Quotecubie is not in the sudoers file
. I can ssh in with cubie/cubie but can't do any sudo commands.

For reference here's some info:

cubie@Cubian:~$ sudo nano /etc/modules
[sudo] password for cubie:
cubie is not in the sudoers file.  This incident will be reported.

cubie@Cubian:~$ modprobe --first-time sunxi_cedar_mod
ERROR: could not insert 'sunxi_cedar_mod': Module already in kernel

cubie@Cubian:~$ uname -a
Linux Cubian 3.4.67+ #18 PREEMPT Wed Nov 6 08:26:36 CST 2013 armv7l GNU/Linux

cubie@Cubian:~$ find /lib/modules | grep cedar

cubie@Cubian:~$ ls /dev/disp /dev/cedar_dev
/dev/cedar_dev  /dev/disp

cubie@Cubian:~$ find /usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1.0.0
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_sunxi.so.1

cubie@Cubian:~$ lsmod | grep cedar

cubie@Cubian:~$ dmesg | grep cedar
[    3.555148] [cedar dev]: install start!!!
[    3.561979] [cedar dev]: install end!!!

cubie@Cubian:~$ cat /proc/cmdline
console=tty0 console=ttyS0,115200 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x800p60 root=/dev/mmcblk0p1 rootwait panic=10 consoleblank=0
cubie@Cubian:~$


I do get the login menu on the HDMI monitor but it doesn't let me log in with cubie/cubie. Perhaps this has something to do with the slim modification?