[maemo-developers] Xsp pixel-doubling solutions for Nokia 770?

From: Eero Tamminen eero.tamminen at nokia.com
Date: Mon May 7 10:36:07 EEST 2007
Hi,

ext Siarhei Siamashka wrote:
>> AFAIK Xserver requests & waits DSP to stop updating the framebuffer
>> before proceeding.  This works with HW, but you cannot expect it to
>> work reliably with misc X clients as there are no guarantees about
>> what they do. If client is not processing X events, the response would
>> be waited forever and device freezes.  If X server has some timeout for
>> the client reply, then the server and client can be updating the
>> framebuffer at the same time and that was what we wanted to avoid
>> in the first place.
> 
> Timeout is a perfectly valid solution in my opinion. It just requires that
> xserver and some thin wrapper library used by misc clients (SDL) both 
> interact correctly. Interface of this wrapper library should be designed
> in such a way, that it is safe and hard to be misused (special timeout 
> code which automatically terminates the process which refuses to give
> framebuffer back to xserver).
> 
> I may provide some extra details about my vision of implementation 
> details if anybody is interested.
> 
>>> I guess it can't be helped and I will make an example application for
>>> using framebuffer directly and some kind of tutorial. Don't know when
>>> I will have enough free time to do this though.
>>>
>>> I'm pretty much confident that direct framebuffer access (also with
>>> pixel doubling support) is quite possible for SDL. I don't care much
>>> if you believe me or not :) Someone just needs to do the dirty work
>>> and implement all this stuff.
>
>> Yes, it just cannot be done safely / reliably.  
> 
> I can't be completely sure, but I think it is possible to do safely/reliably.
> At least it is worth trying in my opinion. The difference in our views is
> that you see xserver as the only valid Nokia 770 citizen and everything
> else looks like a very ugly hack to you. 

I meant reliable from the normal users's point of view.  What you
propose can potentially have the device screen in state that requires
user to reboot the device. That's why pixel doubling is not officially
supported on 770.


> I see the problem from the completely different perspective. For many 
> games xserver is irrelevant, they use SDL API and that is what they care
> about (xserver is just an additional extra layer). Game developers would like
> to have a fast and reliable SDL implementation which could make efficient use
> of all the hardware features that can benefit games. If xserver can provide
> all of this with some standard or nonstandard extensions, that's fine. We only
> need to estimate the amount of development resources and time needed to 
> do these modifications to xserver and SDL to make use of these features. As
> games are not a primary target for Internet Tablets, I doubt that anything
> like this will be officially done any time soon (at least before the Nokia 770
> end of life). Am I wrong?
>
> In this case tweaking SDL to use framebuffer directly may have a much
> lower cost. Especially considering that you have already solved this
> framebuffer sharing problem for DSP video playback. I did not suggest
> anything completely new ;)

If there's something done for this on 770, it needs to come from
the community.  And I have no idea about whether it could even then
end up in some possible future 770 hacker's edition.


> It is not quite related, but games also need a reliable and low latency method
> to play sounds. Current esd daemon solution is not very good for games. Maybe
> modifying SDL to deal with dsp tasks directly can provide some improvement.
> Also it would be very nice if SDL_Mixer could use dsp codecs transparently
> without any extra hacks to play mp3 music.

I think there are some limitation from how many sources current DSP code
can mix sound data and current code supports only current sound sources.

If background music is needed, I'd recommend mikmod (i.e. using *.mod
files for it).  SDL has support for that, but I'm not sure whether that
is built into 770 SDL version.

Alternative is to use the media-server D-BUS API for playing music.
(AFAIK it's not suitable for playing sound effects due to latency)



>> But for hackers it's enough that it works when it works I guess. :-)
> 
> I'm not sure if I can consider myself a hacker :) Something that just works
> is perfectly enough for a prototype. But a production system needs a reliable
> solution, hence I'm trying to start discussing the implementation details.
> 
> SDL optimization for Nokia 770 might be an interesting task for some student
> with lots of free time.
> 
> In any case, trying alternative solutions is a good thing, it drives the
> progress, allows us to improve our skills and gain experience. We get 
> the best solution (whatever it would be) and everyone benefits as a 
> result :)


	- Eero


More information about the maemo-developers mailing list