XMBC

Lubuntu v3.1.x - XBMC added

30 34502
xefil  
Post Last Edited by tony_zhang at 2014-8-7 00:02

Hi guys,

Oh, stop, not so much enthusiasm!


This image contains Lubuntu 14.04 (v3 Lemaker) with a working XBMC, but it is not perfect. I share it to let other people to look in and contribute for better versions.
Here what added on the original Lubuntu_v3 image:

1 OpenSSH server
2 recompiled kernel with additional devices into kernel and parameters needed by sunxi libraries
3 sunxi libraries and software:
a) UMP
b) sunxi-vdpau
c) libhybris
d) XBMC
e) VLC
f) other minor stuff

The problems on XBMC are the following:
- internal player do not have hardware acceleration, VLC and mplayer does
- external players don't allow user interaction (play, pause) [expect VLC using local socket and keymap binding scripts, but slow in reaction].
- external player VLC CAN gain focus but is not always stable, sometimes the decoding is not good. Subtitles and onscreen msgs not supported, it crashes!
- external player MPLAYER CAN NOT gain focus. Here HD video are played well, almost. subtitles supported.
- quit XBMC, sometimes it works, sometimes not; the desktop (lightdm) does not always refresh the desktop on XBMC exit. The result is a freezed XBMC effect, even if the xbmc.bin process is not running anymore

I've solved these with a workaround. I don't like it very much but it works almost. Here how:
When a MKV is choosen from XBMC to be played, an external script is called. XBMC consider this script as external player, even if it isn't. This script closes XBMC (clear or forced), writes the path of the video in a file and restarts lightdm interface. This cause the interface to reload and starts automatically another script at login. This new script looks for the movie to play. If the file contains the movie to play, it starts the movie, first with mplayer, in case of fails, with vlc. Using the players in this way (not within XBMC), user interaction (play/pause/fw/...) are working as expected: mplayer natively, vlc using python bindings, enabled. After ending the video, the file containing the video-path to play is deleted and xbmc starts again. If bananapi reboots/starts-up, the same script is executed. BTW there is no file/movie to play, so it execute XBMC immediatly at login.

Both players (VLC and mplayer) are configured to redirect the audio to HDMI output in passthrough mode. So we can enjoy our Digital Dolby or DTS tracks.

Well, I know, it's not a good solution at all, but in waiting for a more stable environment, in this way I can sit on my sofa and enjoy my movies.

Here the image: http://music.xefil.com/bananapi/Lubuntu_1404_v3.1_XBMC.img.zip

The image is for a 16GB SD card. The card contains some Videos for testing pruposes. I've started using a 64GB SD card, then, after creating an iso with Win32DiskImager, I've shrinked it to fit a 16GB SD. Restore tested and working.

Hope you enjoy ;-)

Cheers,

Simon
Thanks Simon.

dlanor  
Post Last Edited by dlanor at 2014-8-3 12:11

Couldn't you use the "playercorefactory.xml" feature of XBMC to let the other media players that have hardware acceleration handle the physical playback of the media, with XBMC used merely as the GUI to select media for such playback.

That's what I and some others do with the 'XMBC for Android' app installed for the Banana Pi Android image. (I already posted about this in another thread before seeing this one.)

I think it should work equally well in Lubuntu, as long as the external media players available are capable of being called this way without putting up any GUI of their own. (Except perhaps for an in-play OSD GUI when user halts playback, such as the player I use under Android has.)

Perhaps that is the method you originally tried, though it seems from your original post as if the external players available here have some problems when called from XBMC, but I'm not entirely clear on how you were trying to do that. You speak of quitting XBMC, which is not the normal way of handling such delegated playback (though I guess you may have needed to do it due to the 'focus' issues).

Best regards: dlanor

xefil  
Reply 3# dlanor

Hello!
If you remember I've posted the playercorefactory file in the other thread, also I know how it works.
The issue here is that the external player doesn't work as expected due the descrived issues.
Also meanwhile I've tested this solution. Something I don't like at all, but in waiting to solve the Focus problems...
Now I'm on travel on holidays. When I'll back i'll continue to try other ways.
I think the graph libraries with XBMC are the issue. This would explain Why only the players standalone ade working well.


    Bye!

Simon

ged  
Post Last Edited by ged at 2014-8-7 08:44

Can't wait till this gets rebased off of a more stable image...  Maybe like the one Tony just posted...
(http://forum.lemaker.org/redirec ... ptid=2066&pid=11946)

Update: The new more stable 3.1.1 base image is uploaded on the downloads page: http://www.lemaker.org/resources/9-38/image_files.html

Post Last Edited by Dave_Driesen at 2014-8-25 02:30

Post Last Edited by Dave_Driesen at 2014-8-25 02:24

Might be just me but this image needed usermod -G audio <username> for passthrough audio to work.

Awesome for DVD/AVI playback in XBMC but full HD mkv plays back poorly. The debian image I have (think it was made by Tony Zhang) features flawless full HD HW accellerated commandline mplayer playback with HDMI audio passthrough and the works. If this could be rivalled then your image would own all.

[edit: never mind, I have already built XBMC on the HW accellerated raspbian image instead. Working on an image to share]

Hi, can u work on the infrared  too, I look forward that what boot it will load the xbmc and with the infra red remote we can just use it as normal media player without log in and etc

Hi,

if i start this version without pulseaudio i can configure audio out to HDMI (driver only sunxi default pcm available in XBMC) but it is always send to analog. If i install pulseaudio (only av. driver is pulsaudio in XBMC) it is always send to HDMI, although if i configure analog as output device.
Any idea how to get an installation where i can change the output device?

Post Last Edited by Dave_Driesen at 2014-9-3 14:28

One way I've found is to output to ALSA, card 1 device 0 (This will route through HDMI).

In pulseaudio, you can achieve this by adding the alsa audio sink to /etc/pulse/default.pa:
  1. load-module module-alsa-sink device=hw:1,0
Copy the Code
You can also use mplayer to force playback through card 1 device 0.

For the latter to work though, you need to make sure the audio card is not in use when you launch mplayer.

I'm using below script for this.. Feel free to optimize:
  1. #!/bin/bash
  2. # Script can be called with file name as parameter. Using a playlist is optional.
  3. echo "$@" > /tmp/playlist.txt

  4. # Ugly hack, user needs quite some privileges for this, so you may want to avoid killall
  5. sudo killall xbmc.bin
  6. sudo killall xbmc

  7. starttime=$(date +"%s")

  8. # This will loop for 15 seconds or until no /dev/pcmC* devices are in use
  9. while : ;do
  10.     if [[ $(lsof /dev/snd/pcmC* | wc -l) == 0 ]]; then break; fi
  11.     runtime=$(date +"%s")
  12.     diff=$(($runtime-$starttime))
  13.     if (( $diff > 15 )); then break; fi
  14. done

  15. # Launch mplayer with some parameters. Look them up if you don't know what they do
  16. /usr/bin/mplayer \
  17.         -ao alsa:device=hw=1.0 \
  18.         -ac hwac3,hwdts,spdifac3,spdifeac3,spdifdts, \
  19.         -channels 6 \
  20.         -slang en,eng,pl,nl,du,dut \
  21.         -aspect 1.333 \
  22.         -fs \
  23.         -playlist /tmp/playlist.txt

  24. rm -f /tmp/playlist.txt
Copy the Code

Tonband  
Is it possible, to make a 8GB Version of it, or can i do it on my own with your Image?

You have to log in before you can reply Login | Sign Up

Points Rules