getmusicbee.com

Support => Bug Reports => Topic started by: projeKct on December 16, 2018, 08:05:55 PM

Title: Wavebar progress out of sync
Post by: projeKct on December 16, 2018, 08:05:55 PM
I know that this subject has been discussed somewhere, but I can't find the solution.

I love the wavebar feature of MusicBee (in the main player OR in theater mode), but there is a delay between the wavebar progress and the audio: the audio is played a little less than 1 second later.

I have tried to switch between DirectSound and WASAPI with no difference.

The wavebar feature of foobar2000 and AIMP are working great on the same computer.

Can you help, please?

Thanks.
Title: Re: Wavebar progress out of sync
Post by: projeKct on December 17, 2018, 01:43:58 AM
More testing...

When we seek by clicking on the wavebar, anywhere within the track, we can sometimes have better syncing. Well... sometimes yes, sometimes no... It's weird.
Title: Re: Wavebar progress out of sync
Post by: phred on December 17, 2018, 01:51:42 AM
I've noticed this ever since the option to add two wavebars was added. I'm not saying it's because of the two wavebars. I'm just referencing -about- when I started noticing it.
Title: Re: Wavebar progress out of sync
Post by: projeKct on December 21, 2018, 12:22:26 AM
Any idea what is causing this? Any solution?
Title: Re: Wavebar progress out of sync
Post by: phred on December 21, 2018, 12:49:13 AM
The solution is to wait for Steven to take a look at it to see if it can be fixed. I remember a time a good number of years ago, before MB had a wavebar and the progress bar was a second or so out of sync with the actual music. Steven fixed that, so perhaps he'll be able to fix this. There's nothing you can do other than being patient.
Title: Re: Wavebar progress out of sync
Post by: projeKct on December 21, 2018, 02:22:08 AM
Ok, thanks! I'm good at being patient!  ;)

I only want to make sure that Steven is aware of this problem...
Title: Re: Wavebar progress out of sync
Post by: Steven on December 24, 2018, 06:12:27 PM
1 seconds seems quite a high latency but in any case this version should adjust for that if you are using WASAPI (shared)

https://getmusicbee.com/patches/MusicBee33_Patched.zip
unzip and replace the existing musicbee files
Title: Re: Wavebar progress out of sync
Post by: phred on December 25, 2018, 03:59:50 AM
Unfortunately there's not much of a change. Or there is and it's worse. On some tracks the lag is 3-4 seconds.
Using WASAPI (shared) with bluetooth headphones or with speakers connected directly to the speaker port of the sound card. I also tried DirectSound with both output devices and there's no difference.

Would my settings file be of any help?
Title: Re: Wavebar progress out of sync
Post by: Steven on December 26, 2018, 06:24:01 PM
when you start playing music, is there a 3-4 second lag before you start hearing the sound?
Also are you using any Equaliser/ DSPs ?
Title: Re: Wavebar progress out of sync
Post by: phred on December 26, 2018, 07:16:21 PM
when you start playing music, is there a 3-4 second lag before you start hearing the sound?
Also are you using any Equaliser/ DSPs ?
No, there's no delay between the sound and the wavebar position when I first start playing a track.
I do have the Stereo Enhancer DSP enabled, but I tried with it disabled and I see no difference.
Title: Re: Wavebar progress out of sync
Post by: Steven on December 26, 2018, 07:45:54 PM
in that case can you send me a link to your settings
Title: Re: Wavebar progress out of sync
Post by: phred on December 26, 2018, 08:11:19 PM
PM with link sent.

