Sunday, 26 August 2012

Media in the Home

Now I have moved from student halls to a house, I have begun playing more with media, for instance, I really like the idea of being able to easily play my music in the kitchen. The problem is, all my music is upstairs on my desktop computer, the solution? Mediatomb, Gnome and UPnP.

So what's UPnP, well, I don't really know, but what I have worked out so far, is it works across a network, UPnP devices can find each other automatically, and work out what each other can do.

For this experiment, I was interested in 3 classes of device in UPnP, controlers, media servers, and media renderers. Devices can be more than one class, for instance, lots of devices are media renderers and limited controllers, where the controller can only control the local device.

So, I began by installing mediatomb on my desktop machine. Mediatomb is a media server, it takes content, music pictures or video (and some other stuff), and makes it available over UPnP. Once installed you can configure it with the web interface at http://localhost:49152/ .

Next we need something to render the music that mediatomb makes available, so for this, I used Rygel. You might notice from the wiki page, that Rygel can also be a media server, I haven't tried this functionality as I prefer the daemon nature of mediatomb. So to use Rygel as a media renderer, the playbin plugin must be installed, in Debian this is as easy as installing the rygel-playbin package. Once done, run the rygel command, and if you see this message "Rygel-Message: New plugin 'Playbin' available", it hopefully means its working. I have Rygel currently running on an EeePC in my kitchen, although I am hoping to perhaps replace this with a raspberry pi in the future.

So lets recap, at the moment, my desktop machine is running mediatomb, sharing its content with the network, and my netbook is running Rygel, that can render content with the speakers connected to it. What we need next is a controller, to allow us to actually do something with this. For this we can use one of the gupnp tools, in Debian you need to install the gupnp-tools package. Then start the AV Controler, (gupnp-av-cp from the shell). This allows you to get content from the server, and play it on the renderer.

What I really like about this setup, is that its really extensible. If I can find/write a UPnP controller for my Android phone, I will be able to control the music for my house from my phone. I also found something called rhythmpnp, its a media renderer plugin for Rhythmbox, I haven't managed to run it yet, but I am interested in seeing if it could also be extended to act as a controller?

Saturday, 25 August 2012

GSoC Update 7: Final Evaluation Result

Firstly, I am glad to say that I have passed the evaluation. But that does not mean that my project is over, the Gnome Sudoku game is not yet something that I would call complete.

So, since my last update, I have been working on learning, and implementing in Vala some of the logic techniques that can be used to solve sudokus. The best resource I have found so far for this is Sudopedia. I plan to display opportunities to apply the technique in a help section, as well as highlighting the relevant cells on mouseover.

I also decided to change the way possibilities for a cell are displayed to the user. You can see this, and the previously described feature in the following screenshot.

I realise that the display for the techniques is not brilliant, I am still working out exactly how to display all the information. I am also working to add lots more techniques.

Sunday, 19 August 2012

GSoC Update 6: Progress and the Firm Deadline

Since my last update, I have been working on making the game more playable before the end of my official contributions to the project as part of the GSoC are over. I plan to continue contributing to the project after this, but I would like to be able to submit something usable to Google.

So I began by adding a new game screen, this screen will also allow access to the previously played (saved) games.
Start Screen
Deciding what cell to give when the user requests a hint was done already, but displaying this hint was not. So I implemented a simple mechanism (probably in a bad way), to make the cell flash red. This is also used to warn the user when a cell becomes unfillable (if they have this option enabled).

The undo and redo functionality also needed fixing, I think some of the refactoring I did with the model code broke it. I also added a clear button to the number picker that appears over the board when you click a square.

The final important thing to mention is the preloaded puzzles. The game now includes some puzzles such that the user does not have to generate some straight away, this is also useful at the moment with the generator not fully working.

I next hope to add support for saving the state of current games to disk as JSON, and a help section to identify and explain logic techniques to the user.

Wednesday, 1 August 2012

GSoC Update 5: Solving and Rating Sudoku's

I have now finished off writing, and done some testing of the Vala solver and rater. The solver took quite a while to write, mostly because of my in inexperience with python, once the solver was finished, I started writing the rater. The rater works by watching the solver at work, and using some of its methods in "fake" mode, where they do not actually affect the state of the board.

I have also added some "methods with syntax support" to the SudokuBoard class. This has two improvements in my opinion. Firstly, it allows for statements like this:
 if (board.cells[l1, l2] == 0)
to be simply written like:
 if (board[l1, l2] == 0)
Secondly, it allows sanity checking of the input, to make sure the board can only contain values that its is supposed to.

Next, I will either, depending on the feedback from my mentor, either continue working on the Sudoku generation code (using the solver I have just written to help), or continue working on the interface, adding error highlighting and a start screen.