Author Topic: Cubian Video Kiosk with Mplayer on CB2  (Read 32160 times)

Offline classdroogies

  • Newbie
  • *
  • Posts: 6
  • Karma: +4/-0
    • View Profile
Cubian Video Kiosk with Mplayer on CB2
« on: October 12, 2013, 07:00:30 pm »
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 :
Code: [Select]
sudo apt-get update
sudo apt-get install cubian-update
sudo cubian-update
sudo reboot

Packages installation :
Code: [Select]
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 :
Code: [Select]
git clone https://github.com/linux-sunxi/libvdpau-sunxi.git
Code: [Select]
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 :
Code: [Select]
KERNEL=="disp", MODE="0777", GROUP="video"
KERNEL=="cedar_dev", MODE="0777", GROUP="video"

Add your user to the video and audio groups :
Code: [Select]
sudo usermod -G sudo,video,audio cubie
Login auto with slim :
Code: [Select]
login_cmd exec /bin/sh - ~/.xinitrc
default_user cubie
auto_login yes

Create video folder :
Code: [Select]
mkdir ~/video
Download Sintel's trailer for a test :
Code: [Select]
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 :
Code: [Select]
mplayer -fs -ao alsa:device=hw=1.0 -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau -loop 0 /home/cubie/video/*.mp4
Reboot and  8)
« Last Edit: December 01, 2013, 04:49:17 pm by classdroogies »

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #1 on: October 12, 2013, 09:18:46 pm »
This is really great.  I've tried to get mplayer working on linaro, but when I try running it with

Code: [Select]
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?

Offline classdroogies

  • Newbie
  • *
  • Posts: 6
  • Karma: +4/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #2 on: October 13, 2013, 03:18:15 am »
Hi patwood,

I see this message with mplayer on debian. If I list the outputs videos :
Code: [Select]
mplayer -vo help
vdpau output doesn't exist, because mplayer is not build with.

mplayer2 support vdpau by default try it.

« Last Edit: October 13, 2013, 03:22:59 am by classdroogies »

Offline Bangonkali

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #3 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.

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #4 on: October 13, 2013, 08:39:55 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.

Offline cubieplayer

  • Full Member
  • ***
  • Posts: 177
  • Karma: +22/-1
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #5 on: October 16, 2013, 10:45:42 pm »
very nice tutorial
« Last Edit: February 11, 2014, 10:41:38 pm by cubieplayer »
Cubian:http://cubian.org/ Cubian  Helpdesk:https://github.com/cubieplayer/Cubian/issues

Offline Bangonkali

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #6 on: October 17, 2013, 01:08:05 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

  • Guest
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #7 on: November 26, 2013, 11:15:51 am »
Hi patwood,

I see this message with mplayer on debian. If I list the outputs videos :
Code: [Select]
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):

Code: [Select]
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:
Code: [Select]
lsmod | grep cedaryields nothing (after modprobe) and /dev/cedar_dev doesn't exist.                   
« Last Edit: November 26, 2013, 01:17:53 pm by tman »

Offline GeorgeIoak

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +1/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #8 on: November 26, 2013, 06:43:45 pm »
Could you perhaps make a SD or NAND image of your setup so we can test it easily?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #9 on: November 27, 2013, 12:23:55 am »
Also, I think I'm unable to load the cedar module:
Code: [Select]
lsmod | grep cedaryields 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

  • Guest
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #10 on: November 27, 2013, 12:46:44 pm »
Quote from: patwood
Do you get an error from modprobe?
Code: [Select]
cubie@Cubian:~$ modprobe --first-time sunxi_cedar_mod
ERROR: could not insert 'sunxi_cedar_mod': Module already in kernel

Quote from: patwood
What does "uname -a" say?
Code: [Select]
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: patwood
What does "find /lib/modules | grep cedar" say?
Code: [Select]
cubie@Cubian:~$ find /lib/modules | grep cedar
/lib/modules/3.4.43+/kernel/drivers/media/video/sunxi/sunxi_cedar_mod.ko

Quote from: patwood
What 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:
Code: [Select]
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:
Code: [Select]
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
« Last Edit: November 27, 2013, 12:54:40 pm by tman »

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #11 on: November 27, 2013, 02:42:13 pm »
Quote from: patwood
Do you get an error from modprobe?
Code: [Select]
cubie@Cubian:~$ modprobe --first-time sunxi_cedar_mod
ERROR: could not insert 'sunxi_cedar_mod': Module already in kernel

Quote from: patwood
What does "uname -a" say?
Code: [Select]
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: patwood
What does "find /lib/modules | grep cedar" say?
Code: [Select]
cubie@Cubian:~$ find /lib/modules | grep cedar
/lib/modules/3.4.43+/kernel/drivers/media/video/sunxi/sunxi_cedar_mod.ko

Quote from: patwood
What 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:
Code: [Select]
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:
Code: [Select]
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:

Code: [Select]
[    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

  • Guest
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #12 on: November 27, 2013, 04:09:32 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!

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #13 on: November 27, 2013, 04:21:17 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.

Offline GeorgeIoak

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +1/-0
    • View Profile
Re: Cubian Video Kiosk with Mplayer on CB2
« Reply #14 on: December 01, 2013, 04:22:46 pm »
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
Quote
cubie 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:

Code: [Select]
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?