gapless playback | Page 2

Discussion in 'Listen Music' started by grubi, August 31, 2007.

  1. grubi

    grubi Portal Pro

    Joined:
    June 16, 2007
    Messages:
    1,216
    Likes Received:
    77
    Location:
    127.0.0.1
    Ratings:
    +86 / 0
    Home Country:
    Germany Germany
    Show System Specs
    What I also found on testing it that you also have the gaps when simply playing an audio CD.
    That is really annoying and is really a pain for audiophile ears if you are listening to a cd
    which has no gaps at all like clubmixes or live albums.

    grubi.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,494
    Likes Received:
    1,635
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,260 / 1
    Home Country:
    Austria Austria
    Grubi,

    i fully understand your problem.
    Yes it is relativeley easy to fix, since i've introduced the mixing support a while back.

    i may be able to reduce the gap a bit more, but due to the player architecture we currently have, i might not suceed completely.
    since the Bass audio engine is invoked by the playlist player, which invokes the next song only after the first has ended. so i most probably need to play with some sort of Crossfading to reach some sort of gapless playback.

    The biggest problem however is that we're in a feature freeze currently, so that we can release 0.2.3.
    The changes would be a bit too dramatical and could break other things, which i simply don't want to.

    So after the freeze is over, i'll have a look into that.
    Promised.
     
  4. grubi

    grubi Portal Pro

    Joined:
    June 16, 2007
    Messages:
    1,216
    Likes Received:
    77
    Location:
    127.0.0.1
    Ratings:
    +86 / 0
    Home Country:
    Germany Germany
    Show System Specs
    Hi hwahrmann,

    I think a feature freeze is a good thing to get 0.2.3 to the level of reliability it needs for a stable release. Esp. in the
    recent past we saw that new features were breaking existing code.

    The amount of changes necessary also prevent me from giving it a try at the moment (the effect on exisiting code is more complex as it seems in the first moment).

    From what I have seen so far gapless should be possible with the current architecture as it is possible to crossfade two songs at the moment without a gap. I have taken a deeper look at the Play method however I still did not find where and when it is triggered exactly. I would assume this happens by a callback of the BASS engine when the end of the currently running track is reached (nearly reached?). What is necessary for gapless is to use the BASS_Mixer interface which I saw is already used at least when upmixing or ASIO is involved. Important is to use the BASS_MIXER_NORAMPIN flag on the BASS_Mixer_StreamAddChannel call which was introduced exactly for the gapless issue. Following is a code snipped which is from the BASS devs for achieving gapless playback. I have not checked it, however I will do so from within a test app and see if it leads to really gapless playback.

    Regards,
    grubi.

    mixer=BASS_Mixer_StreamCreate(44100, 2, BASS_MIXER_END); // create mixer
    BASS_ChannelSetSync(mixer, BASS_SYNC_END|BASS_SYNC_MIXTIME, 0, EndSync, 0); // set sync for end

    source=BASS_StreamCreateFile(...,BASS_STREAM_DECODE|BASS_SAMPLE_FLOAT); // open 1st source
    BASS_Mixer_StreamAddChannel(mixer, source, BASS_STREAM_AUTOFREE); // plug it in (and auto-free it when it ends)

    BASS_ChannelPlay(mixer, FALSE); // start playing

    ...

    void CALLBACK EndSync(HSYNC handle, DWORD channel, DWORD data, DWORD user)
    {
    if (!more_sources) return;
    source=BASS_StreamCreateFile(...,BASS_STREAM_DECODE|BASS_SAMPLE_FLOAT); // open next source
    BASS_Mixer_StreamAddChannel(mixer, source, BASS_STREAM_AUTOFREE|BASS_MIXER_NORAMPIN); // plug it in
    BASS_ChannelSetPosition(mixer, 0); // reset the mixer
    }
     
  5. parkuhr

    parkuhr Portal Pro

    Joined:
    September 2, 2007
    Messages:
    357
    Likes Received:
    2
    Ratings:
    +3 / 0
    Home Country:
    Germany Germany
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!