Thanks.
Title: Re: Wavebar progress out of sync
Post by: Steven on December 27, 2018, 06:42:10 PM
could you also send me one song where you see the 3-4 second lag and also post a screenshot so i can compare with my computer?
Title: Re: Wavebar progress out of sync
Post by: phred on December 27, 2018, 07:32:46 PM
PM sent with link to track and screenshot.
Title: Re: Wavebar progress out of sync
Post by: Steven on December 27, 2018, 10:05:53 PM
The reason is due to the way BASS processes MP3 files (it approximates the seek points in MP3 files). If you convert the file to flac, it will be spot on.
There is a setting in BASS that mostly addresses the issue but it substantially increases the load time to open the mp3 file, so I dont want to implement that for what in my view is not a serious issue.
I think the inaccuracy is mainly with large MP3 files as the player position approaches the end of the track. I have made one change though - when you jump position using the seek bar, it now makes use of the BASS flag i was referring to, and is accurate in my tests for the file sent.

https://getmusicbee.com/patches/MusicBee33_Patched.zip
Title: Re: Wavebar progress out of sync
Post by: phred on December 27, 2018, 11:39:30 PM
As a test, I converted the file to FLAC and I agree - it's spot on. I also tested the original track (which I sent you) and it's much better - especially near the end of the track.

As a further test, which I will do later today or tomorrow, I will test tracks with smaller MP3 files and report back.

Can you confirm that it's a waste of time and disk space to convert a lossy format to a lossless format, especially for a relatively minor,
mostly visual problem?

Thanks for looking into this and for the explanation as to what is going on.
Title: Re: Wavebar progress out of sync
Post by: Steven on December 28, 2018, 08:46:19 AM
Actually i think the last patch version should completely solve the issue. See how you get on
Title: Re: Wavebar progress out of sync
Post by: phred on December 28, 2018, 08:34:21 PM
Actually i think the last patch version should completely solve the issue. See how you get on
Played some long tracks and played some short tracks. I feel the result is pretty consistent no matter what the length. While it's not spot on as it is/was with FLAC files, the MP3s are off by what I'd guess is less than a second. Which is certainly acceptable as compared with what was happening before you looked into it.

Thanks. And hope you have a happy, healthy, and successful 2019.
Title: Re: Wavebar progress out of sync
Post by: phred on January 15, 2019, 09:00:12 PM
@Steven...

I hate to bring up an issue from last year that I though was resolved, but on MP3 tracks that I don't consider all that large, I'm seeing a 2-3 second lag between the wavebar current position and the actual sound. I've noticed this over the past 3-4 builds, but I can't imagine you did anything to change it. Currently on 3.3.6952.

If it turns out it's the best it can be, I'll have to live with it, but if some more tweaking can be done, that'd be great.

I'm going to PM a link to a track that, at least to me, it's quite apparent.

Thanks.
Title: Re: Wavebar progress out of sync
Post by: Steven on January 15, 2019, 09:42:11 PM
Where in that track are you finding a 2-3 second lag? And are you using the seek bar at all, or letting play reach the position normally?

For me, a couple of places seem to have a 0.5 second lag but i cant find any large lags
Title: Re: Wavebar progress out of sync
Post by: phred on January 15, 2019, 10:51:45 PM
There's a 2+ second lag at the following points:
0:03
0:12
1:24
2:52

It seems obvious to me. Look at the peaks on the wavebar. I'll look for a track that had a greater lag when I was listening last night.
Title: Re: Wavebar progress out of sync
Post by: Steven on January 16, 2019, 07:10:43 AM
the 0:03 point is a good one to focus on.
I will compare the graph to audacity to make sure its in agreement the blip is at 0:03
I guess you are saying you actually hear the sound when the progress bar says 0:05?
for the record i hear it and see the progress bar at 0:03

Also could you confirm you have no DSPs active and the same behaviour when WASAPI (exclusive) is used?
Title: Re: Wavebar progress out of sync
Post by: phred on January 16, 2019, 08:01:20 PM
the 0:03 point is a good one to focus on.
I will compare the graph to audacity to make sure its in agreement the blip is at 0:03
I guess you are saying you actually hear the sound when the progress bar says 0:05?
for the record i hear it and see the progress bar at 0:03
Not quite. I -hear- it at :03 but the vertical progress indicator reaches that point when the sound is at :05. The 'indicator' is running ahead of the sound.

