psubuntu logo
It is currently Tue Sep 07, 2010 1:09 pm
Register


Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2, 3  Next
Author Message
Offline
 Post subject: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Tue Apr 01, 2008 4:34 pm 
 Profile

Joined: Sun Mar 30, 2008 8:53 am
Posts: 36
As we all know, sony have restricted access to the RSX chip for Linux. Recently, some very clever hackers were able to find a 'FIFO/push buffer' which would eventually lead to a fully functional 3d driver.

But there are problems with this. Firstly, a full driver would take years to complete, and secondly, Sony can very easily change something which would break these drivers (this recently happened with the 2.10 update)

There is another option. It's possible to use the SPUs in the cell to do colour conversion for us. This finally allows us to have mythtv running at a bearable speed, even in HD resolutions.

This how-to focuses on the second option, and is geared for people who desperately want to have their PS3s as mythtv-frontend boxes (like myself). However, the basics of this how-to should work with programs like mplayer, vlc, etc.

Note that this driver will not use the SPUs to actually decode the video, that's part of the spu-medialib and will require application support to work. All we are using the SPUs for is the colour conversion.

Note that this driver will not use the SPUs to actually decode the video, that's part of the spu-medialib and will require application support to work

This process is pretty straight forward. This guide will assume that you have already got a mythtv backend running somewhere on your network, and that you know how to add frontends to it.

If you have not installed a mythtv-frontend on your PS3 Ubuntu installation, then do so now. As some hints, I'd suggest doing a bare-bones install from the alternative ubuntu disc (type 'cli' at the inital boot prompt), and then install the ubuntu-mythtv-frontend package. This will bring in everything you need, including a bare-bones X installation, and will bring up the frontend automatically at boot. Simple.

I'm using Ubuntu Gutsy here. I doubt this will work with Feisty, but it should be okay with Hardy, once it's released.

Now that you have your mythtv frontend working on your PS3, you'll notice how bad the video playback is. This is easy to fix (but slightly involved).

Firstly, you need to create a file missing from the ubuntu packages:
Code:
# sudo nano -w /usr/lib/pkgconfig/libspe2.pc

