'VGA Device Output' node and MK-Mediaplayer (Alpha 3)
--- Please print this documentation: you just might need it! ---
NOTE PLEASE:
You use this software at your own risk! Although I don't expect it to damage your PC, videocard or Monitor, I cannot guarantee this!
Please read this entire document before you attempt to install the VGA Device output node if you want to be optimally prepared. If you just want to get it going fast and easy, you should at least read this.
Hardware supporting the 'VGA Device Output' node (as far as is known):
- nVidia, using the unified Haiku driver: used in Zeta 1.2 by default (status per V0.81):
- Cold-start and BIOS-start support for (overlay and blit modes supported on all listed cards):
- TNT 2;
- TNT 2-M64;
- Vanta/Aladdin TNT2;
- GeForce 256;
- GeForce 2 MX/Ti/GTS;
- GeForce 2 Integrated GPU (Nforce);
- GeForce 3 (Ti);
- GeForce 4 MX/Ti;
- GeForce 4 Integrated GPU (Nforce 2);
- GeForce (4 MX) PCX 4300;
- GeForce FX/PCX 5xxx;
- Quadro (2/4/5xxx style FX).
- BIOS-start-only support for:
- TNT 1 (overlay and blit modes);
- GeForce FX/PCX 6xxx (blit mode only, NV40/NV45 (GeForce 6800) also overlay mode);
- GeForce FX/PCX 7xxx (overlay and blit modes);
- Quadro (6xxx/7xxx style) (blit mode only, NV40/NV45 (GeForce 6800 style) also overlay mode).
- Matrox, using the unified Haiku driver: used in Zeta 1.2 by default (status per V0.28):
- Cold-start and BIOS-start support for:
- G100 (Desktop display only);
- G200 (overlay mode);
- G400 (overlay mode);
- G450 (overlay mode);
- G550, including PCIe type (overlay mode).
- BIOS-start-only support for:
- Millenium I (Desktop display only);
- Millenium II (Desktop display only).
- Matrox, using the Be driver as a 'backup', not recommended though: (Dano, R5(?)):
- Cold-start and BIOS-start support for:
- Millenium I (Desktop display only);
- Millenium II (Desktop display only).
- All other Haiku, Be and Zeta drivers, not recommended though: (mostly untested)
- BIOS-start-only support for (among others(?)):
- ATI driver(s) (overlay mode on all(?) cards);
- SiS driver(s) (Desktop display only, overlay is broken).
Notes:
- laptop graphics and embedded graphics are not supported unless maybe if a system can hold a second graphicscard working simultaneously (nVidia and ATI embedded non-laptop cards?);
- Dual and Triple head cards are still just one graphicscard. You need at least two cards to be able to use the node! (This limitation may be lifted somewhere in the future though.)
Features:
- Displays full-color video in (upscaled and filtered) fullscreen mode on the 'primary' VGA output of supported cards;
- Supports overlay mode (video engine) playback in colorspace B_YCbCr422;
- Supports scaled_filtered_blit mode (2D engine) playback (as defined by Be) in colorspaces B_RGB32 and B_RGBA32 (alpha channel not used);
- Video is automatically synchronized to the screen's vertical retrace (all modes), provided the driver in use supports it;
- Video is always double buffered (using 3 buffers), unless a codec requires single buffering (cinepak);
- If the graphicscard can't set a (accelerated) mode for doublebuffering (using 3 buffers), the node automatically falls back on-the-fly to using two buffers or just one buffer;
- DPMS support: if no (paused) video is displayed the screen will be turned off automatically;
- You can manually select which non-primary card in your system will be used via the media preferences panel (defaults to first found free card).
Known limitations:
- Only analog VGA style (so no DVI) connections are supported due to current limitations in (most of?) the drivers:
- All cards supported by a driver which has coldstart support enabled: cannot be used with DVI connections. Use VGA cables (driver limitations)!
- Maximum resolution for video playback is 640x480 pixels: this is also the display mode used (this limitation can be lifted in the future);
- No aspect correction available in the node (always uses 4:3 aspect);
- More colorspaces could be supported for both overlay and scaled_filtered_blit mode (this limitation can be eased up in the future);
- Just one graphicscard can be used simulteneously. Multiple instances for multiple targets and video-wall setups could of course be added in the future, just like dualhead and TVout support...
Configuring your system for use with the video node:
If you want trouble-free install and use, you should adhere to the items as listed here:
- Only use cards with BeOS driver cold-start support (see the list at the top of this document). These are most Matrox and nVidia cards;
- Don't use DVI cables on your system, use VGA cables only;
- Install the Haiku nVidia and/or Matrox driver(s): Zeta 1.2 uses them by default;
- Manually enable coldstart support in nv.settings if you use nVidia cards;
- Remove all other nVidia and Matrox 2D drivers;
- Install the node (see further below);
- Power-down your system;
- NOW Insert the second supported graphicscard;
- Boot-up your system;
- Have fun with for example MK-MediaPlayer (included);
- Need the graphics output reversed? modify mga.settings or nv.settings (lookup the 'primary' setting) and reboot.
If you are prepared to do some testing and/or you have one not entirely supported card, there are some precautions you might need to take. Please take notice of the items in the list below.
- First, I need to tell you that generally, Be's graphics drivers tend to cause trouble when multiple graphics drivers are used together. Since this is exactly what you will be doing, it's best to remove all Be drivers from your system, unless you need one because one of the cards you intend to use still relies on it. The trouble with (most?) of Be's drivers is the fact that one driver can't keep it's nose out of the other driver's business: drivers and cards tend to 'intermix'. For instance, a Matrox driver just might access a nVidia card... Yes, it is strange (but true). Don't ask me why this happens (mixed up mapped areas?).
- Please note, that you should remove graphicsdrivers in the system hierarchy even if there's a driver 'overruling' the system driver in the home hierarchy: if a system driver exports a different name for a card also supported by a driver in the home hierarchy, both drivers will be accessible which isn't good. After all, two (different) drivers simultaneously trying to control just one card is asking for trouble.. (I saw this with the nVidia drivers.)
- If you issue a 'ls -l /dev/graphics' command inside a Terminal window, you should find the same number of entries as you have cards, plus a 'stub' (R5, Dano, Zeta) or 'vesa' (Haiku) entry.
- If you find more entries , multiple drivers offer to control one card. You need to remove a driver.
- If you find less entries, you lack a driver: You need to add a driver.
Also, if all is right (and you use 'default' driver settings files, if any) the top entry probably lists the card currently displaying your Desktop. If this is not the case (with default settings) the top entry is probably done by a driver that currently 'reports' it's card doesn't work for some reason (old Be drivers sometimes tend to do that). This doesn't neccesarily mean you have a problem, though you'll need to let the BIOS start that card (see last entry in this list).
Please reboot after altering the driver configuration to get an updated readout in /dev/graphics for sure. If this means you now have no Desktop at all, you have a good chance of fixing that by changing the system BIOS graphicscard detection order (see last entry in this list). And make sure you don't use DVI cables: most drivers currently have trouble using that with coldstarting and/or nodes (due to multiple start/stop cycles of the drivers).
- Now, you need to think about which card should display the Desktop, and which card should display Video. The card you want to use for the Desktop, needs to be the first one listed in '/dev/graphics'. As this list is alphabetically ordered, you officially can't influence this. However, the Haiku nVidia and Matrox driver can be forced to list a certain card these drivers support as first one there. They do that by adding a minus sign (-) to the start of the filename. This sign comes 'first' in the alphabet.
In order to instruct the driver to list a certain card as first one, you need to uncomment the 'primary' entry in nv.settings OR mga.settings (don't do both, you'll 'nullify' the effect). Which one you need to modify depends on what entry you want on top. Entries with '10de' (or '10DE' for 'older' drivers in Haiku) represent nVidia cards, and entries with '102b' ('102B') represent Matrox cards. The name entered must be the exact name as currently listed in /dev/graphics or it won't work.
If you modify settings file(s) to list a card as primary, this will happen after the next reboot for sure. However, don't reboot just yet! First read the next item in this list:
- Haiku Matrox and nVidia drivers: If you are going to select a primary card (for display of the Desktop) other than the one displaying your system's POST messages at bootup, make sure you also set 'usebios false' for the respective driver as otherwise the card(s) aren't coldstarted by the driver and your screen probably remains turned off.
Note please:
- DVI and laptop panels don't work yet with the 'usebios false' setting. Analog connected screens should work though.
- Coldstarting only works on cards listed with 'cold-start support' at the top of this document.
- If one of the cards in your system doesn't have a cold-start capable driver (See the list at the top of this document), you need to let your system display it's POST messages there when it first starts up. If this currently happens on another card you need to change the system BIOS detection order for graphics cards. If your mainboard's BIOS supports this order-option, you'll find it somewhere in the system setup.
If the system setup is completely unknown to you, you might not want to take this step though: it's up to you. You need to enter this BIOS setup, and find the entry listed as 'primary VGA BIOS' (PCI/AGP) or 'graphics card detection order' (PCI/AGP) or so. Select PCI if you want a PCI card started by the system BIOS, select AGP if the AGP card doesn't have BeOS driver cold-start support.
If you use multiple PCI (or PCI-e?) cards, you probably can't use an option in the BIOS: you need to re-arrange your graphicscards physically in order to influence which one gets started by the system BIOS: in other words, gets coldstarted by it (BIOS-start support, see the list at the top of this document).
Notes:
- If you have two or more cards that don't have a cold-start capable BeOS driver, you can't use them except for the one started by the system BIOS at powerup;
- You need at least one card with enabled coldstart support in the BeOS driver or you can't use the node at all: it will probably load and offer services, but it will fail to use your card(s).
Node Installation / De-installation:
Install the VGA Device output node (file 'VGAdevice.media_addon') by dragging it in the 'home/config/add-ons/media' folder. If this folder doesn't exist on your system, just create it. De-installing means you just have to remove the file from this folder.
Using the home hierarchy makes it easy to overcome trouble because BeOS first checks (during boot) if there are 'user-addons' that should be loaded for a service. If not, it loads it's own add-ons (if any). You can select if the add-on should be loaded by hitting the spacebar as soon as the BeOS 'icons' screen appears. If you select disable user addons the system will not load the VGA Device output node. If you don't do anything, the system will load it.
Note: This might turn out to be handy if you run into trouble upon testing the node, or if you are 'tweaking' driver settings files...
You have to restart the Media services in order to apply a new (or old) configuration.
Using the video node (results):
Since the video (and audio) is played back through codecs, the codec behaviour influences what results you see. Because codecs vary in their flexibility (and correctness) per 'BeOS version', it makes sense to outline the results 'per OS'. Configuring the node's properties however is the same on all BeOS versions, so that doesn't need to be split-up here.
If you want to see some debug messages from the node just open a Terminal window and start the Media preferences application from there. If you hit the 'Restart Media Services' button in the preferences app, all debug messages will be sent to the terminal's window.
General (node properties).
In the 'Media' preferences panel, select the item 'Video Settings' in the left part of the Media window. Here you will find the default nodes that will be used for video input and video output. You should select the 'VGA Decice Output' node as being the video output if you want to playback on a seperate graphicscard. Selecting 'Video Window Consumer' will playback video in a scalable window on your desktop, while 'Default DV Output' should playback to a firewire camcorder (for instance).
Now, Find the item 'VGA Device Output' in the left part of the Media window and select it. On the right side of the Media window you'll see the current graphics card that's selected for output in this node. If you have more than two graphics cards in your system, you'll (probably) be able to switch between them: select the one you want to use.
Go back to the 'Video Settings' item in the Media window, and hit the 'Restart Media Services' button for the changes to take effect. After the restart finishes you'll be using the graphics card you selected for video, if you also selected the 'VGA Device Output' node.
Note please:
If the 'VGA Output Device' isn't visible in your Media preferences window, try to restart the media services. If it's still not there, the node doesn't register because it can't find useable free graphics cards in your system.
Supported input colorspaces (driver properties).
The node supports hardware video overlay using the B_YCbCr422 colorspace, and it supports B_RGB32 and B_RGBA32 using the hardware acceleration engine. The actual spaces the node will support depends on the functions actually implemented in the graphics driver (and graphics card) in use. All (known) BeOS (and derivates) graphicsdrivers support hardware overlay at best, except for the Haiku unified nVidia driver: this one also supports scaled video playback using the acceleration engine.
This means the following situations can occur:
- Your card or driver doesn't support video overlay, and doesn't support video acceleration. The node will not use such a card. However, in theory you can still use it to display your Desktop. Example: Matrox Millenium I/II cards, Matrox G100;
- Your card and driver support video overlay, but no video acceleration. The node will offer B_YCbCr422 support, but not B_RGB(A)32 support. Example: most cards and drivers: like Matrox G200-G550, most ATI cards (probably);
- Your card or driver doesn't support video overlay, but both do support video acceleration. The node will now offer B_RGB32 and B_RGBA32 support. Example: all newer nVidia cards for which we have no overlay engine support yet (GeForce 6xxx and 7xxx, except for 6800 which does have overlay support);
- Your card and driver support both video overlay and video acceleration. In this case the node will support all three colorspaces, while it prefers using B_YCbCr422 (video overlay). Example: most nVidia cards including GeForce 6800, except (other) GeForce 6xxx/7xxx and pre-TNT 1.
Notes:
- B_YCbCr422 is the preferred colorspace because of three reasons:
- It saves a decoding pass inside (most) codecs: For RGB(A) as output space B_YCbCr422 is generated first;
- It uses half of the memory (bandwidth) and uses less CPU than B_RGB(A)32 space;
- It has a reasonable flexible(!) bytes_per_row demand, while B_RGB(A)32 use a fixed value (2560 bytes in 640x480 mode). The B_RGB(A)32 bytes_per_row value is fixed because of the acceleration function used for displaying video: Be's SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT. This function uses a virtual height video mode: it's a 'workspace' function, instead of a 'offscreen' function such as video overlay is.
Note please:
- In the future support will be added for 'offscreen' SCALED_FILTERED_BLITs in both the graphicsdrivers and 'VGA Device Output' node: this requires new driverhooks however. It's outside of what Be defined before.
- The B_RGB(A)32 spaces are supported because:
- A few upto a lot of codecs don't support B_YCbCr422 output (yet?) depending on BeOS 'version' used. Therefore we need to support B_RGB(A)32 or you wouldn't get decent video at all;
- Some cards don't have a (known) overlay engine and therefore can only be used for video decently via the acceleration engine.
Note please:
- In the future you won't need two cards per-se anymore: we'll be using new driverhooks (so outside of what Be defined before) to offer windowed accelerated video on the desktop for both B_RGB(A)32 and B_YCbCr422 colorspaces (at least), with about the same flexible(!) bytes_per_row constraints video overlay currently has.
- I needed it to setup and test the SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT in the nVidia driver ;-)
R5 (Codecs)
On R5 most (or all?) codecs only support RGB modes on their producer node outputs. Most (or all?) (other) codecs also determine their bytes_per_row setting themselves, they don't support custom settings requested by a consumer node. For these reasons you will not be able to enjoy much video using the VGA Device Output node. If you install the 3ivX D4 4.5 codec however, you can watch DivX/Xvid correctly with both overlay (B_YCbCr422) and accelerated (B_RGB(A)32) output.
Note please:
- I've not blocked incompatible bytes_per_row settings for this Alpha release on purpose. This way you can easily see what codecs are having trouble here: output will be looking like a TVpicture with lost Hsync (mostly the case with MPEG1 video), or you will see a correct picture on the top half of the screen if the codec delivers exactly half of the needed bytes_per_row (often with cinepak video). If I had blocked connections you would not have seen any video at all.
- If you don't use a nVidia graphics card you'll not get video often, since B_YCbCr422 isn't supported (much) on codec producer node outputs with R5 (as stated before).
Dano (Codecs)
On Dano most (?) codecs support both RGB modes and B_YCbCr422 mode on their producer node outputs. Most (?) codecs are also flexible in their compatibility regarding bytes_per_row settings, they offer a wildcard here (as it should be in my opinion!!). For these reasons you will be able to enjoy much video using the VGA Device Output node. If you additionally install the 3ivX D4 4.5 codec, you can also watch DivX/Xvid correctly with both overlay (B_YCbCr422) and accelerated (B_RGB(A)32) output.
Note please:
- I've not blocked incompatible bytes_per_row settings for this Alpha release on purpose. This way you can easily see what codecs are having trouble here: output will be looking like a TVpicture with lost Hsync (I've not seen this yet on Dano), or you will see a correct picture on the top half of the screen if the codec delivers exactly half of the needed bytes_per_row (often with cinepak video). If I had blocked connections you would not have seen any video at all.
- If you don't use a nVidia graphics card you'll not get video for cinepak encoded movies, since B_YCbCr422 still isn't supported here.
Zeta 1.2 beta (Codecs)
On Zeta most (?) codecs support both RGB modes and B_YCbCr422 mode on their producer node outputs. Some (?) codecs are also (still?) flexible in their compatibility regarding bytes_per_row settings, they offer a wildcard here (as it should be in my opinion!!). For these reasons you will be able to enjoy more video than on R5, but less than on Dano, using the VGA Device Output node. If you additionally install the 3ivX D4 4.5 codec and remove the (updated?) version Yellowtab installed, you can probably also watch DivX/Xvid correctly with both overlay (B_YCbCr422) and accelerated (B_RGB(A)32) output. Yellowtab's new(er) DivX/Xvid codec is just as fixed as the old cinepak codec, which they also still use.
Note please:
- I've not blocked incompatible bytes_per_row settings for this Alpha release on purpose. This way you can easily see what codecs are having trouble here: output will be looking like a TVpicture with lost Hsync (Yellowtab's DivX/Xvid codec), or you will see a correct picture on the top half of the screen if the codec delivers exactly half of the needed bytes_per_row (often with cinepak video). If I had blocked connections you would not have seen any video at all.
- If you don't use a nVidia graphics card you'll not get video for cinepak encoded movies, since B_YCbCr422 still isn't supported here;
- Yellowtab has been informed about the bytes_per_row issue inside their DivX/Xvid codec. Hopefully they'll acknowledge this as an error and fix it...
Haiku (Codecs)
On Haiku I can't actually see video yet using a node (using a build of 25 april 2006). However, there is some good news:
- MK-MediaPlayer seems to work correctly;
- Audio only files can be played back (MP3 tested);
- Some older MPEG1 clips don't crash the app, let you hear a fraction of a second of it's soundtrack, and then there's only the slider moving, indicating life (there seems to be trouble with codecs and multiple tracks? I've also seen a segfault during a memcpy() operation in some library);
- MK-MediaPlayer is never able to get a video connection, it will always fake a connection using a private BBuffergroup so you can hear audio (normally);
- The Media subsystem loads the 'VGA Device Output' node and defaults to it for video output automatically (since the 'Video Window Consumer' node is still lacking in the build);
- The 'VGA Device Output' node is responsive in the Media preferences panel, and can be seen correctly using Cortex;
- The node can read it's settingsfile if you copy it over from another version of BeOS (on the same hardware for valid settings);
- The node can't write it's settingsfile yet: seems there's functionality still lacking or malfunctioning in Haiku here. This prevents you from manually selecting a graphicscard for actual use: the first one found will always be used instead (unless you tweak with a copied over settings file).
All in all I'm very pleased with the results sofar: Would be cool though if it would actually be useable soon.. ;-)
MK-MediaPlayer
MK-MediaPlayer is a relatively simple application that runs on R5, Dano, Zeta 1.2 and Haiku; independant of the 'VGA Device Output' node. It has a simple user interface. Here's what it does:
- You can load a file, and play it back.
- It will do so using Codecs, Audio and Video nodes.
- If it can't find a suitable codec or it can't connect to a default node (as selected in the Media preferences app), it won't play back.
- If it finds that video can't be played back for some reason, it will just playback the audio.
- If it reaches the end of a clip, and you want to run it again, you need to press STOP yourself and set the slider at the beginning manually.
If you want to see some debug messages, just run MK_MediaPlayer from a Terminal command line. All related messages will be sent to the terminal's window then.
Rudolf Cornelissen.
(Page last updated on April 27, 2006)