Sunday, 20 December 2009

Dumb FTP Server now on N900

Dump FTP Server is now available on the N900. It uses QT 4.6, which currently is only available in extras-devel, so beware.

Download location: http://team.pld-linux.org/~wolf/dftpd_0.1.3_armel.deb. Hopefully will be in extras soon.
Source repository: http://gitorious.org/dftpd

Changelog (0.1.2):
- Workaround for Firefox handling of PASV command.
- Maemo port.
- If binding to port 21 fails (for example as a result of lack of root priviliges), the server will try to listen on port 2121.

Changelog (0.1.3):
- Passive mode should now be working. Because of the used workaround only WIFI connections are supported.
- Bigger icon in application manager.
- Upload speed should now be at par with download speed.

Tuesday, 10 November 2009

Impossible?

Friday, 12 June 2009

UAC considered harmful

I have switched from XP to Windows 7 on my work machine recently. Everything was working fine until this has happened:
A quick research revealed the following (source):

Before a 32-bit process is created, the following attributes are checked to determine whether it is an installer:

  • The file name includes keywords such as "install," "setup," or "update."
This is confirmed by changing the file name of the offending exe:
The executable of course is not an installer of any kind and does not require any extra privileges. It just reads two files and creates a third one. Furthermore, it's a third-party application and I can't just change its file name without breaking things for everyone else. There seems to be some kind of white list of trusted applications, but nobody other than Microsoft can modify it.

Without the ability to take that application out of UAC "protection" the only viable thing to do is to turn the UAC off. Great work! I feel more secure already.

Thursday, 22 January 2009

dftpd 0.1.1 available

New version of symbian FTP server has been published.

Changes:
- Empty directories are now listed correctly.
- Directory creation and removal is now implemented.

Download.

Saturday, 22 November 2008

Major sound handling improvements in S60 SDL

Audio handling in S60v3 SDL port was thoroughly broken. Well, it managed to play something, but the way it did that was just horrid.

In case of OpenTTD, the difference between the 'sdl' and 'null' audio drivers was very much visible. The game had that smooth feeling to it when no audio was playing, but was jerky with the sounds enabled. To make things worse there were cracks and pops just about all the time, which added more of that unpleasant "the phone can't handle it" feeling. Fortunately, these problems are now a thing of the past.

The taxation problem was fixed by these commits. The original author has some really weird ideas there. Introduction of multiple audio buffers increases the audio lag without any benefits. And the handling of audio buffer is just crazy. I will quote the commit message here:
Audio buffer size is there to allow a balancing act between smooth sound playback (ie. big buffer) and low latency times (ie. small buffer). The original author clearly didn't understood this concept, as the buffer size here always was 256 bytes, which resulted in playback system that had all the minuses of the two approaches but no pluses.
With one problem handled, the next one was just around the corner. The cracks and pops may not be easy to hear, but you'll for sure get a feeling that something's wrong. I even have a waveform plot with the gaps in audio data shown: The solution of that problem was to remove some never-correct delay time calculations and use a mutex-like mechanism to handle internal SDL audio wait. With that done the sound is now flawless.

There's also some new functionality added:
  • With silent profile enabled SDL will mute the audio. Mixing will still be done, for the need of games expecting audio-timer synchronization.
  • When the game is out of focus the audio will be disabled as well as mixing, to reduce energy usage.
  • In out of focus situations the video blit incurs a 0.1s delay to reduce power usage. The wait time is rather short for better responsivity when focus is regained and for some rare situations when the screen needs to be redrawn.
Thanks to the above changes the phone with OpenTTD in background now consumes just 0.13W of energy. Comparing it to total idle consumption of 0.11W and previous OpenTTD consumption of 0.5W it's a substantial improvement.

Saturday, 18 October 2008

OpenTTD battery usage


Energy usage (ie. battery life) has been brought to my attention recently. As can be seen above, OpenTTD running in background doesn't handle things nice and battery drain is much greater than it should be.

