Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
The Maze of Galious
 Brain Games Forums : The Maze of Galious
Subject Topic: building mog without sound files Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 28 December 2009 at 23:12 | IP Logged Quote wdehoog

Hi,

I am packaging mog for my nokia n800. I want to create the package without any sound files (ogg will not work anyway).

I tried to remove all functionality from sound.c and prevent loading the paths of the sound files but mog segfaults at startup.

Does anybody have a clue of where I can look for what goes wrong?

regards,

Willem-Jan
Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
Jorito
Admin Group
Admin Group
Avatar

Joined: 30 December 2002
Location: Netherlands
Posts: 1930
Posted: 28 December 2009 at 23:28 | IP Logged Quote Jorito

First of all, check the log file for what's happening. The log file is most often in the same dir as the executable (eg. where you built the game). There's also some debug flag you can set so more info is logged, forgot where exactly tho.

IIRC, MoG depends on both SDL_mixer and SDL_sound, and you probably need to remove both of them from the package entirely. Meaning from all the .h and .cpp files. Also, I suspect not all calls to audio are done from sound.c .

Why not pick one single sound set, convert its sounds to mp3 and bundle that? I still have the originals of (most of) my Jorito sound set, so I can give you MP3 versions without quality loss...
Back to Top View Jorito's Profile Search for other posts by Jorito Visit Jorito's Homepage Send Private Message Add to Buddy List
 
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 29 December 2009 at 16:47 | IP Logged Quote wdehoog

Maemo has SDL_mixer but without ogg support. Using mp3 could be possible if I can get SDL_Sound build for maemo (which it has not). Where can I find these mp3 files?

Having MoG without sound files would save battery life and a lot of storage space.
Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 29 December 2009 at 17:26 | IP Logged Quote wdehoog

Using soundkonverter I converted the jorito dir to mp3.

I found out that if I want to distribute 1 sound dir it has to be called sound/original otherwise -> segfault.

Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
Jorito
Admin Group
Admin Group
Avatar

Joined: 30 December 2002
Location: Netherlands
Posts: 1930
Posted: 30 December 2009 at 16:01 | IP Logged Quote Jorito

Hmm, I think I changed the code to use the Jorito soundset by default. You can find that change in gameaux.cpp in line 2633. And if you have your own config file (the game writes this when you exit it, iirc) it will use that value.

About storage space: you can always use a lower bitrate for the audio files, of course. I think I used 160 or 192kbps for my audio files, but using 128kbps and a variable bit rate would help.
And I think you'd definitely will want the sound effects .

Any luck yet with the SDL_Sound lib?

Back to Top View Jorito's Profile Search for other posts by Jorito Visit Jorito's Homepage Send Private Message Add to Buddy List
 
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 30 December 2009 at 20:41 | IP Logged Quote wdehoog

Managed to build SDL_mixer and SDL_sound for maemo with ogg support. It results in very slow game start compared with wav files but 5MB for ogg and 28MB for the wav files makes ogg a preferable solution. (Although I don't know if I will be allowed to update the current libsdl-mixer1.2 lib of the maemo repo.)

MoG kept segfaulting when having 1 sound set since for some reason s_path is not set before being printed. I just put an if around it since I don't know how to make it have the correct value.

Next problems will be controlling (the n800 has no keyboard) and what looks like the lack of screen refresh (when I switch to another app/window and then switch back the screen is black and remains black).
Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 30 December 2009 at 23:51 | IP Logged Quote wdehoog

Mapped some keys to n800 buttons. Screen refresh is no problem anymore.

Next problem: game does not exit and hangs when calling Mix_CloseAudio().
Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
Popolon
Admin Group
Admin Group
Avatar

Joined: 05 November 2002
Location: Spain
Posts: 3135
Posted: 03 January 2010 at 05:19 | IP Logged Quote Popolon

It's been years since I touched a line of the source code of Mog. But what happens if you simply comment out the "Sound_initialization" call in the main.cpp file? If I don't remember bad, it should just work but without sound. Btw, Im really curious to see MoG in Maemo! I myself was considering an N900!!
Back to Top View Popolon's Profile Search for other posts by Popolon Visit Popolon's Homepage Send Private Message Add to Buddy List
 
wdehoog
Newbie
Newbie


Joined: 28 December 2009
Location: Netherlands
Posts: 6
Posted: 03 January 2010 at 20:21 | IP Logged Quote wdehoog

Yes I could package it without sound support but it is less fun. Although sound seems to run down battery time on my n800 quit a lot.

The problem of hanging at exit seems to be caused by a combination of g++, sdl and pthreads on maemo. A small test program compiled with g++ shows the same behaviour but when compiled with gcc it works flawless.

I have now changed libsdl1.2 to use SDL_KillThread instead of SDL_WaitThread to end the audio and timer threads and that also seems to work.

However I cannot distribute them through the maemo extras repository so I'll have to put them on my own website or forget about publishing.

On the N900 it might work much better since it probably has newer versions of libraries and development tools and better sound support to safe battery time. I don't have access to one so I cannot test it.

The n900 also has a keyboard so no tricks needed for saving the passwords. I still have to come up with such trick for my keyboardless n800.
Back to Top View wdehoog's Profile Search for other posts by wdehoog Send Private Message Add to Buddy List
 
Popolon
Admin Group
Admin Group
Avatar

Joined: 05 November 2002
Location: Spain
Posts: 3135
Posted: 04 January 2010 at 06:17 | IP Logged Quote Popolon

What about having only music or only sound effects?

Btw, do you have any video of it running? I'm curious
Back to Top View Popolon's Profile Search for other posts by Popolon Visit Popolon's Homepage Send Private Message Add to Buddy List
 
Jorito
Admin Group
Admin Group
Avatar

Joined: 30 December 2002
Location: Netherlands
Posts: 1930
Posted: 08 January 2010 at 21:38 | IP Logged Quote Jorito

Yeah, a video would be very nice!

Weird that the sound is responsible for draining the battery so much. I suspect you don't see a power loss that's so extreme when you use it as an mp3 player?

If the problem is that the CPU is too busy with music data (and thus reducing battery power), maybe the music/sound should be converted to something more suitable for the N800. No idea what format/bitrate/etc. that would mean tho.
Back to Top View Jorito's Profile Search for other posts by Jorito Visit Jorito's Homepage Send Private Message Add to Buddy List
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.01
Copyright ©2001-2003 Web Wiz Guide

This page was generated in 0,1680 seconds.