Gapless Playback (4 Viewers)

hwahrmann

Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    should be set to zero, which means gapless playback
     

    DragonQ

    Portal Pro
    August 30, 2011
    644
    79
    Home Country
    United Kingdom United Kingdom
    Not really related to this thread but I found another bug in Music playback. With WASAPI, my 96 kHz, 24-bit, 5.1 FLAC files play 3-4 times as fast as they should. Log attached, and I've uploaded a sample here since it's 48 MiB. Happens with both my HTPC (connected to an AVR) and my desktop (normal speakers).

    Another issue is that WASAPI doesn't seem to "release" the audio once MediaPortal closes. For example, if you open Foobar in DirectSound mode, pause it, then open MediaPortal and play something in Music via WASAPI, then close MediaPortal, Foobar won't produce sound any more.
     

    Attachments

    • MediaPortal - Music playback speed problem.zip
      11.2 KB
    Last edited:

    DragonQ

    Portal Pro
    August 30, 2011
    644
    79
    Home Country
    United Kingdom United Kingdom
    should be set to zero, which means gapless playback
    I've set it to zero in all three places I found reference to gapless playback and rebuilt MediaPortal. It does seem to get rid of the fade-in when starting a track, but it breaks as soon as the track ends and a new track is set to start. There's no crash but the log indicates that the player stops as soon as the second track starts:

    Code:
    g_Player.Process() player stopped...

    I can't see why though.

    The other thing is that when the next track starts, the WASAPI device is stopped, the mixer stream is disposed and a new BASS audio stream is created. This does not sound like a chain that supports gapless playback - a quick google suggests that BASS_Mixer_StreamAddChannel needs to be used for this.
     
    Last edited:

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    The other thing is that when the next track starts, the WASAPI device is stopped, the mixer stream is disposed and a new BASS audio stream is created. This does not sound like a chain that supports gapless playback - a quick google suggests that BASS_Mixer_StreamAddChannel needs to be used for this.

    Yep, WASAPI device cannot be stopped since that itself will already introduce a gap in the playback (close + init takes more than 0 ms).
     

    TranceManNZ

    Portal Pro
    July 30, 2006
    209
    21
    I just want it work with a ripped cd (mp3+cue). If you ripped a DJ mixed CD, the correct way is to rip this to a single mp3 file with a cue file. The audio player should read the cue file for the track indexes. This part works fine in MP but the player still creates a small gap.

    I am sure a few years ago the player never had this issue. It all used to work fine.
     

    DragonQ

    Portal Pro
    August 30, 2011
    644
    79
    Home Country
    United Kingdom United Kingdom
    If you ripped a DJ mixed CD, the correct way is to rip this to a single mp3 file with a cue file.
    Well no, the "correct" way, assuming you want an actual copy of the disc on your HDD, is to use a lossless format. It doesn't matter whether you use separate files or a CUE sheet, gapless playback should work in the same way.

    I am sure a few years ago the player never had this issue. It all used to work fine.
    Looking at the code, I find it hard to believe that gapless playback has ever worked with the BASS engine, but maybe MediaPortal used to use a different engine.

    Not really related to this thread but I found another bug in Music playback. With WASAPI, my 96 kHz, 24-bit, 5.1 FLAC files play 3-4 times as fast as they should. Log attached, and I've uploaded a sample here since it's 48 MiB. Happens with both my HTPC (connected to an AVR) and my desktop (normal speakers).
    After doing a bit of digging, it's possible that this issue is related to this already-fixed issue from 1.4.0 pre-release. I can't figure out how to look up the code changes for this fix though. :/
     
    Last edited:

    TranceManNZ

    Portal Pro
    July 30, 2006
    209
    21
    If you ripped a DJ mixed CD, the correct way is to rip this to a single mp3 file with a cue file.

    Well no, the "correct" way, assuming you want an actual copy of the disc on your HDD, is to use a lossless format. It doesn't matter whether you use separate files or a CUE sheet, gapless playback should work in the same way.


    Well I guess this is correct also. I don't have unlimited space so I compress my CD's to MP3 + CUE. Also, If I purchase say a Ministry Of Sound mixed album off iTunes it comes in separate tracks. I guess if gapless playback worked correctly these files would play properly.
     
    Last edited:

    DragonQ

    Portal Pro
    August 30, 2011
    644
    79
    Home Country
    United Kingdom United Kingdom
    Well I guess this is correct also. I don't have unlimited space so I compress my CD's to MP3 + CUE. Also, If I purchase say a Ministry Of Sound mixed album off iTunes it comes in separate tracks. I guess if gapless playback worked correctly these files would play properly.
    Yes, if they were mastered properly. Playing them in Foobar, Winamp, etc. will demonstrate this.
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    I can't see why though. The other thing is that when the next track starts, the WASAPI device is stopped, the mixer stream is disposed and a new BASS audio stream is created. This does not sound like a chain that supports gapless playback - a quick google suggests that BASS_Mixer_StreamAddChannel needs to be used for this.

    Well it isn't enough to just set everything to zero.
    Some other things need to be done as well to make this work.

    And a Mixer is only recreated when the next song has a different sample rate or number of channels than the prebious.

    Believe me not everything is implemented bad.
     

    Users who are viewing this thread

    Top Bottom