The average value for "OpenTTD running" is 1,07W, for "OpenTTD in background" it's 0,51W and for "Idle" it's 0,11W.

Other Symbian SDL ports also will have this problem. So, quick advice: don't leave OpenTTD, C2Doom, ScummVM running on the phone in background, your battery will die very quickly if you do so.

Edit: The background energy usage of my SDL's port has been reduced to 0,13W.

Thursday, 9 October 2008

The sorry state of symbian SDL

Probably noone of you care about the fact that there are four different versions of the SDL library for symbian based devices. When I was starting my S60 OpenTTD port there were only three. What has happened in between?

The first one was created by Hannu Viitala and was targetted at antique devices, had no sound support, etc... we're not that much interested in it.

The second one, maintained by Marcus Mertama, is an evolution of the previous, with support for S60 3rd edition devices (basically anything worth considering for purchase right now), sound and a lot of problems. More on that later.

The third one is, again, based on the previous one. It's used by anotherguest in his ScummVM port and focuses on wide device range support (including UIQ, touch screen, etc). Since it had the same problems as the second version, I didn't looked too deeply into it.

The fourth option is constantly fixed (or rather stripped down from features) by yours truly. There were several issues in Markus' version which really bothered me.

The first was support for S60v1 and S60v2.
  • If I'm going to modify the code, I have no way to test if the code works.
  • The platform is severely limited by screen resolution, processor speed, available RAM, lack of Open C and Open C++ or even by inability to use static variables.
  • The platform is dead.
So, drop it. Leave only S60v3.

The next big issue was resolution support. Or rather lack of it. The game resolution was always stretched to the phone's display resolution, which resulted in something that can be seen on the images below. The left one is original, the right one is scaled one. Horrible. And barely playable, thanks to ultra slow symbian blitting procedures.





My version does it right (or rather should be doing, I didn't actually checked it) by setting the right display orientation and by not stretching the display. This is one of things where my and other authors views differ. I don't accept the scaling, Marcus and anotherguest say that users prefer when game is displayed on full screen, without borders.

Another big issue, display orientation support. All S60v3 devices can either be in portrait (normal use) or landscape (think "camera") mode. On most devices the landscape mode is hidden from user during normal usage, but there are devices, like N95 or N82, which rotate the display when user physically rotates the phone. On phones that lack this feature, orientation support can be faked in software by using small drawing hacks. So consider this: phone is in portrait orientation, user runs application and sees something like that:
"Oh, display is not distorted, I can rotate the phone and play, how nice" he thinks. And most of the time he's correct. But when he has that new and shiny N95 this happens:
The phone has switched orientation to landscape, the application didn't follow. MAJOR FAIL! My SDL version correctly handles such situations:



Marcus writes on his site that his SDL allows "S60 programming without pain of Symbian!" This is completly untrue, as Marcus promotes the use of symbian-ridden CSDL class, which more or less requires some arcane knowledge. And when we're at it, just look at the documentation. There's a plethora of bells and whistles to enable or disable, only you don't have the slightest idea which option does what and some of them are there just because they can be. Take virtual mouse cursor for example. I doubt it was used anywhere (not in C2Doom for sure) and my experiences with OpenTTD, which is a mouse-driven game, has proven that it's completly unusable.

The amount of such undocumented or useless features only makes the code harder to read (oh, you don't want to look at it; 5 different coding styles in just 20 lines of code), without giving any profits, so the most sane option for me was brutal removal. So long, virtual mouse cursor, bye, various display modes, adiós console view, пока display overlays. You won't be missed. Such Reduction Of Useless Features not only makes the code easier to read, but also reduces the number of potential bugs and makes adding new (but this time usable) features less daunting task.

Of course, the library is still not finished (will it be ever?). Despite the fixes mentioned above and all the smaller ones, like fixing palette animation, making sound play smoother, there's still a lot of work to be done before I will be able to just get some random game using SDL and compile it for my phone without much ado. But even with having that said, my SDL port is The Best* symbian SDL version currently available.

* for me.