![]() |
|
|||||||
| XBMC Development Developers forums for XBMC related development. Programmers/Coders only! No end-user support, no bug reports, and no feature/function requests here! Please, add platform prefix for suggestions that are not platform-independent!: Thread prefixes; "[LINUX]", "[LIVE]", "[MAC]", "[WINDOWS]", and "[XBOX]" |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Team-XBMC Developer
Join Date: Jan 2004
Location: England
Posts: 55
![]() |
hi
i am trying to write a visualisation plugin but even with an empty render function i only get 25fps. i tracked this down to a sleep(16) call in cguiwindowvisualisation::render(). is it needed and if so how can i get my vis running at full frame rate? cheers mrc
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#2 |
|
Team-XBMC Developer
Join Date: Dec 2003
Posts: 765
![]() |
yes it's needed so the audio codecs have enough cpu to process the audio.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#3 |
|
Team-XBMC Project Manager
Join Date: Sep 2003
Location: Sweden
Posts: 10,582
![]() |
@butcher, could the gpu be used in any (better) way to help process visualization rendering? (goom is also running at a very low resolution)
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first. |
|
|
|
|
|
#4 |
|
Team-XBMC Developer
Join Date: Dec 2003
Posts: 765
![]() |
depends how the vis is coded. generally people coding visualisations for xbox should be looking to rely heavily on the gpu not the cpu. the ideal is to have the vis run on the gpu almost exclusively and just use the cpu for audio steam decode and ffts for sprectrum analysis.
btw sleep(16) gives a maximum framerate of 62.5 fps, if you're only getting 25 with an empty render function then something is using a lot fo cpu.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#5 |
|
Team-XBMC Project Manager
Join Date: Sep 2003
Location: Sweden
Posts: 10,582
![]() |
i found this browsing nvidia's developers website, not sure if it can be used for this but here you go anyway:
fast math routines http://developer.nvidia.com/object/f..._routines.html entire nvidia directx8 sdk 5.0 http://developer.nvidia.com/object/nvidia_dx8_sdk.html general-purpose computation using graphics hardware http://www.gpgpu.org/ microsoft directx reference for developers http://msdn.microsoft.com/library....8000410 nvidia audio sdk http://developer.nvidia.com/object/n...audio_sdk.html nvidia audio - generate compelling audio effects. http://developer.nvidia.com/object/docs_audio.html nvidia developers websites: http://developer.nvidia.com http://nvdeveloper.nvidia.com
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first. |
|
|
|
|
|
#6 |
|
Team-XBMC Developer
Join Date: Jan 2004
Location: England
Posts: 55
![]() |
thanks for your replies.
i did the following test in pal with no vis and no music playing. on the main menu with nothing going on it runs at 50fps. if i add a sleep(16) to capplication::render() the frame rate drops to 25fps. because there is a blockuntilverticalblank() it is never going to run faster than 50fps. sleep(16) is over half a frame which explains why the frame rate halfs. does the audio codec really need half a frame to do its stuff? surely this can't be right? most xbox games play a wma at the same time as running the whole game at 50fps! cheers mrc
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#7 |
|
Team-XBMC Developer
Join Date: Dec 2003
Posts: 765
![]() |
xbox games don't play wma... they play either uncompressed wavs or adpcm wavs which are decoded in hardware. we do software decoding of things like wma, mp3 and such, which a game wouldn't. still the sleep can probably be reduced to around 8-10 ms.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#8 |
|
Team-XBMC Developer
Join Date: Jan 2004
Location: England
Posts: 55
![]() |
so how do they play user soundtracks then?
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first.
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Mar 2004
Location: England
Posts: 4
![]() |
i'm just not buying this.
i'm going to refute a lot of what's been said because it's just incorrect. firstly, on "xbox games don't play wma" yes, they do. it's a supported and recommended format for music in xbox games. i can accept they aren't using wma for sound effects (gunshots etc.) but for music there is no reason not to, especially since there is support in the title libraries for them. i know several games, including the one i am working on which use wma. secondly, "it's needed so the audio codecs have enough cpu to process the audio". i've run winamp on a 450mhz pc in the background while playing quake3 on a geforce1 and got great fps, how come these audio codecs need ~16ms to do their processing in the foreground on a faster, dedicated processor. thirdly, "btw sleep(16) gives a maximum framerate of 62.5 fps, if you're only getting 25 with an empty render function then something is using a lot fo cpu" yes, there is and it's the blockuntilverticalblank() call. this is suicide in production code, and will lock the framerate in a very nasty fashion, at least use the present parameters (presentation interveral one or imediate) if you're going to do this kind of debauchery, or, even better, allow the visualisation that is running to say "i want immediate presentation" or "i want you to vsync this". i don't understand why you have a vblank and a sleep() call, one or the other should suffice if you really want to starve rendering for audio processing (which you shouldn't because the system ought to manage the threads well enough anyway). sorry to rant, but this stuff needs sorting out or interest isn't going to be perked because people aren't going to write a vis. when the performance is in such a bad state for them to start with. cheers, -mezz edit: typos |
|
|
|
|
|
#10 |
|
Team MediaPortal
Join Date: Sep 2003
Posts: 509
![]() |
cool down a bit, and i'll try to explain it
first this blockuntilverticalblank() call. this is actually needed, not for music offcourse, but for playing movies. the updateoverlay() we are using on the yuy2 overlay textures is done immediately. without the blockuntilverticalblank() call this would result in much tearing effects when watching a movie. in any case you always wanna lock the video with the vertical sync to avoid these tearing effects. thats what this call does also please remember that pal/ntsc means you always get 25/30 fps outputed to the television. so its absolutely nonsense to run the gui (or visualisation) on 300 fps. in the end just 25/30 fps will be shown on your tv anyway btw i'm talking about 25/30 fps progressive cause tv's are interlaced you'll see 50/60 fps interlaced now the sleep() thing there's absolutely no need for this call. so why is it here you may ask? well the problem is the spectrum.vis if you remove the sleep() call it will be very very ugly dont ask me why, i didnt write the spectrum.vis. with the sleep() its ok. i agree this is an ugly hack and it should be fixed in the spectrum.vis frodo
__________________
XBMC Project Founder (Retired), now head programmer of MediaPortal |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thumbnail rendering? | jimk72 | Skin Development | 4 | 2005-11-17 00:48 |
| 3d visualisation | Punk | XBMC Feature Suggestions | 1 | 2005-03-08 15:34 |
| New rendering methods | princi | XBMC for Xbox Specific Support | 2 | 2005-02-15 04:05 |
| Visualisation | walterb1 | XBMC for Xbox Specific Support | 5 | 2004-09-30 03:12 |
| Visualisation Help Please!! | Stace | Skin Development | 1 | 2004-03-17 14:50 |