Quote
Also could you confirm you have no DSPs active and the same behaviour when WASAPI (exclusive) is used?
I did have the Stereo Enhancer" enabled, but I see the same issue with it disabled.
Title: Re: Wavebar progress out of sync
Post by: Steven on January 16, 2019, 08:20:23 PM
I compared the graph with audacity and its the same graph. The exact position in audacity is 3.75 seconds.
There is some rounding involved with the position of the MB graph bars depending on the overall width of the progress bar, and also MB rounds the displayed progress position up, so there is some scope for discrepencies due to rounding.
Having said that, I hear the blip at 3-4 seconds and see the same on the progress bar. I think I will need to leave it unsolved for you
Title: Re: Wavebar progress out of sync
Post by: phred on January 16, 2019, 08:30:06 PM
Having said that, I hear the blip at 3-4 seconds and see the same on the progress bar. I think I will need to leave it unsolved for you
Ok - thanks for taking the time to look at it.
Title: Re: Wavebar progress out of sync
Post by: railfan-eric28 on January 31, 2019, 02:59:47 AM
I hope this is the right thread.   I am listening to my bird sounds on musicbee, mp3 some 10-30secs long.   the chirps from the birds don't match up to the waveforms as it progresses.     Also with the shorter files using crossfade the last 5 seconds is clipped off of a 12 sec or so file.   I have the same problem with poweramp.   I guess the crossfade doesn't' adjust for the shorter files. 
Title: Re: Wavebar progress out of sync
Post by: phred on May 13, 2019, 11:02:00 PM
@Steven-