In the editor which opens, copy and paste the following (it's best to login from a desktop PC so you can easily copy and paste this)
Code:
prefix=$(prefix)
exec_prefix=$(exec_prefix)
libdir=$(libdir)
includedir=$(includedir)

Name: libspe2
Description: A wrapper library to adapt the JSRE SPU usage model to SPUFS
Version: 2.2.0
Requires:
Conflicts:
Libs: -L${libdir} -lrt -lpthread
Cflags: -I${includedir}
Use Ctrl+X to exit, Press Y and then Enter to save the file.

This block you can just do line by line:
Code:
# sudo apt-get install libtool build-essential libspe2-dev automake xorg-dev subversion
# wget http://linux.yes.nu/PS3Ubuntu/files/spu-medialib_0.1git20071126-1_powerpc.deb
# sudo dpkg -i spu-medialib_0.1git20071126-1_powerpc.deb
# svn co svn://svn.ps2dev.org/ps3ware/trunk/xf86-video-spu
# cd xf86-video-spu
# autoreconf -if && ./configure --prefix /usr && make
# sudo make install
# cd ~
The first apt-get command will bring in a lot of packages. Don't panic, they are small and won't get in the way of anything. The rest fetches a dependency not available in the standard ubuntu repositories and then compiles the driver.

After the driver has built, you'll need to edit your xorg.conf:
Code:
sudo nano -w /etc/X11/xorg.conf
Change your device section to look like this:
Code:
Section "Device"
        Identifier      "Generic Video Card"
        Driver          "spu_fbdev"
        Option "ShadowFB" "false"
EndSection
The ShadowFB option is required

Add this to the end:
Code:
Section "Module"
#       Load  "dbe"
        Load  "extmod"
#       Load  "glx"
#       Load  "record"
        Load  "freetype"
        Load  "type1"
#       Load  "dri"
EndSection

For reference, my entire xorg.conf looks like this:
Code:
Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "gb"
        Option          "XkbOptions"    "lv3:ralt_switch"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "ZAxisMapping"          "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection

Section "Device"
        Identifier      "Generic Video Card"
        Driver          "spu_fbdev"
        Option "ShadowFB" "false"
EndSection

Section "Monitor"
        Identifier      "Generic Monitor"
        Option          "DPMS"
        HorizSync       30-70
        VertRefresh     50-160
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Device          "Generic Video Card"
        Monitor         "Generic Monitor"
        DefaultDepth    24
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
EndSection

Section "Module"
#       Load  "dbe"
        Load  "extmod"
#       Load  "glx"
#       Load  "record"
        Load  "freetype"
        Load  "type1"
#       Load  "dri"
EndSection
Restart X:
Code:
sudo /etc/init.d/gdm restart

Fingers crossed, you should now have really nice playback with mythtv.

As I had to 'work backwards' with this (as in, try to figure out what a base install would need), I may have missed packages in the first apt-get line. Let me know if I missed anything.

Ideally, a package would make this process even easier. As I really don't know what I'm doing when it comes to these things, I cannot provide one. If anyone is willing, it would make this process even easier.

CPU usage with the new driver is as follows:
Code:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                         
3899 mythtv    15   0  205m  80m  39m S   34 37.6  26:54.54 mythfrontend.re   
This is with a SD recording, but playing on a HD TV at HD resolutions. I don't have any HD sources yet, if anyone is willing to test, I'd love to hear back from you.

You should be aware that this driver is not finished. There are bugs, some of them are down-right nasty. I strongly suggest you have openssh-server installed on your PS3 so you can log into it to issue 'killall -9 Xorg' it if needed. I find that sometimes the driver crashes the display. You can't even use the keyboard when this happens and the only way to fix it is to login from another computer and issue that command.

You may find that the sound seems to work okay, but the graphics are garbage. If this happens, exit mythtv, restart X, and then fire-up mythtv again. The frontend package I mentioned earlier will do this automatically when you quit mythtv.

_________________
My How-Tos:


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu Apr 03, 2008 7:37 am 
 Profile

Joined: Thu Mar 27, 2008 9:25 am
Posts: 15
Well, since the SPU stuff from a Mplayer guide I found doesn´t work, I will give this tutorial a try. Hopefully it works. So I guess this is just a driver and will work with any movieplayer? VLC and stuff like that? And can I turn post-processing on in VLC with this driver?


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu Apr 03, 2008 5:29 pm 
 Profile

Joined: Thu Mar 27, 2008 9:25 am
Posts: 15
ok, can you please help? I installed this driver on my 2.20 PS3 machine and now I have the same problems which I had with this Mplayer spu-medialib thing.

The problem is that (I try it with VLC now) when I load an AVI, it loads for one second, and does let me hear sound for one second, and then it auto shuts down VLC...

I realy couldn't do anything wrong, I followed the guide step by step..
is there something wrong with this SPU medialib stuff since the 2.20 update?

Please help me, I realy want to use Freevo on my PS3 or VLC atleast...


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu Apr 03, 2008 5:35 pm 
 Profile

Joined: Thu Mar 27, 2008 8:14 am
Posts: 656
Location: Finland
Dannydeman wrote:
The problem is that (I try it with VLC now) when I load an AVI, it loads for one second, and does let me hear sound for one second, and then it auto shuts down VLC

Run VLC from terminal and you'll see from there why it crashes.

_________________
New users, read and understand forum rules! Click me!
In a nutshell
- Use forum search always before posting new messages.
- Remember to add [solved] to subject line of your post if solution is found.
- Never make double posts


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu Apr 03, 2008 5:40 pm 
 Profile

Joined: Thu Mar 27, 2008 9:25 am
Posts: 15
dannydeman@dannydemanps3:~$ vlc

Tthen it opens VLC, and I select the movie from the USBstick which is an episode of Stargate Atlantis in XVID...and it dis work with VLC before this tutorial

This is what I see in the terminal and VLC shuts down.

VLC media player 0.8.6c Janus
X Error of failed request: 255
Major opcode of failed request: 140 (XVideo)
Minor opcode of failed request: 19 ()
Serial number of failed request: 83
Current serial number in output stream: 84


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Sun Apr 27, 2008 1:48 pm 
 Profile

Joined: Sun Apr 27, 2008 1:45 pm
Posts: 1
Ribs wrote:
Code:
# sudo apt-get install libtool build-essential libspe2-dev automake xorg-dev subversion


In Hardy you have to install xutils-dev too. Or is it part of the ubuntu-desktop which I didn't install (just bare base-system).


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu May 29, 2008 6:21 am 
 Profile

Joined: Thu May 29, 2008 6:06 am
Posts: 1
kinda-sorta works great.

Got it installed per the guide, SD mythtv went from slideshow to tv show, on some recordings. Others are garbled like bad sync on an old analog tv.

HD recordings (ATSC 1080i) are just a black screen, but the audio works. In XMB, the video looks great but there is no audio.

Maybe the SPU scaler code doesn't like mode 3.


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Thu Jun 12, 2008 10:41 pm 
 Profile

Joined: Thu Jun 12, 2008 10:35 pm
Posts: 1
hi, i am very interested in this thread - mainly because i am contemplating buying a ps3 for basically hidef (1080p) playback of mythtv and dixv/mkv stuff.

can someone comment on the (current) performance of hidef content on 1080p?

if someone can persuade me that there is active development in this field, i would be willing to buy and actively contribute to this forum (i have some knowledge of linux kernels and packaging tools)

cheers,


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Fri Jun 13, 2008 4:56 am 
 Profile

Joined: Thu Mar 27, 2008 8:14 am
Posts: 656
Location: Finland
yee379 wrote:
hi, i am very interested in this thread - mainly because i am contemplating buying a ps3 for basically hidef (1080p) playback of mythtv and dixv/mkv stuff.

can someone comment on the (current) performance of hidef content on 1080p?

if someone can persuade me that there is active development in this field, i would be willing to buy and actively contribute to this forum (i have some knowledge of linux kernels and packaging tools)

cheers,
Sorry this is getting off topic, but if this is only thing you're trying to accomplish with ps3 imho I'd suggest to wait.

_________________
New users, read and understand forum rules! Click me!
In a nutshell
- Use forum search always before posting new messages.
- Remember to add [solved] to subject line of your post if solution is found.
- Never make double posts


Top
 

Offline
 Post subject: Re: How-to: Smooth playback with mythtv (or any other video app)
PostPosted: Sun Jul 13, 2008 12:18 am 
 Profile

Joined: Sun Jul 13, 2008 12:12 am
Posts: 3
I ran through this whole how-to and now xubuntu hangs on boot at "running local boot scripts (/etc/rc.local)"

Any idea what's gone wrong and how to fix it?


Top
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Design By Poker Bandits