BogProg X-Fade 2.0 (Input Crossfading)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • thinktink
    Forum King
    • May 2009
    • 3372

    BogProg X-Fade 2.0 (Input Crossfading)

    BogProg X-Fade 2.0.0.1 is now available.

    Download

    This plugin is for SHOUTcasters ONLY! Instead of relying on your soundcard and the Output plugin to crossfade your music, you can now do it instead with this plugin at the input stage before it reaches the DSP. However, there are some caveats:
    • You really should use a NULL Output plugin (preferably ZeroPointer) as the active output plugin. Not doing so will probably make your station timing rate all jacked up. NoFlush is also acceptable but it's not a null output plugin so expect a couple of quirks while using it.
    • The plugin only supports audio files who's native decoding input plugin exports fully functional transcoder functions. If you're using an audio format that doesn't support the transcoding functions, blame the developer, not me.
    • The plugin will not crossfade through audio tracks that are not at least twice as long as the specified crossfade time.


    Changes from previous version:
    • Removed all of the VCL dependencies (Borland's IDE framework.)
    • Added re-sampling support.
    • Internal bug fixes.
    • Installer includes BogProg NoFlush output plugin.


    Details:
    So the biggest reason for the major version bump is because of the VCL removal. I basically reused all of the old source code but I had to modify it for use outside the VCL, dump the original plugin's project files, and add in-house replacements for the removed VCL functions. Giant pain-in-the-a** to do. I did this for several reasons; 1) to eliminate the VCL as a suspect in a number of very rare and intermittent crashes (these are the hardest to debug) and 2) for file size.

    RE-SAMPLING ADDED! I added the same set of re-samplers to X-Fade that I did to DiskWrite (not related.) That means that now a file that's 48000,24,6 can now be crossfaded through a 44100,16,2 file. Now you won't have to resample and re-encode your music for crossfade compatibility, it gets done for you automatically on the fly. It should be noted however that even though I included re-sampling rates other than 44.1k I don't recommend using them if you're using the SHOUTcast DSP for a number of reasons too long to explain here.

    The NoFlush plugin is included with the installer. What it does is allows you to use another Output plugin ("Nullsoft DirectSound Output" is the default) with X-Fade but without the internals calling flush reaching it. Instead, it mathematically emulates the effects of the flush call (transparently to Winamp) and won't pass the call on to the selected Output plugin. What this all means is that X-Fade can use an output plugin other than a null output plugin but not have the playback timing interrupted and you won't get any pops or clicks or other audio artifacts when X-Fade crossfades the next audio media. However, since the size of a signed 32 bit integer is not infinite, when total playback time since the last actual flush goes over approximately 2 weeks, on the next call to flush, flush is actually called and the emulator is reset. Can't be helped, that's just a hard limitation of a signed 32 bit integer. NoFlush is compatible only with X-Fade playback so if X-Fade is not present, it won't perform the primary function (there are several reasons for this.) In total, NoFlush will let you playback your audio to your soundcard using X-Fade.

    ZeroPointer is still the preferred output plugin to use with X-Fade however.

    Enjoy
    | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
    | Save your playlist first! | Live voice-over | X-Fade 2.5 |
    | AterKast (Source DSP) | More of my stuff... |
  • Aminifu
    Forum King
    • Aug 2011
    • 4967

    #2
    Hi thinktink,

    You nailed it!

    You clearly said X-Fade and NoFlush are for "SHOUTcasters ONLY" and I'm not a SHOUTCaster, but I decided to give them a try since I've been looking for a way to do crossfading at the input stage for a long time.

    I've tested with mp3 files and my processing train is Nullsoft MPEG Audio Decoder v4.103 to BogProg X-Fade v2.0.0.1 to SA Stereo Tool v7.51 to BogProg NoFlush v1.0.0.0 to Matrix Mixer v0.9.163d to Nullsoft DirectSound Output v2.64d. It all works flawlessly (for straight playlist playback, no seeking), sounds great, and no artifacts at the crossover point.

    I'm using the logarithmic crossfade and the high quality default re-sampling in X-Fade. Stereo Tool is a DSP plug-in. Matrix Mixer is an output plug-in to re-sample and up-mix for my 5.1 speaker system and 24/96 soundcard.

    My mp3s were encoded at various quality rates from 128 to 320 kbps (mostly constant and some variable) and some are not 44100,16,2 files. X-Fade's re-sampling makes them all look the same to the DSP (at 1411 kbps according to Winamp). This alone is a benefit, even if the crossfading didn't work. I use the DSP to apply a slight enhancement which really helps the lower quality mp3s sound much better through my low cost Logitech speakers.

    The X-Fade stats says that the process buffers are off and the DirectSound output status shows 0 dropouts during playback.

    I've not tried seeking back and forth within a song or skipping songs ahead or backward. That may cause buffering issues, however I'll not be doing that with this setup anyway.
    Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
    Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

    Comment

    • thinktink
      Forum King
      • May 2009
      • 3372

      #3
      Originally Posted by Aminifu View Post
      Hi thinktink,

      You nailed it!

      ...
      Outstandingly gratifying music to my ears.

      I really do hope the VCL removal is worth it. I've been wanting to put in re-sampling support into this plugin for a long time, just never found a good re-sampling mechanism to do the job correctly 'till I really hit-the-books with DiskWrite.

      Originally Posted by Aminifu View Post
      ...

      The X-Fade stats says that the process buffers are off and the DirectSound output status shows 0 dropouts during playback.

      I've not tried seeking back and forth within a song or skipping songs ahead or backward. That may cause buffering issues, however I'll not be doing that with this setup anyway.
      The stats window is mostly for me (for debugging purposes.) I probably don't need it anymore since I've not had an issue with incorrectly interpreting the input plugin transcoder function data for a while now. I guess I'm just too lazy to take it out. However, just FYI, the "ProcessBuffers" item should only ever show "On" during an actual cross-fade. I don't know what "dropouts" are but it sounds bad and having zero of them is probably good. Idunno...

      Seeking is very laggy depending on which output plugin you use and if the output plugin (like out_ds.dll) has large buffering. Expect lag and weirdness when seeking. Also, with X-Fade and NoFlush running, you won't get any seek fading support from out_ds.dll since out_ds.dll doesn't ever know a seek is taking place (which is what the flush(...) function is usually used for.)
      | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
      | Save your playlist first! | Live voice-over | X-Fade 2.5 |
      | AterKast (Source DSP) | More of my stuff... |

      Comment

      • thinktink
        Forum King
        • May 2009
        • 3372

        #4
        Version 2.1.1.10 is now available for download.

        Updates and fixes:
        1. Fixed major issue with resampler where large upsamples (i.e. 22050Hz upsampled to 44100Hz) were causing high CPU usage and chopped off file playback.
        2. Fixed crash issue with ultra-short files.
        3. Fixed metadata handling crash issue.
        4. Fixed temporary hang issue from conflict with another plugin.
        5. Added the ability to specify a file to not be crossfaded. This feature is accessed by opening the Unified File-info Editor Pane (Alt+3) and selecting the added [BogProg X-Fade] tab. This tab only appears for files that can be crossfaded. Screen shot of the new tab below.





        [/EDIT]
        Ack! I almost forgot:

        Currently, all (as far as I know, all) of the official input plugins do not support writing of custom metadata fields. Because of this, I had to create a work-around. The attempt is made of course but if the attempt fails (and as of this writing it will) then the file information will be written to a plain-text file at "%appdata%\Winamp\Plugins\BPXFade.tdb". The full file path is included so if you move a media file to a new location then the state information will not follow the file. If you move a media file and still want it to block crossfading for that file then you will need to set the option for the file in it's new location again.
        Attached Files
        | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
        | Save your playlist first! | Live voice-over | X-Fade 2.5 |
        | AterKast (Source DSP) | More of my stuff... |

        Comment

        • Aminifu
          Forum King
          • Aug 2011
          • 4967

          #5
          Hi thinktink,

          Thank you for this update. I have been having some random crashes, but they never were repeatable. Everything would work fine for hours (and during multiple sessions) and out of nowhere Winamp would hang/crash. After restarting with the same playlist, everything would be ok again.

          Care to say which plug-in was involved with the temporary hang issue? Also, was it a particular tag that was miss-handled or was this a random issue?

          The "Block Crossfading" feature is a good addition. Now I don't have to disable the plug-in when playing certain albums.
          Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
          Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

          Comment

          • Aminifu
            Forum King
            • Aug 2011
            • 4967

            #6
            Hello again,

            I wrote the previous post before I tried the new version. Unfortunately, crossfading does not work for me with the new version. I've tried everything I can think of (changing the crossfade point, enabling and disabling re-sampling and logarithmic transitions, and deselecting the NoFlush output plug-in).

            Also, data is not written to the "BPXFade.tdb" file until Winamp is shutdown. I had the crazy idea that the new feature might be working in reverse, so tried enabling the crossfading block for a few files to see if crossfading would then work.

            Version 2.0.0.1 does work for me. If it has something to do with the random hangs/crashes I've been having I can live with them, since they are rare. Maybe it has something to do with when NoFlush allows an actual flush to occur. I'll start documenting what I was doing and the total elapsed playback time between occurrences.
            Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
            Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

            Comment

            • thinktink
              Forum King
              • May 2009
              • 3372

              #7
              Ok, that's disconcerting. I had no problems at all for the past three nights crossfading music.

              I'm at work at the moment and I need to finish off some things. In the meantime, please post an Info Tool report and list the file types you're generally playing that aren't crossfading, post a sample file if you can. Also, make note of the CPU usage during playback and just before it's supposed to crossfade. I put code in to pre-load the transcoder functions for the next song (after a delay) and I'm wondering if maybe CPU usage is preventing crossfades on your system (I doubt it but it doesn't hurt to check.)

              The conflicting plugin was WebJockey, but I'm assuming you don't use that.

              "BPXFade.tdb" not being written until shutdown is normal and expected operation.

              The random crashes you were seeing are very likely to be related to the metadata handling crash fixes in this latest release.

              On it's own, NoFlush passing on an actual flush (where it would normally block) only occurs if the playback has been continuously longer than two weeks, and even then only does it once (then another two weeks, flush... then another two weeks, flush... so on and so forth). If it seems NoFlush is passing flushes on when it shouldn't then it might mean that X-Fade believes (for some inexplicable reason) it can't crossfade the media (and then is calling Out->Close(..) and Out->Open(...) and not Out->Flush(...).) An output chaining plugin that logs calls would be a good way to determine that. I'll see if I have one floating around somewhere...
              | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
              | Save your playlist first! | Live voice-over | X-Fade 2.5 |
              | AterKast (Source DSP) | More of my stuff... |

              Comment

              • thinktink
                Forum King
                • May 2009
                • 3372

                #8
                Here we go. To check for the call to Flush(...) during failed crossfade attempts I'm attaching a plugin in a zip archive that will log the output plugin API calls. To use, copy (or move) the plugin file to the Plugins folder, open the preferences for NoFlush and select it as the output plugin to chain (it will be called BogProg LogOutput.) The plugin itself just loads and passes on the calls it receives to the DirectSound output plugin so everything should function normally. Leave just two files in the Winamp Playlist and from a fresh running instance play the first file and wait for the crossfade to fail. Wait about 2 seconds of the playback from the second file then directly quit Winamp. The log file will be located at "%appdata%\Winamp\BPOutputLog.csv". You will need to put it into a zip file before posting on the forums.

                Plugin archive attached.
                Last edited by thinktink; 16 September 2015, 17:16.
                | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
                | Save your playlist first! | Live voice-over | X-Fade 2.5 |
                | AterKast (Source DSP) | More of my stuff... |

                Comment

                • thinktink
                  Forum King
                  • May 2009
                  • 3372

                  #9
                  Hmm, I found a flaw in my pre-load check and processing code. After about 20+ times starting playback on a fresh instance of Winamp I noticed the very first song played doesn't crossfade intermittently but the following songs do. I've attached v2.1.2.13 installer in a zip archive. See if it crossfades now.
                  Last edited by thinktink; 16 September 2015, 17:16.
                  | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
                  | Save your playlist first! | Live voice-over | X-Fade 2.5 |
                  | AterKast (Source DSP) | More of my stuff... |

                  Comment

                  • thinktink
                    Forum King
                    • May 2009
                    • 3372

                    #10
                    Version 2.1.2.13 now available for download.

                    Changes:
                    • Fixed issue with pre-load logic error intermittently causing the first media item to not crossfade.


                    I burned one of my fingers on a hot lamp (the kind you use for lighting a space for filming) right at one of the joints. Those are always the worst. Sorry for any misspellings in this post.
                    | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
                    | Save your playlist first! | Live voice-over | X-Fade 2.5 |
                    | AterKast (Source DSP) | More of my stuff... |

                    Comment

                    • Aminifu
                      Forum King
                      • Aug 2011
                      • 4967

                      #11
                      Hi thinktink,

                      First of all, thank you for taking the time to work on this so quickly. It appears that we live in close to the same time zone, but I work midnight to 8 am, so half the time when you're normally awake, I'm probably sleeping.

                      Version 2.1.2.13 is working for me!

                      I have seen momentary spikes following song transitions using Windows Task Manager to monitor Winamp's CPU usage. A few of them have been quite large (up to 70%), but they have not caused any problems on my system. It depends on the songs and the DSP plug-in I'm using (SA Stereo Tool) normally adds up to an additional 20% itself.

                      But (there's always a but ), this version exposes a problem with the crossfade blocking feature. The song immediately before the songs selected to be blocked also does not crossfade. It seems like your plug-in does not 'see' it. There is no spike in CPU usage following the transition of the song prior to the first one that is selected for blocking.

                      I would only want to block a group of consecutive songs, so the work-around for this issue (if it can't be fixed) is obvious (just start the blocking with the second song in the group), so it's no big deal. It is a little inconvenient that Winamp must be restarted before the blocking is activated or removed. However, this is better than having to disable/enable the plug-in for various groups of songs.

                      As to the crashes I was having, I never run Winamp continuously for over 2 weeks at a time (I'm still not broadcasting). If the crashes were related to your plug-in, it probably was the metadata handling issues. If the crashes return, I'll use what you suggested in post #8 above.
                      Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
                      Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

                      Comment

                      • thinktink
                        Forum King
                        • May 2009
                        • 3372

                        #12
                        Originally Posted by Aminifu View Post
                        ...

                        But (there's always a but ), this version exposes a problem with the crossfade blocking feature. The song immediately before the songs selected to be blocked also does not crossfade. It seems like your plug-in does not 'see' it. There is no spike in CPU usage following the transition of the song prior to the first one that is selected for blocking.

                        ...
                        I'm having a hard time understanding your description. The crossfade blocking should only be blocking crossfades of songs that are marked for blocking on both the start and end of the song (no intro or outro crossfades.)

                        Here's a text-based illustration using five songs in a playlist:
                        Songs marked with X are blocked. Songs marked with O are not blocked

                        -------------------Song 1----------------O--
                        crossfade allowed
                        -------------------Song 2----------------O--
                        crossfade blocked
                        -------------------Song 3----------------X--
                        crossfade blocked
                        -------------------Song 4----------------O--
                        crossfade allowed
                        -------------------Song 5----------------O--


                        The goal of the crossfade blocking feature is so that advertisements on SHOUTcast stations can be protected from crossfading. Must keep those advertisers happy.
                        | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
                        | Save your playlist first! | Live voice-over | X-Fade 2.5 |
                        | AterKast (Source DSP) | More of my stuff... |

                        Comment

                        • Aminifu
                          Forum King
                          • Aug 2011
                          • 4967

                          #13
                          Ok, I understand now. The feature is working as it should. My fault for using a plug-in designed for SHOUTcast and not knowing what that needs and does.

                          This site says that the link in post #8 above is invalid.

                          Thank you again for some great work!
                          Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
                          Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

                          Comment

                          • thinktink
                            Forum King
                            • May 2009
                            • 3372

                            #14
                            Originally Posted by Aminifu View Post
                            Ok, I understand now. The feature is working as it should. My fault for using a plug-in designed for SHOUTcast and not knowing what that needs and does.

                            ...
                            Man, you gotta stop scaring me like that! Thanks for responding and letting me know.

                            Originally Posted by Aminifu View Post
                            ...

                            This site says that the link in post #8 above is invalid.

                            ...
                            I removed the attachment it points to since it was no longer necessary.


                            Originally Posted by Aminifu View Post
                            ...

                            Thank you again for some great work!
                            Thank you for using it.

                            Please let me know if you see any more crashes, rare or not.
                            | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
                            | Save your playlist first! | Live voice-over | X-Fade 2.5 |
                            | AterKast (Source DSP) | More of my stuff... |

                            Comment

                            • Aminifu
                              Forum King
                              • Aug 2011
                              • 4967

                              #15
                              Originally Posted by thinktink View Post
                              Man, you gotta stop scaring me like that!
                              Yeah, sorry about that.

                              Take care of your finger. I hope you are a fast healer.
                              Winamp v5.9.2.10042 - Quinto Black CT v4.1 skin
                              Windows 11 Home 64-bit v23H2 desktop - Logitech Z906 5.1 speaker system

                              Comment

                              Working...
                              X