musikCube Logo
musikCube community wiki

You are not logged in.

Announcement

mC2 :)

#1 2005-03-13 02:07:04

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Gapless Playback

Hello.
   Ok I feel real bad for requesting 3 things with my first few posts. But think this is a brill player and want to replace winamp (which requires a few things for me before I would).

My final request is to have gapless playback. I tried with a x-fade of 0s but this didn't really do much. Also I'd love to be able to have it so when I've got x-fade on it x-fades and with it off, I'd get gapless playback. So that when listening to mixed albums x-fade can be turned off, and when listening to random music its turned on.

Cheers


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#2 2005-03-15 11:22:30

Guest
Guest

Re: Gapless Playback

Gapless playback is really an important feature for me too, and a player without it is unusable for me...
If that single feature was added I think I would switch from winamp smile  I love the rest of this player

 

#3 2005-03-15 21:07:50

avatar3d
mC Project Manager
Registered: 2005-02-13
Posts: 641

Re: Gapless Playback

Gapless playback is an idea I've been kicking around for some time.  At some point it will be introduced, but some major changes to the threading playback system would have to happen, which I'm not currently prepared to undertake (I'm currently drowning in bug reports). Sorry guys... hopefully by 1.0.


Casey Langen
Project Manager
http://www.musikcube.com

Offline

 

#4 2005-04-27 07:02:15

HuwSy
Member
Registered: 2005-04-27
Posts: 3

Re: Gapless Playback

why is it that a crossfader is possible but gapless playback is not, even seting the crosfader to 0.01 does not play without a slight pause, eventhough the tracks are ment to be overlapped.

Offline

 

#5 2005-04-27 07:34:50

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

Because gapless playback requires a little more than just overlapping the tracks. Unfortunatly it seems that when you encode to mp3 a little silence is always added to beginning/end(?) of the track. This means that the player needs to search for this silence and then skip forwards to where the sound starts. Anoying or what!


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#6 2005-04-27 08:38:13

totaldarkness
Member
From: UK
Registered: 2005-02-21
Posts: 147

Re: Gapless Playback

How comes my MP3s are playing gaplessly? is it just me? is my computer just really fast?

Last edited by totaldarkness (2005-04-27 08:39:52)


http://myweb.tiscali.co.uk/totaldarkness/mc.jpg
http://tinyurl.com/blugz/minibar.png

Offline

 

#7 2005-04-27 08:47:22

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

DiGiTaLFX is correct, you have to add code to read the LAME header for MP3's and use info contained in it to eliminate the gap that gets built into the MP3 itself.

You also have to handle the streams somewhat differently than it handles them now (currently it creates a new playback stream for every song), and that's somewhat problematic with regard to format plugins and such.

Offline

 

#8 2005-04-27 10:26:50

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

Otto wrote:

currently it creates a new playback stream for every song

Surely this has no effect tho! As long as the code knows where the gap is in relation to the two songs, it can just start the second one (as a new stream) from the correct place as soon as the "end" of the first one has been reached. I only say this because I assume that when the crossfader comes into action, it plays two streams at once and just fades the old one out whilst fading the new one in.

totaldarkness wrote:

How comes my MP3s are playing gaplessly?

Really? As in if you listen to a mixed album with the crossfader turned off, you don't notice any glitch at all in between tracks? I can't see how this would be hardware related as the code isn't there to do anything. Anyways, lucky u!

DiGiTaLFX


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#9 2005-04-27 10:36:27

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

DiGiTaLFX wrote:

Surely this has no effect tho! As long as the code knows where the gap is in relation to the two songs, it can just start the second one (as a new stream) from the correct place as soon as the "end" of the first one has been reached. I only say this because I assume that when the crossfader comes into action, it plays two streams at once and just fades the old one out whilst fading the new one in.

It can have an effect, although it might not. Basically, when a song ends, the old stream is deleted, the new one is started, and playback begins. If this process happens fast enough, you'd never notice any gap, but if there's a delay between removing the old stream and adding the new one, you'd have an issue.

The crossfader causes the new stream to start before the old one finishes, whereas with gapless we want the new stream to start at the exact moment that the old one finishes, which takes some doing.

Offline

 

#10 2005-04-27 10:49:29

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

Otto wrote:

The crossfader causes the new stream to start before the old one finishes, whereas with gapless we want the new stream to start at the exact moment that the old one finishes, which takes some doing.

Yeah i realise it would take some doing. All I'm thinking is that you would probably have to calculate exactly the same thing if you were to use a single stream (as you'd have to work out where to cut the old track and stick in the new one). So if you know all this information, then you could just start the new stream at the right time. I don't really know much about doing this, so I can only assume that the problem would be that you can't predict when the new stream will actually start?
DiGiTaLFX


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#11 2005-04-27 13:37:59

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

DiGiTaLFX wrote:

So if you know all this information, then you could just start the new stream at the right time. I don't really know much about doing this, so I can only assume that the problem would be that you can't predict when the new stream will actually start?

Right. You can do it, it's just not particularly simple. Starting playback on a channel involves some latency before playback actually starts. In order to eliminate this latency issue, you basically must never actually stop playing data. When the stream ends, you have to keep going with the next stream without stopping and restarting.

Essentially, you can do a BASS_StreamCreate and feed it a callback to your own decoder function. This function will basically take a look at two different open BASS_Streams and return decoded data from one of them to play, using BASS_ChannelIsActive() to tell if there's decoded data left and BASS_ChannelGetData() to get that data into a buffer. You can also put in patches here for ignoring certain bits of data (beginning and ending of a MP3 file) to ignore inserted silence due to encoding.

