Installing
With sugar-jhbuild (For your workstation)
- First, check out sugar-jhbuild and get it running. (Best info for this is at http://wiki.laptop.org/go/Sugar_with_sugar-jhbuild
) For those too lazy to look at the link, you should be able to get most of the way there by doing the following.
- Check out sugar-jhbuild
- Build sugar
$ cd sugar-jhbuild
/sugar-jhbuild$ ./sugar-jhbuild
- Run sugar
/sugar-jhbuild$ ./sugar-jhbuild run
- With sugar up and running, we now need to checkout the MediaPlayer activity
- Checkout the MediaPlayer activity. (note: this is on the helix community CVS tree, you will need to have an account to access it.)
$ cvs -z3 -d:ext:developername@cvs.helixcommunity.org:/cvsroot/olpc-player co modulename
- Make sure that you have Helix and player_kit_python built and working on your system.
- If you don't know where to start for this, check out http://helixcommunity.org/

- You should build helix and player_kit_python in different directories. player_kit_python makes a single binary (hxplay.so) that needs to be in a place that python can see it. (So either add it to your path, or better yet just copy (or symlink) it to where your helix core dll's live)
- This part should be completely transparent when helix makes it's way to the laptop. For end users it should be as easy as "import hxplay"
- Make sure that your HELIX_LIBS environment variable is set! (hxplay will not work without it!)
- Check to see if it is set...
- If nothing prints, or if it is the wrong path...
$ export HELIX_LIBS=/path/to/my/helix/libs
(Or better yet add it to your bash.rc)
- Now we can install the activity so we can run it with sugar...
- Get into a sugar shell. (Doesn't do much other than add some sugar goodies to your path)
$ cd sugar-jhbuild
/sugar-jhbuild$ ./sugar-jhbuild shell
- Now navigate to where you checked out the MediaPlayer activity
$ cd olpc-helix
/olpc-helix$ cd mediaplayer
- And we should be able to set up our activity for development
/olpc-helix/mediaplayer$ ./setup dev
This symlinks the current directory to the /home/username/Activities folder. On startup sugar will look at this directory for activities. So sugar pretty much runs the activity right out the directory you initially checked it out in, so do all of your hacking there. IMPORTANT NOTE: Sugar must be restarted before any changes in any activities are picked up. It's really annoying but I haven't found a way around it
- And the last step. We need to install MediaPlayer's icons in sugar so that we can use them in the gui.
$ cp /path/to/olpc-helix/mediaplayer/icons/* /path/to/sugar-jhbuild/build/share/icons/sugar/scalable/stock
On the XO hardware (The physical laptop)
- Turn on the laptop, and open up a developer console.
- alt+=
- or if you must you can use a terminal (ctrl+F1)
- Install some goodies
- we only need subversion IIRC
$ su
$ yum install subversion
- Note: This takes FOREVER on the laptop >_<
- Also, useful commands like iwconfig, ifconfig, dhclient, etc are not in your path by default. (They are located in /sbin or /usr/sbin)
- Checkout the MediaPlayer activity. (This is in a private tree right now so only OSL developers will have access to it. I'll get this moved to pub soon. If you can't check this out, then use this
for now)
$ exit #don't want to be root anymore
$ cd #We want to be in our home directory
$ svn co https:
- Make sure that you have Helix and player_kit_python built and working on your system.
- If you don't know where to start for this, check out http://helixcommunity.org/

- You should build helix and player_kit_python in different directories. player_kit_python makes a single binary (hxplay.so) that needs to be in a place that python can see it. (So either add it to your path, or better yet just copy (or symlink) it to where your helix core dll's live)
-
- Make sure that your HELIX_LIBS environment variable is set! (hxplay will not work without it!)
- Check to see if it is set...
- If nothing prints, or if it is the wrong path...
$ export HELIX_LIBS=/path/to/my/helix/libs
(Or better yet add it to your bash.rc)
- Install the MediaPlayer activity
$ cd olpc-helix/mediaplayer
olpc-helix/mediaplayer$ ./setup.py dev
- And the last step. We need to install MediaPlayer's icons in sugar so that we can use them in the gui.
$ su -
# cp /path/to/olpc-helix/mediaplayer/icons/* /usr/share/icons/sugar/scalable/stock
# exit
- ctrl+alt+backspace to restart sugar
- NOTE: I don't remember if ./setup.py dev works correctly on the laptop. If you have problems or sugar doesn't pick up the activity, try ./setup.py install . As a last resort, run ./setup.py dev and go the the Activities directory in your home folder. There you should see something like MediaPlayer.activity . Either copy or symlink this directory to /usr/share/activites/ and sugar should pick it up.
Now we should be ready to rock! (running MediaPlayer)
- Run sugar...
- with sugar-jhbuild...
/sugar-jhbuild$ ./sugar-jhbuild run
- or turn on your laptop
- And you should see the MediaPlayer icon in the frame where all the other activitie's icons are, click on it, and bam!
- Opening media is handled by a fairly non-descript gtk filebrowser. (Top right button)
- Play and pause are in the top left group of buttons, next and previous do nothing yet
- A clickable, dragable progress bar is on the very bottom of the window.
Things that do not involve installing 
Troubleshooting (aka Problems I had at first)
- If there is no icon.
- MediaPlayer didn't install right. Go back and follow the instructions carefully. If all else fails try navigating to olpc-helix/mediaplayer and running ./setup install (This will install MediaPlayer to sugar-jhbuild/build/share/activities, it might help?)
- If MediaPlayer just "dies" (Won't run when you click the icon, the Icon might show up briefly then dissapear)
- Make sure you are using the newest build of sugar.
- sugar-jhbuild: Update sugar automatically by simply running ./sugar-jhbuild with no arguments
- XO: Look on the OLPC wiki
for info on updating software. (Usually involves flashing a usb drive with an updated image and booting the laptop to it)
- Make sure the environment variable HELIX_LIBS is set!!!
###If you keep having problems with this, add this near the top of MediaPlayerActivity.py
#ADD THE FOLLOWING LINE (where /path/to/helix/libs is actually your path to your helix libs :) )
os.environ["HELIX_LIBS"]="/home/morgabra/helix/helix/debug"
# Now with HELIX_LIBS explicitly set by our script, we can import our goodies
# This adds our helix goodies to our path and imports hxplay
helix_libs = os.environ.get("HELIX_LIBS")
sys.path.append(helix_libs)
import hxplay
- If the player crashes when loading media, or doesn't play at all...
- Make sure you are using supported media. (Make a little script outside of sugar to spawn a player and play your test media to be sure)
import sys, os
os.environ["HELIX_LIBS"]="/home/morgabra/helix/helix/debug"
helix_libs = os.environ.get("HELIX_LIBS")
sys.path.append(helix_libs)
import hxplay
hxplay.init()
player = hxplay.open("file:)
player.start()
for i=0 to 200:
hxplay.doevent()
- Make sure your volume is up
(Sounds silly, but there isn't any visual queues to volume in sugar, especially on the olpc hardware. So check alsa-mixer or use the volume buttons on the laptop)
Known bugs/Stuff to do
- Random, simple stuff
- Doesn't gracefully handle an end of presentation or opening a new file. (simple as adding some self.player.stop() and self.player.close() in some proper places)
- We should make the size the player according to the window geometry. (instead of hardcoding it)
- We need to make the video shift vertically to center itself once it has resized. (A 16:9 ratio movie will stretch all the way horizontally, but will play with its top edge at the very top of the screen)
- GUI stuff
- Need a better file browser/way to open files
- Need to put the progressbar in a better place. (More clickable, more visible, in the toolbar maybe?)
- Need to hook up the next and previous buttons and make them do stuff. (Hold to seek, click to skip?)
- Probably need a stop button. (So we can kill the presentation and the player, not just pause it)
- Need to add something (gtk.label?) to visually show time elapsed/total time (ie 13:37/60:00 = 13min37sec elapsed out of 60min. Put this in the toolbar? Should we use something smaller than seconds? 1/10? 1/100?)
- Media Stuff
- We need to get at the headers (tags) of the media we are going to play. As this player is pretty close to universal, this might be a chore as different kinds of media do this differently.
- At the very least we need artist, album, and title
- And we need a way to display this for videos and music
- Video: Somewhere in the toolbar? Dropdown info when you move the mouse? tooltip?
- Audio: Stylized and sexy formatting right in the middle of the screen, as it is just a black void when there isn't any video.
- OOOHHH! Audio visualizations
(Or not?)
|
|