FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 

THIS FORUM IS NOW CLOSED FOR ALL NEW POSTING. PLEASE GO TO THE NEW PSUBUNTU FORUMS TO POST NEW TOPICS.

This forum will still be available and searchable, but no posting is allowed. We encourage all users to sign up for an account on the new forums.

You can help us maintain valuable information from this forum by copying it over to the new forums or adding it to the PSUbuntu Wiki.

How-to: Smooth playback with mythtv (or any other video app)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PSUbuntuForums Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Ribs



Joined: 28 Aug 2007
Posts: 82

PostPosted: Tue Dec 25, 2007 10:34 pm    Post subject: How-to: Smooth playback with mythtv (or any other video app) Reply with quote

Remember not to post questions here. Use this thread for any questions or feedback:
http://psubuntu.com/forum/viewtopic.php?p=5986

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.1 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)

It's 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 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}


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 avalible 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 a 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.

If you want to leave feedback or ask questions, please us this thread:
http://psubuntu.com/forum/viewtopic.php?p=5986
Back to top
View user's profile Send private message
Termy58



Joined: 17 Feb 2008
Posts: 4

PostPosted: Sun Feb 17, 2008 5:17 am    Post subject: Reply with quote

Great tutorial, I needed this Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
rova



Joined: 21 Feb 2008
Posts: 1

PostPosted: Fri Mar 07, 2008 2:01 am    Post subject: It's been a few weeks now - packages? Reply with quote

Its been a few weeks now, any word on this tweak being put into a package for retards like me?
Back to top
View user's profile Send private message
luckyluckxx



Joined: 07 Mar 2008
Posts: 1
Location: UK

PostPosted: Fri Mar 07, 2008 10:06 am    Post subject: LOL Reply with quote

great topic

WBR,
Alex
_________________
pharma supermarket
Back to top
View user's profile Send private message Visit poster's website
Ribs



Joined: 28 Aug 2007
Posts: 82

PostPosted: Thu Mar 13, 2008 7:35 pm    Post subject: Re: It's been a few weeks now - packages? Reply with quote

rova wrote:
Its been a few weeks now, any word on this tweak being put into a package for retards like me?
I'm planning to do something for Hardy, but I'm not making any promises.

Between starting a new job and my social life, I have very little free time for these things now Sad
_________________
My How-Tos:
wireless sixaxis, no need to swap kernel! http://psubuntu.com/forum/viewtopic.php?t=2408
Want smooth playback in all of your media players and not just mplayer? No problem! http://psubuntu.com/forum/viewtopic.php?t=1805
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PSUbuntuForums Forum Index -> Tutorials All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Theme xand created by spleen.