Anyway, when the stream ends, this callback function switches to the other one instead. Then you have your playback functions call another function to swap the two streams and open the new stream with the new file.

This sort of thing prevents you from having to close the stream or stop the channel playback, eliminating that latency problem. It's buffering everything through a single stream which is always "playing", essentially.

You also will need to change how you get the played time and such so as to ask the current stream instead of the actual playing stream (since that stream is always playing) and essentially you have to abstract a whole lot of stuff to account for this weird mess. This also makes it tricky for a format plugin that doesn't use built in BASS decoders to work. Not impossible, just trickier. Some thought has to be given to the decoder there because now you're going through two callbacks instead of one, so the first callback has to be really, really fast in case you don't have a lot of buffer time left.

Anyway, it can be done, but it'd take some time to do and it would also substantially change the way format plugins work, so those would all break as well.

Last edited by Otto (2005-04-27 13:39:16)

Offline

 

#12 2005-04-27 13:57:37

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

Oh ok. Well my only final suggestion from all of this is that if doing something like with would break the format plugins, would it not be a good idea to do now, whilst there are few of them about? Obviously this is really Casey's descision, but if you ask me this is a feature that will get requested more and more and so it makes more sense to implement now before there are lots of format plugins to break!
DiGiTaLFX


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#13 2005-04-29 14:28:31

HuwSy
Member
Registered: 2005-04-27
Posts: 3

Re: Gapless Playback

But im not even getting gapless playback on streams that I know have no blank data at the start or ends, as ther ogg vorbis, and iv looked in soundforge. They even burn gaplessly in nero (knowing how notoriously bad at gaplessnes it is)

Offline

 

#14 2005-04-30 02:51:56

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

presume this just comes back to creating individual streams then


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#15 2005-05-01 13:10:51

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

HuwSy wrote:

But im not even getting gapless playback on streams that I know have no blank data at the start or ends, as ther ogg vorbis, and iv looked in soundforge. They even burn gaplessly in nero (knowing how notoriously bad at gaplessnes it is)

Gapless has not been implemented in musikCube yet, which is why you're not getting gapless. I was just describing how it could be done and why it's slightly complex. smile

Offline

 

#16 2005-05-03 15:02:58

HuwSy
Member
Registered: 2005-04-27
Posts: 3

Re: Gapless Playback

Ah I see, is ther any time scale for implimentation of gapless playback, or is it just something which will get done at some point when someone has the time?

Offline

 

#17 2005-05-03 17:15:44

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

Yep, that's sorta how it works. If you want to work on it, talk to Casey, I'm sure he'd be glad for any help. smile

Offline

 

#18 2005-12-08 00:48:31

masahiro
Member
Registered: 2005-11-21
Posts: 5

Re: Gapless Playback

is gapless playback currently possible with cds?  mC playback of cds is currently not gapless for me.  is there something i can do with the settings, or is this just the way it is for the time being?  i have 'new song' 'crossfader' at 0.00 sec..., but still get a click when a new track on a cd begins.

Offline

 

#19 2006-01-06 10:14:48

tidalwav1
Member
From: USA
Registered: 2006-01-06
Posts: 2
Website

Re: Gapless Playback

Just to voice more support for gapless playback--

I was a foobar2000 user, but I needed better database capabilites. I even tried writing my own universal music database frontend in Java (see http://jmediacat.sourceforge.net) but I wanted to see what else was around.

I found musikCube, and love it, but not having gapless playback is a huge drawback. I don't know how all of those iPod junkies can live without it, but I can't. wink

I figure the more people that ask for gapless playback, the more the developers will be motivated to implement it. There, I'm done ranting. Keep up the great work on mC, otherwise.

Offline

 

#20 2006-01-06 13:02:31

DJ Maedrik
Member
Registered: 2005-06-21
Posts: 36

Re: Gapless Playback

I agree with the above two comments.  I really think that gapless shouldn't be too hard for both CD and .wav playback, since there are no actual gaps to deal with.  Then again, I'm not a developer, so I don't really know what I'm talking about.

Regardless, my vote still goes to better gapless playback.

Thanks guys!


http://musikcube.com/remote/nowplaying/image/f681dd9ffea13efeee27ea2aab00e184/line1=$TITLE;line2=by%20$ARTIST/minibar.png

Offline

 

#21 2006-01-08 09:41:55

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

Yeh you know if it was possible to implement this for cd playback (i presume this is handled in a slightly different way to files from hard disk ?) then this would be a good idea.


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#22 2006-01-08 13:12:23

Otto
mC Plugin Developer
From: Memphis, TN
Registered: 2005-02-25
Posts: 999
Website

Re: Gapless Playback

The problem with implementing gapless playback has to do with musikCube and the way it works internally. It's not easily fixed for any format. I have thought about this, but it's a tricky proposition any way you slice it.

So the answer is "not anytime soon" probably. Sorry.

Offline

 

#23 2006-01-10 11:24:40

DiGiTaLFX
Member
From: UK
Registered: 2005-03-13
Posts: 569
Website

Re: Gapless Playback

ah well mC 2.0 for sure then


http://musikcube.com/remote/nowplaying/image/f47f132464b31ce352368b82b56fe953/minibar.png

Offline

 

#24 2006-02-01 13:43:22

Menollo
Guest

Re: Gapless Playback

huuuu... I need gapless!

 

#25 2006-02-11 19:52:54

Moose
Guest

Re: Gapless Playback

Yes me too, live audio sucks wihtout gapless

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson