Hypertext with all linked files can be downloaded from Rapidshare.


Xcard Way


This is the late report on Sigma Designs REALmagic Xcard (hardware MPEG 1,2,4 [DVD & DIVX] decoder). It is late, because Xcard is on the market since 2002. Xcard is still good choice for your free PCI slot in the old PC - it is better than a cheap player, it is fun, but remember what Xcard is not for:


    [*]No support for Video for Windows formats (WMV).[*]No support for MPEG-4 AVC video (H.264).[*]No support for HDTV.[*]No support for exotics like QuickTime (MOV), Flash (FLV) or RealVideo (RMVB).[*]It is not a computer display card (no Windows desktop on TV).[/list]Xcard Setup


    All latest Xcard drivers, software and documentation (except development kit) are available online from the Sigma Designs website. Remember, original installation CD that comes with Xcard may be outdated.




    Use the best Xcard output possible - it delivers quality video. I use SCART RGB through the self-made connector. I got pin-out schematics from Xcard documentation (installation Readme.txt) and nice SCART description. Remember two things:


      [*]SCART cable is crossover.[*]I had to connect SCART pin 16 not to Xcard, but to the special >2 volts source (+5V computer DC power through 75 ohms resistor), else my PHILIPS TV didn't recognize the signal as RGB.[/list]

      Use digital sound output (S/PDIF), because it is better than analog and in most cases Xcard outputs more or less jerky video when it has to down-mix multi-channel audio to the analog stereo along MPEG-4 decoding task. Remember, Xcard itself will not send audio to TV when using S/PDIF output.




      Use simple computer display card with TV output and connect it to the same TV as Xcard. It is convenient to have a desktop on the near channel, because by design you have to control the playback from the computer desktop.


      Preflight


      Xcard has two strict MPEG-4 (DIVX 5) decoding limits:


        [*]No Global Motion Compensation (GMC).[*]No Quarter pixel (QPEL).[/list]

        Within Xcard installation Sigma Designs distributes special program - AviCheck. It preflights AVI, but what about other containers? There is a better must-have alternative - MediaInfo. But the real answer to the question if some MPEG-4 stream uses GMC and QPEL is ffdshow decoder onscreen information. Its configuration:


          [*]Open ffdshow video decoder configuration.[*]Go to "Info & CPU" > "OSD".[*]Enable "Frame type" for QPEL and "GMC warp points" for GMC.[*]Enable other nice info:

          Coded frame size (may be a hint for Replace FourCC filter configuration, see below).

          Input bitrate (should not be more than 10Mbps).

          Movie FPS.

          Input FOURCC (may be a hint for Replace FourCC filter configuration, see below).

          Input size and aspect ratio (should not be larger than PAL 720x576).

          Source file name.[/list]

          Do not know where and when ffdshow preflight should be done. One solution could be a preview-customized player (e.g. Zoom Player or ViPlay) on software decoding capable computer. But if GMC and QPEL "infected" stream will reach Xcard - computer reboot may be required to reset Xcard.


          Play


          Xcard comes with specialized Sigma Designs Xmedia Player. It is a reference player for Xcard for video/audio contained in DVD, AVI, MPEG, MP4 and for accompanied subtitles. But it has major limits:


            [*]No support for the free alternative containers, e.g. OGM, MKV.[*]Poor remote control interaction.[/list]

            For the further reading the understanding of DirectShow filters (filter graph) is required. There are some free helpful tools to deal with DirectShow:


              [*]Best sandbox for playing with filters is GraphEdit utility application from the free DirectX SDK.[*]For DirectShow filters management (merit control) use RadLight Filter Manager.[*]For the media samples CD go to www.divxtest.com.[/list]

              Xmedia Player is built on DirectShow filters that are available to construct a custom playback:


                [*]Sigma Designs .MP4 File Parser[*]Sigma Designs AVI Splitter[*]Sigma Designs MPEG Stream Splitter[*]Sigma Designs MPEG-2 hardware decoder (actually not just MPEG-2)[*]Sigma Designs PCM Swapper[/list]

                Most interesting for that purpose are the last two, remember:


                  [*]There are no way to play (render) decoded video on Xcard - input must be MPEG.[*]To play decoded audio - put it through Sigma Designs PCM Swapper just before Sigma Designs MPEG-2 hardware decoder (it seems important for audio/video sync).[/list]

                  It is a good idea to decode audio by software, because:


                    [*]As said before, in some cases Xcard outputs jerky video when it has to down-mix multi-channel audio to the analog stereo.[*]With Xcard there are no control over audio except volume and balance.[*]There are a lot of interesting and free audio filters to try, e.g. AC3Filter.[*]For the full support of MKV and OGM there is a need for external support of Vorbis audio, for which I chose Core Vorbis decoder filter.[*]Audio decoding is not a problem even for the very old CPUs.[/list]

                    For MKV and OGM support I chose Haali source filter, because:


                      [*]Good seek capability (even Sigma Designs AVI Splitter fails to seek in the custom playback with software audio decoding).[*]Good integration with players for audio tracks selection (it has predictable output pins).[/list]

                      When installing Haali, choose options to install just MKV (default and compulsory) and OGM support, because Haali AVI, MP4, MPEG support may override quite good Sigma Designs splitters and it will break Xmedia Player.




                      Haali video output compatibility with Sigma Designs MPEG-2 hardware decoder input is poor because video media type information (filters negotiation instrument) and not because video stream, e.g. Sigma Designs MPEG-2 hardware decoder refuses to work with the stream marked with "XVID" or "divx" FOURCC. Sigma Designs AVI Splitter deals with this problem by substituting any "unknown" source FOURCC with default "DIVX". By this example I wrote special pass-through filter - Replace FourCC (source). It does one more job - prevents the use of VIDEOINFOHEADER2 structure in media type information, because MKV does like it and Sigma Designs MPEG-2 hardware decoder is confused by it. For more info on Replace FourCC read its Readme.txt.




                      The best and free player of the customized DirectShow filter graphs is Zoom Player. In XcardMediaGraph.zip are my Zoom Player configuration files for Zoom Player version 5.0:


                        [*]Unpack contents to the Zoom Player installation MediaGraph directory.[*]Open Zoom Player "Options / Setup" dialog and press "Switch to Advanced Mode".[*]Choose "Playback" > "Smart Play" and uncheck "Enable Smart Play" (this nice feature will not work because at the end of filters chain it implies audio renderer - sound card).[*]Choose "System" > "Filter Management" and check "Manual Filters: Auto by Extension" (this is most reliable choice).[/list]

                        But Zoom Player has a major limitation in respect to Xcard - no OSD and no subtitles support. This brought me to GB-PVR home media center application with slow, but massive OSD menu system and SRT subtitles support:


                          [*]I chose older version 0.99.12, because have no Direct3D and all new versions features have nothing to do with Xcard.[*]I disabled automatic start of GB-PVR system tray application and GB-PVR recording service, because using GB-PVR just for playback.[*]I had to tidy up my system DirectShow filters (especially source and parsing filters), because GB-PVR player DirectShow filter graph is not customizable.[/list]

                          If subtitles are muxed-in MKV or OGM - use OGMcleaver to get them into separate SRT files.




                          I am aware, but not tested, two more choices for Xcard player:


                            [*]SageTV (commercial GB-PVR analog) has plug-in for Xcard.[*]TVedia (requires MMX CPU).[/list]Remote Control


                            Xcard comes with the medium quality IR remote control for Sigma Designs Xmedia Player:




                            IR remote > IR receiver > COM port > REALmagic COM port monitor as automation server system tray application > REALmagic Xmedia Player as automation client




                            I detached REALmagic COM port monitor from REALmagic Xmedia Player to be able to control other applications (players) through EventGhost:




                            IR remote > IR receiver > COM port > REALmagic COM port monitor as automation server system tray application > EventGhost as automation client > Windows messages > RMWMSink as automation server system tray application > REALmagic Xmedia Player as automation client




                            This hack ingredients:


                              [*]REALmagic plug-in for EventGhost. Just drop REALmagic directory into the EventGhost installation plugins directory.[*]Windows Registry change to replace the Xmedia Player start path with EventGhost event call. Change key "HKEY_LOCAL_MACHINE\SOFTWARE\Sigma Designs\REALmagic\SkinGUI" value "FullPath" to point to EventGhost.exe with two parameters "-e REALmagic.POWER", e.g. "C:\Program Files\EventGhost\EventGhost.exe" -e REALmagic.POWER[*]Windows messages proxy to automation events - RMWMSink (source). Read Readme.txt how to configure Xmedia Player.[/list]

                              This hack seems elegant, because:


                                [*]Using the original IR receiver driver.[*]Publishing open (Windows message) interface to control Xmedia Player.[/list]

                                In REALmagicEventGhostConfigurationTreeExample.zip there is EventGhost configuration example how to control Xmedia Player, Zoom Player, GB-PVR and Winamp with REALmagic remote control, remember:


                                  [*]Example uses file system paths that may need customization.[*]Zoom Player must have enabled TCP control option. Open Zoom Player "Options / Setup" dialog, press "Switch to Advanced Mode", choose "System", check "Enable External TCP Control (port): 4796".[*]On the net there are EventGhost configuration examples for GB-PVR and on GB-PVR website are pages with shortcuts list, but it seems like one could only trust files in KeyMappings directory of GB-PVR installation.[*]Configure GB-PVR as using remote control type "Default (Hauppauge)" meaning keyboard scan codes.[/list]

                                  There is EventGhost alternative containing own REALmagic IR receiver driver - IRAssistant. I made its configuration examples for Zoom Player and for Xmedia Player; they require WinMsg plug-in (source). IRAssistant does its job, but on tested Windows 2000 system shutdown it terminates with nasty error alerts.




                                  There is Girder, but on tested Windows 2000 it self terminates with errors after half an hour. Remember, last free version of Girder - 3.29b, but once higher version installed, there will be no way back for Windows to keep running 3.29b without registration.


                                  To Do


                                  Wish to have DirectShow filter for Xcard subtitles (like Gabest VSFilter). There is free DirectX SDK with good documentation and nice GraphEdit utility, free luxury DirectShow Delphi components - DSPack, free luxury Turbo Delphi IDE, free massive subtitles Delphi API (libraries) from ViPlay3 source, hack ready proof of concept from SageTV community plug-in for Xcard, ready for experiments unofficial Xcard drivers pack XStream, but I have no time left for it.




                                  GB-PVR badly needs a dedicated skin for Xcard, because Xcard OSD supports only 256 (8 bit) colors. Existent skins are "too colorful" and the worst is when functional elements tend to hide over the edge of TV screen.