Would you be willing to take another look at this in the near future? I can PM you the link to two tracks (one short @ 44 seconds, and another average length @ 3:11.

This issue is so readily apparent to me that I'm almost ready to abandon the wavebar. Which I really don't want to do.

Thanks
Title: Re: Wavebar progress out of sync
Post by: hiccup on May 13, 2019, 11:07:59 PM
@Steven-

Would you be willing to take another look at this in the near future? I can PM you the link to two tracks (one short @ 44 seconds, and another average length @ 3:11.

This issue is so readily apparent to me that I'm almost ready to abandon the wavebar. Which I really don't want to do.

Thanks

Just curious and offering, if it helps, send me a link to the files and I can let you know what I experience with my setup/hardware?
Title: Re: Wavebar progress out of sync
Post by: projeKct on May 13, 2019, 11:10:16 PM
Yes, and I may add: what is the difference between foobar2000 decoder and musicbee decoder? Because in foobar2000, the wavebar is always accurate.

(But I prefer musicbee, so I would like to have best of both worlds...)
Title: Re: Wavebar progress out of sync
Post by: phred on May 13, 2019, 11:18:45 PM
Just curious and offering, if it helps, send me a link to the files and I can let you know what I experience with my setup/hardware?
I'll accept your offer with thanks.
PM sent.
Title: Re: Wavebar progress out of sync
Post by: hiccup on May 13, 2019, 11:39:47 PM
I have been consciously aware of the wavebar not being synchronous with the sound for a long time, but it hasn't bothered me enough to raise/support issues with it.
But that is probably because I usually have the wavebar positioned very small in the sidepanel.

For this testing I enlarged it, and the discrepancy is now very clear to notice.

I am guessing I have the sound trailing the wavebar approximately 0.6 seconds, which is a lot indeed.
It would bug me for sure if I had the wavebar larger then the some three inches I usually have it at.

(nice music b.t.w.)
Title: Re: Wavebar progress out of sync
Post by: phred on May 14, 2019, 12:11:50 AM
Thanks for giving it a shot. Since my wavebar spreads across the entire bottom of the window, it's -very- apparent. Maybe this will help Steven if he takes another look at it. I should add that the delay is off by under a second. Which is a lot with a wide wavebar.

I will add that I installed Audacity and while not spot on, it's much closer than with MB.

Glad you liked the music.

(http://i.imgur.com/nV5npmfl.jpg) (https://i.imgur.com/nV5npmf.jpg)
Title: Re: Wavebar progress out of sync
Post by: sveakul on May 14, 2019, 02:13:06 AM
Yes, and I may add: what is the difference between foobar2000 decoder and musicbee decoder? Because in foobar2000, the wavebar is always accurate.

Foobar uses a combination of its own internal decoder and modified ffmpeg libraries depending on the file type.  MusicBee uses the extensive and constantly updated BASS audio libraries.  AIMP, which you mentioned in another post, uses BASS decoding libraries (and ffmpeg for webm and some alt. types) in combination with its own engine which internally supports wasapi/asio/DS outputs and does its own resampling.  That is just FYI per your question, what it may or may not have to do with the wavebar sync I do not know.
Title: Re: Wavebar progress out of sync
Post by: hiccup on May 29, 2019, 11:29:25 PM
Thanks for giving it a shot.

Not sure, and just an observation in the spur of the moment: this seems to have improved with one of the latests updates?
Title: Re: Wavebar progress out of sync
Post by: phred on May 30, 2019, 01:05:12 AM
Not sure, and just an observation in the spur of the moment: this seems to have improved with one of the latests updates?
A very quick test with .7086 doesn't seem like it's changed any. I'll have more time tomorrow to find a better track to test it.

Thanks for the heads up.
Title: Re: Wavebar progress out of sync
Post by: phred on May 30, 2019, 07:21:24 PM
Still showing a lag. The audio occurs after the wavebar.

This is the file I'm using as a test. Obviously the -visual- is exaggerated with such a short (50 seconds) track, but the time difference is about the same with a longer track - a little over one second.
https://www.mediafire.com/file/y272rs3o2meo3zz/Snowy_Day_Test.mp3/file
Title: Re: Wavebar progress out of sync
Post by: hiccup on May 30, 2019, 08:17:24 PM
Still showing a lag. The audio occurs after the wavebar.

You're right.
I'm sorry, I was playing a long classical track, and it caught my eye that the progress seemed better synchronized.
Title: Re: Wavebar progress out of sync
Post by: phred on May 30, 2019, 08:25:29 PM
I'm sorry, I was playing a long classical track
That's what you get for listening to classical. You need some good ol' rock 'n roll. THUMPA THUMPA THUMPA
Title: Re: Wavebar progress out of sync
Post by: Steven on May 30, 2019, 08:36:42 PM
i will have another look at some point in the future but it will be helpful if its confirmed if converting to flac format solves the issue
Title: Re: Wavebar progress out of sync
Post by: phred on May 30, 2019, 08:45:53 PM
Thanks Steven. Converting to flac doesn't improve it. On my first two tries with flac, it almost seemed slightly more exaggerated. But if in fact it was, it was only by milliseconds. I appreciate that you're willing to take another look at this in the future.

Do you want the flac copy?
Title: Re: Wavebar progress out of sync
Post by: Steven on June 01, 2019, 05:38:50 PM
Thanks for the test file
I am comfortable that the wavebar values and the display of the wavebar is accurate and visually comparable to audacity.
After some more testing i have come to the conclusion its simply a delay between when the sound data is proceesed and when you actually hear it. For example, playing using ASIO, there is no latency and the sound plays exactly according to the wavebar, but any other output mode there is a delay of approx 250ms.
So I have put in a display delay of 250ms, however I am uncertain that will be the same for all machines as i believe its more than just the internal buffering that BASS uses

https://getmusicbee.com/patches/MusicBee33_Patched.zip
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 01, 2019, 07:53:14 PM
So, obviously it's gonna be hard to adjust to accommodate for every setup.

Just in case it is useful info: with my setup (wasapi exclusive, play some silence, event mode) I now have some 0.3 seconds delay between audio and visual.
Title: Re: Wavebar progress out of sync
Post by: Steven on June 01, 2019, 08:10:01 PM
how about when using WASAPI (Shared) and also WASAPI exclusive without event mode ?

edit:
the next update should address wasapi event mode, but if you could verify the other 2 modes then that would be helpful
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 01, 2019, 08:26:16 PM
Maybe better ignore my previous comment...
A quick re-test now implies the opposite, namely the progress bar slightly trailing the audio. That's new.
When I have a clear head and more time/concentration I'll see if I can come up with some coherent info that may perhaps be more useful.
Title: Re: Wavebar progress out of sync
Post by: Steven on June 01, 2019, 08:31:58 PM
https://getmusicbee.com/patches/MusicBee33_Patched.zip
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 01, 2019, 08:51:26 PM
When I have a clear head and more time/concentration I'll see if I can come up with some coherent info that may perhaps be more useful.

This is not the clear-headed analytical response yet, but I did notice something very odd I thought to mention:

I tested one track that is now right on the money. (using both an mp3 and a flac rendition)
But I tested another track where the audio trails the visuals substantially. As a rough guess at least half a second. (both flac and mp3)

So it looks like there is a whole different factor at play here that has an influence.
(perhaps embedded metadata, albumart?)

I'll do some more testing, perhaps tomorrow.
Title: Re: Wavebar progress out of sync
Post by: phred on June 01, 2019, 10:18:06 PM
With the update in Reply #44 I'm finding that it's close enough that I can live with it. There is still a very slight lag on just about every track I tested. But not enough of a lag to spend more time on it for me although hiccup seems to have issues. I'll wait for his more thorough testing.

BTW, I'm using WASAPI shared. I have no ASIO device so I tested on Direct Sound which to me seemed as close as WASAPI shared.

There were (are) two tracks that are more 'off' than everything else I tested today. But I'm not going to worry about a random track here and there. Although I would think if it's fixed for the bulk of them, why would it not be for these odd ones?
Title: Re: Wavebar progress out of sync
Post by: projeKct on June 01, 2019, 10:22:17 PM
I must say that with the latest updates I'm pretty satisfied too. I use WASAPI shared, and every file I listen to is "accurate enough" since today's updates. Thanks!  :)
Title: Re: Wavebar progress out of sync
Post by: Steven on June 02, 2019, 07:38:15 AM
@phred, can you also try with WASAPI exclusive?
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 02, 2019, 08:08:13 AM
The exact same track that yesterday clearly trailed a lot (some 0.7 sec) both as mp3 and as flac, now play pretty much spot on.
No changes to audio settings, just a pc restart.
I'm putting this on ice.
Title: Re: Wavebar progress out of sync
Post by: Steven on June 02, 2019, 08:25:33 AM
The exact same track that yesterday clearly trailed a lot (some 0.7 sec) both as mp3 and as flac, now play pretty much spot on.
No changes to audio settings, just a pc restart.
I'm putting this on ice.
i am not sure whether you saw my comments and are using the updated version which made some changes for event mode
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 02, 2019, 09:00:44 AM
i am not sure whether you saw my comments and are using the updated version which made some changes for event mode

I used the latest patch 3.3.7091.36867
Since I didn't change settings between yesterday and today, and now both songs play fine, there must have been some glitch I can not explain.
To repeat myself for clarity, yesterday song A played fine, both mp3 and flac, but track B trailed some 0.7 sec., both the mp3 and the flac version.
Today all 4 versions play well.

Since I can not replicate it today, I don't have much to contribute to this further, and I am gonna put the wavebar in the small corner where it used to live before, and where any discrepancy never bothered me.
Title: Re: Wavebar progress out of sync
Post by: phred on June 02, 2019, 01:39:11 PM
@phred, can you also try with WASAPI exclusive?
WASAPI exclusive seems to be closer than WASAPI shared. But if it actually is, it's only by micro-milli-seconds. Barely detectable difference.

As stated yesterday, I'm willing to put this to rest. Unless it pops up again in the future.

Thanks for plugging away on this, Steven.

Somewhat related question - why would/should I use WASAPI exclusive rather that shared? There are time where I'm playing something in MB (shared) and stop the playback and check out something online. As I understand it, I'd have to shut down MB exclusive in order to hear audio from another source. Is that correct?
Title: Re: Wavebar progress out of sync
Post by: frankz on June 02, 2019, 03:33:40 PM
Somewhat related question - why would/should I use WASAPI exclusive rather that shared? There are time where I'm playing something in MB (shared) and stop the playback and check out something online. As I understand it, I'd have to shut down MB exclusive in order to hear audio from another source. Is that correct?

Here's what Steven said on another thread about it a few months ago:
WASAPI (Shared) and DirectSound are different APIs that both use the same windows processing via the Windows Mixer.
The advantages are for the functionality available to developers.
However some exernal applications and Linux Wine need the DirectSound API to be used in order to function

You don't need to shut down MB to hear audio from another source, you just need to stop (rather than pause) playback in MB when you want to.

I hear a pretty significant improvement in sound quality using Exclusive over Shared, and I'm not particularly "golden eared.".
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 02, 2019, 03:35:42 PM
Don't put any more effort on this on my account, but the issue was still in my head, and while playing a very short track I noticed the waveform was completely off.
Doing a test with very short tracks seems to show that short tracks can have some weird waveform issues.
(Which might explain what I experienced yesterday with what was also a short track, approx 30 seconds.)

In case anybody's interested and wants to try it out, here are two tracks that on my system don't even come close in matching audio/waveform progress.

https://www.dropbox.com/s/o3k0d0fw2ok6yvd/short%20test.rar?dl=0

Anyway, since for more 'normal' length tracks it seems there is not really an issue anymore I can understand if this case is closed.
Title: Re: Wavebar progress out of sync
Post by: Steven on June 02, 2019, 03:47:22 PM
Thats due to the very short length and presumably wide wavebar you might have - the returned graph data doesnt correctly represent the actual values. There are some limitations on the bass decoder that makes handling that situation more difficult but i will see what can be done
Title: Re: Wavebar progress out of sync
Post by: Steven on June 02, 2019, 03:55:54 PM
actually it was quite easy to fix:
https://getmusicbee.com/patches/MusicBee33_Patched.zip
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 02, 2019, 04:03:53 PM
Nice, another mystery solved.
The 30 sec track now also plays tight every time.
Title: Re: Wavebar progress out of sync
Post by: sveakul on June 02, 2019, 05:36:23 PM
I hear a pretty significant improvement in sound quality using Exclusive over Shared, and I'm not particularly "golden eared.".

Ditto that here.  Also, since Exclusive by-passes the Windows mixer, the sample rate of the original file is passed directly to the device instead of being resampled to match the sample rate set in Windows.    As long as your audio device/card is compatible with the source sample rate, that is the rate at which it will be played, regardless of the Windows setting.  With the BASS library, if the source rate is NOT compatible with your device (which means that in Exclusive the playback would fail), bass.dll itself will resample to a compatible rate (44.1kHz in my experience).  That very rarely is necessary with modern devices which accept a wide range of source sample rates.
Title: Re: Wavebar progress out of sync
Post by: hiccup on June 02, 2019, 06:18:58 PM
There now often appear some artifacts in the waveform:

https://i.imgur.com/BSrz3Iq.gifv

(likely a consequence of the latest waveform fix)
Title: Re: Wavebar progress out of sync
Post by: phred on June 02, 2019, 06:31:22 PM
@frankz & sveakul...

Thanks to both of you for the clarification of shared vs exclusive. I did a couple of quick tests as you've removed my concerns about not being able to output from another source. I assume in the past I paused and not stopped. Stopping allows me to do what I thought I couldn't.
Title: Re: Wavebar progress out of sync
Post by: Steven on June 02, 2019, 06:57:33 PM
There now often appear some artifacts in the waveform:
that should be fixed now
https://getmusicbee.com/patches/MusicBee33_Patched.zip