Bug 127652 - gapless playback doesn't work like it should
Summary: gapless playback doesn't work like it should
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: Playback (show other bugs)
Version: 1.4.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 143161 147824 154823 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-19 14:47 UTC by Jaakko Lintula
Modified: 2009-03-04 16:12 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proof of Amarok's gapless playback (20.96 KB, image/png)
2007-07-12 18:57 UTC, Harald Sitter
Details
Recording with Amarok and MPD. With Amarok around 1 second of sound has been cut away. (31.39 KB, image/png)
2007-07-13 12:45 UTC, Morten Wendelboe
Details
Recording with Amarok and MPD. Zoomed in around the 2.7 seconds mark. (44.97 KB, image/png)
2007-07-13 12:46 UTC, Morten Wendelboe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaakko Lintula 2006-05-19 14:47:37 UTC
Version:           1.4.0 (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
Compiler:          gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5) 
OS:                Linux

amaroK 1.4.0 advertises it can do gapless playback with the Xine-engine if version of xine-lib is at least 1.1.1.

The playback is not gapless in the sense the term "gapless playback" normally is understood: "Gapless playback is the seamless playback of digital audio formats. It allows live music or consecutive tracks to be heard *exactly as they are mastered*, without gaps between tracks." (emphasis mine, see http://en.wikipedia.org/wiki/Gapless_playback)

Instead, there's noticeable amount of music cut (perhaps a tenth or two of a second, I estimate) from end of the previous song. Yes, the playback is kind-of-gapless, but not really. Is there a problem in my system?

I'm using xine engine with ALSA output plugin and in the "Configure playback" screen, I've selected transition behaviour to be "No crossfading, insert gap: 0 ms". Version of my xine-lib is 1.1.1+ubuntu2-7, the package name is libxine-main1.

I've tried this with several FLAC and Ogg Vorbis files, and software such as XMMS (with the xmms-crossfade output plugin and its proper configuration), ogg123 and Rockbox play them properly.
Comment 1 Björn Gräbe 2006-08-10 21:45:45 UTC
same here with amarok 1.4.1
Comment 2 Szaman 2006-08-20 13:21:40 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Andrew Gaydenko 2006-10-22 14:14:39 UTC
the same with current SVN version
Comment 4 Szaman 2006-10-22 15:02:33 UTC
Amarok 1.4.3 (KDE 3.5.5, xine 1.1.2) on debian unstable

gaps between songs are sometimes present and sometimes not, i can't figure out whether it depends on something. i've noticed that some .mpc albums are played gapless, or as nearly gapless i can't hear gaps :] anyone know how i can make some more research in this subject?

also i'd like to remind that some albums can be played gapless only with cutting some silence before and after the file, like it was with the crossfade plugin in xmms
Comment 5 François Bissey 2006-11-12 21:54:44 UTC
On 1.4.3 there's definitely a small gap. And also yes it may be worse depending 
on how the album was ripped. I have an album that plays "gaplessly" (1-2 tenth 
of a second between tracks) except for one (and no it's not where the cut used to
be on vynil) that always start with a gap for some reason.
Also playback from cd through cd extraction is NOT gapless at all.
Comment 6 Andrew Gaydenko 2006-11-12 22:06:49 UTC
François,

Let's rectify the problem and omit CD-ripping nuances at all. Anybody can try to test the issue simply splitting any sound file with sound editor.

Comment 7 Guillaume Pratte 2007-02-10 17:41:08 UTC
I have the same problem, with Amarok 1.4.5-1 and libxine 1.1.4-2 on Debian. 

Between two songs wich on CD would be continuous I can hear a distinctive "click" sound (a gap). This is with OGG files; it is probably true for other formats as well.

I'll stick with XMMS for now. The xmms-crossfade just works for me : true gapless playback thanks to an internal buffer.
Comment 8 Mark Kretschmann 2007-03-18 16:18:20 UTC
*** Bug 143161 has been marked as a duplicate of this bug. ***
Comment 9 Wolfgang Jeltsch 2007-03-18 16:48:41 UTC
I (the reporter of bug 143161) want to add that in my case the gap between the songs is sometimes one *second* or more in length and that this seems to be the case especially when the system is swapping or maybe otherwise accessing the hard disk. I’m playing OGG Vorbis files on a 1.8 GHz AMD Turion.
Comment 10 William Gallafent 2007-04-25 23:04:57 UTC
As per default behaviour on Kubuntu 7.04 (the popup appears and I press "amarok", since that's the only player presented, the other options being for ripping etc.), I use amarok to play CDs directly via cdda:/, using xine engine for output. Even after setting fadeout to 0, there is a significant gap (close to a second, even?) between tracks, which renders live recordings, or anything requiring continuity, very unpleasant to listen to.

I'm very happy to play CDs via CDDA, since I get better quality that way (decent sound card, not so decent D/A on the CD drive!), but not when the player inserts gaps in the audio stream! As well as the gap before the track starts after the previous one finishes, there's a very short pause / glitch after maybe a couple of seconds.

Standard Kubuntu 7.04 packages, amarok (and 'amarok-xine') version 2:1.4.5-0ubuntu7.
Comment 11 Jeremy Duvall 2007-07-02 16:10:37 UTC
The problem still exists in Amarok 1.4.6 using libxine 1.1.6.

I performed several tests, and here are my results:

The samples: I ripped gapless playback cd's (3 Tiesto Albums) using K3B to LAME VBR, Ogg, and AAC--using the nero aac encoder and wine. The ogg and AAC filesets played back gaplessly, but the AAC was slightly buggy.  The mp3 filesets have about a tenth of a second space between tracks.

I copied these files over to a windows machine and played them with foobar2000.  All three file sets have perfect (by that I mean CD quality) gapless playback.

The same problem exists with any LAME encoded mp3's that are transferred over to my iPod, but I expect that is an issue with libgpod.
Comment 12 Andrew Gaydenko 2007-07-02 16:17:39 UTC
Jeremy,

You don't need any win32 software to get/check gapless playing back: rip with cdparanoia and try to play back with aqualung.
Comment 13 scott cox 2007-07-12 17:11:19 UTC
These gapless playback issues have plagued amarok since the project began and have never been properly implemented. Each new version has me checking it out to see if its fixed and I have been let down for so long that I have a perfect record assuming that it isnt fixed at each release. The attempts to make playback gapless in amarok have been hacks. Codecs that support gapless playback have within their specification the methods that make it work. Amarok has been trying to hack external players such as xine with no success. There are quite a few players out there that do support gapless playback, mpd, xmms2, etc.. Amarok=great ui+poor playback MPD=poor ui+perfect playback. It's a mess.
Comment 14 Harald Sitter 2007-07-12 17:23:56 UTC
Hm, I really wonder why you don't just fix it then, Scott. Might be more constructive than whining. After all, Amarok is FLOSS, so go ahead and implement it properly.
Comment 15 Mark Kretschmann 2007-07-12 17:28:55 UTC
Gapless playback works fine with most modern codecs, e.g. Ogg and FLAC. It can however not work perfectly with MP3, due to limitations of the format.

Quoting wikipedia:

"This issue is technical but also standards-related. The popular MP3 standard, for example, defines no way to record the amount of delay or padding for later removal. Also, the encoder delay may vary from encoder to encoder, making automatic removal difficult.[2] Even if two tracks are decompressed and merged into a single track, a gap will usually remain between them. More recent compressed audio formats (such as Ogg Vorbis) have been designed to address this problem, and can therefore produce gapless audio if played back correctly."
Comment 16 Jeremy Duvall 2007-07-12 17:44:08 UTC
LAME mp3 enables gapless playback by a special field in the header.  The exact same way that ACC/itunes does it.

What you are saying is definitely true.  And, if my ipod would play OGG I would switch immediately, but we have to play with the cards we have been dealt.  It's also hard to find a decent encoder for ACC on linux (unless you use wine and nero), and ACC gapless playback on Amarok is a little buggy as well.  There's also the issue of popularity.  Not many people I know outside of Linux heads know what Ogg Vorbis is.

Consider my input constructive criticism.  Amarok is absolutely the best player for Linux (and Windoze if it were ported).  I can deal with the gaps until they fix it.
Comment 17 Andrew Gaydenko 2007-07-12 18:08:00 UTC
To #15

Mark, if I remember well, you are using Gentoo also - as I'm. So it is interesting, I can not confirm FLAC files are playing back smooth. 'aqualung' plays smoothly. And it is interesting, such gaps take place on both my old ~x86 PC and new ~amd64. It is very intriguing for me - you have not FLAC-gaps-related problems :-)
Comment 18 Harald Sitter 2007-07-12 18:21:18 UTC
Jeremy, I think (without having checked that), that the tag for gapless playback is not defined in the ID3v2.4 standard, therefore not supported by our tagreading/writing backend, which makes an implementation based upon that tag a lot more complicate.

Amarok supports on-the-fly transcoding (for example via transKode, see kde-apps.org), therefore it's totally unimportant which stupid codecs a certain media device supports, you can always transcode your music. Of course transfer takes slightly longer, but hey, if you just keep live albums as OGG-Vorbis and the rest as MP3 it's still most usable.

Also there are better firmwares out there: http://www.rockbox.org.
Comment 19 Harald Sitter 2007-07-12 18:50:45 UTC
I did play 2 different live albums (Flogging Molly - Alive Behind the Green Door && Mad Caddies - Live From Toronto: Songs in the Key of Eh!) both in OGG-Vorbis and FLAC, redirected Amarok's output via ALSA to KRec, recorded it, imported _the RAW data_ into Audacity, zoomed in, zoomed out, listened, listened again and again, compared the listened to the graphic of the audio track and came to the conclusion -> this bug isn't valid (at least not any more [I used Amarok 1.4.6 with ALSA 1.0.13 and libxine 1.1.4]).

There is absolutely NO gap, not even a very small one, I even sent Mark a screenshot, and he also thought: "<markey> ouch.. there is no gap :("

Bug resolved with WORKSFORME
Comment 20 Jeremy Duvall 2007-07-12 18:56:51 UTC
Harald, thanks for your reply.  I was waiting for someone to suggest using another firmware.  Unfortunately, in order to keep my warranty valid on my iPod, that is not an option. Seeing as how I'm clumsy and I have already destroyed one by dropping it, I don't want to take that risk.

Transcoding from one lossy format to another is not a good idea either--or so I've been told on the hydrogenaudio forum and in the OGG vorbis FAQ.

Yes, I am aware there are tons and tons of workarounds for solving the gapless playback problem on my PC as you and others have pointed out.  But the tradeoff comes in the time spent by the user setting up said workarounds.  I understand that it is probably a bother to implement some of the desired functionality outlined in this bug, but as a real user of the software my goal is to cut down on the amount of work it takes to maintain my music library.  And ultimately a UI/User centered piece of software like Amarok (IMHO) should facilitate that. 

In the space vs. quality war, VBR mp3 or Acc always wins.  And, iPod recently boasts that it supports gapless LAME.  Hence my choice of LAME mp3s.  Unforuntately, I have recently found that mp3's transfered from Amarok don't work gaplessly either.  I suspect this is not Amaroks problem at all, however but a problem with the library that handles the ipod.

Thanks for hearing me out!

References

Gapless LAME on iPod
http://www.hydrogenaudio.org/forums/lofiversion/index.php/t53222.html

Lossy to Lossy is bad
http://vorbis.com/faq/#transcode
Comment 21 Harald Sitter 2007-07-12 18:57:48 UTC
Created attachment 21127 [details]
Proof of Amarok's gapless playback

I also attached the screenshot. It's showing the so-called "gap" from /Flogging
Molly - What Made Milwaukee Famous (made a loser out of me)/ to /Flogging Molly
- Between a Man and a Women/
Comment 22 Mark Kretschmann 2007-07-13 00:39:03 UTC
*** Bug 147824 has been marked as a duplicate of this bug. ***
Comment 23 Morten Wendelboe 2007-07-13 12:45:13 UTC
Created attachment 21134 [details]
Recording with Amarok and MPD. With Amarok around 1 second of sound has been cut away.

Look at the first screenshot (audacity1.png) The recording from MPD looks fine,
but the recording from Amarok is too short (it should have lasted for 6
seconds, but is only almost 5 seconds long). Around the 2.7 seconds mark you
can see that there is something wrong with the recording from Amarok.
Comment 24 Morten Wendelboe 2007-07-13 12:46:38 UTC
Created attachment 21135 [details]
Recording with Amarok and MPD. Zoomed in around the 2.7 seconds mark.

I have zoomed in around the 2.7 seconds mark and made a new screenshot
(audacity2.png). If you look at this second screenshot, you will see that the
sinus curve is broken at the 2.670 seconds mark. There is no gap, but the first
track has been cut so the 2 tracks don't fit correctly.
Comment 25 Morten Wendelboe 2007-07-13 12:48:20 UTC
#21: It is not a proof that gapless playback works correctly!
Read #1 carefully: It tells that there is a problem with the implementation of the gapless feature. It is gapless, but some part of the music is missing.

I can proof this with 2 screenshots. First I played tone_1.ogg and tone_2.ogg (from http://www.11elt.com/cct/cds_and_files.html) with Amarok and recorded it with Audacity. Then I made a new track in Audacity and recorded the playback with MPD. In the screenshots you will see the recording from Amarok and underneath it you can see the recording from MPD.

Look at the first screenshot (audacity1.png) The recording from MPD looks fine, but the recording from Amarok is too short (it should have lasted for 6 seconds, but is only almost 5 seconds long). Around the 2.7 seconds mark you can see that there is something wrong with the recording from Amarok. I have zoomed in around the 2.7 seconds mark and made a new screenshot (audacity2.png). If you look at this second screenshot, you will see that the sinus curve is broken at the 2.670 seconds mark. There is no gap, but the first track has been cut so the 2 tracks don't fit correctly.
Comment 26 Andrew Gaydenko 2007-07-13 13:07:25 UTC
From #25:  "It is gapless, but some part of the music is missing."

Yes! It is more strictly the bug describing! And somebody must be deaf to not notice the issue :-) Morten, will you (as "clarification author") open new bug (something like "music missing on track changing")?
Comment 27 Mark Kretschmann 2007-07-13 13:15:57 UTC
Dude no, not another report. Just keep posting here.
Comment 28 Jeremy Duvall 2007-07-13 16:50:03 UTC
In addition, according to an email I received from the author of libgpod, amarok is responsible for passing the gapless information on to my iPod.  After loading a group of songs using the newest version of gtkpod (0.99.10) my LAME encoded mp3's are perfectly gapless.
Comment 29 Harald Sitter 2007-07-14 03:32:21 UTC
Jeremy: Open a bug report, that's a totally different issue. Seems like Amarok has to read the gapless info from the files metadata and has to write them into the iPod's database.

Morten, Andrew and everyone else: WHATEVER! The only bug I found after testing every now and then is that the very last song in the playlist is (technically) missing up to some seconds, though I didn't notice when listening for that. As I understand, xine detects the fading at beginning and end, which is present, and just "cuts" (actually wrong term) it off. Same for the last song, which then somehow leads to that awkward issue.

Anyway, the bug I described above could be fixed in Amarok (as a work around), but probably has to be fixed for real in xine, just like most other bugs you might experience with gapless playback. Therefore report them to xine and not to Amarok http://sourceforge.net/tracker/?group_id=9655&atid=109655

...you can provide 30000 screenshots showing a wrong track bonding, but this bug is not valid with proper hardware and a proper current software set. In all the testings I did there was _never_ a wrong bonding... and I actually compared the output to almost every Linux player supporting gapless playback. And I'm actually getting kinda pissed due to this bug.
Comment 30 imruska 2007-11-22 10:07:36 UTC
"but this bug is not valid with proper hardware and a proper current software set"

I bought a new laptop with an IntelCore2 CPU, I'm using openSUSE 10.3 KDE 3.5.8 and Amarok 1.4.7, libxine 1.1.8. I think this is proper hardware and a proper current software set. The gapless issue has, however, unfortunately  not been resolved, as I had to realise it listening to Pink Floyd's The Final Cut album. Although you may have a point about *proper* software set. Xine and Amarok do not seem to be proper software for normal audio playback. Anyone who would like to hear music in a *proper* way, listen to audio cds in the *proper* way, should stay away from Xine and Amarok.
It obviously works on the developers' *proper* hardware, therefore they will never fix this issue. I think this is the nub of the matter. Since they do not believe that their marvellous software does have such a huge fault, they do not work on fixing it. The only pity that there is no KDE music player to play back files (ogg, mp3, flac etc.) and audio CDs gaplessly, so KDE guys have to use GNOME programs, or Windows programs with WINE. 
Thank you for this. Keep up the good work, perhaps in KDE 5 it will work.
Comment 31 Andrew Gaydenko 2007-11-22 10:24:18 UTC
imruska,

I'm partly agree with you. Being excellent UI app, Amarok has unusable sound engines support. I was forced to reject using the app and switched to MPD/qmpdclient. Last one isn't such handy as Amarok is, but the MPD engine simply works.

Will wait for KDE4/Amarok2. I'm sure, a developing of new versions is a much more attractive thing rather than repairing and support of old versions. It is normal. It is open source. So, don't treat my message as some kind of claim. And don't have your own ;-)
Comment 32 imruska 2007-11-22 12:19:51 UTC
Andrew,

I can also start with the same sentence. I partly agree with you. Only partly. I do not hope too much from KDE4/Amarok2, due to the attitude of the developers. As you can see, the status of this bug is RESOLVED, WORKSFORME. Whereas users of Kubuntu, Debian, and openSUSE have been reporting that it is not resolved and does not work for them. This bug report dates back to May 2006. Have Xine or Amarok people had no time for fixing this?
I know this is rather a Xine issue and not an Amarok one, since Kaffeine has the same problems. But I am utterly frustrated that I cannot open an account at Xine's bugzilla. I tried 3 times, I am said that I would receive an e-mail and follow the instructions. But I do not get any e-mail. So when I try to log in, I get the reply, that my account has not been validated. I was hoping (obviously in vain) that Amarok developers notice that this is a serious issue and exert some pressure on Xine to fix this bug. Or they should develop their playback engine. If Aqualung could do it, Amarok could do it as well. But as you see, they do not recognise/admit anything is wrong with Amarok's gapless playback, so why should they fix something which in their opinion is not broken? You read: with proper hardware and proper current software set this issue is not an issue.
"Rediscover your music" is Amarok's motto. Yeah, we do rediscover music which we only know in the gapless way now with inserted gaps. A great discovery. Many thanks for Amarok for it.
Comment 33 Seb Ruiz 2007-11-22 14:06:49 UTC
imruska. with that attitude of abuse you will get nowhere.

this is a very complicated issue - the blame of which can not be placed entirely on either amarok nor xine.

additionally all development on the 1.4 series has stopped. we are placing all of our energy into Amarok 2.0. to make matters worse we are very short on developers. we simply HAVE NOT had the manpower to fix this.

we hope that with the introduction of plasma gapless playback will be fixed.

i cannot reproduce the issue, as gapless playpack works on my machine, but i will reopen the bug report if it makes your broken heart feel a little better.
Comment 34 Morten Wendelboe 2007-11-22 14:29:29 UTC
As Harald Sitter suggested, I have reported the bug to the developers of libxine. You can see the bug at:
http://sourceforge.net/tracker/index.php?func=detail&aid=1480668&group_id=9655&atid=109655

/Morten Wendelboe
Comment 35 Seb Ruiz 2007-12-29 21:53:32 UTC
*** Bug 154823 has been marked as a duplicate of this bug. ***
Comment 36 domino1 2008-05-28 05:20:42 UTC
ok this isnt really related to this bug, but WHY on earth are developers making Amarok 2.0 for KDE4? Why is KDE4 being made when 3.5.x still has tons of bugs? Are bugs going to magically resolve themselves when moved to QT4 or whatever is the supposed benefit of KDR4????

KDE3 should be polished and polished, look at the kernel for example, its still at 2.6.x and being polished daily...

I've been using open source soft for a long time now. I've posted dozens of bug reports to various projects. And only on one project the devs actually showed interest. It was the GIMP. Even though my problem was a very oddball and specialized image format, not normally encountered by anyone, they immediately jumped on it and fixed the  Open function within days!

Comment 37 g111 2008-11-22 19:09:22 UTC
It really would be great if this issue could be fixed. I think amarok is a really cool player and I like to play around with it very much. But as long as my ogg files cannot be played gapless by amarok it is nearly not usable for me. (I did test that xmms2 does play the tracks gapless fine.)

I tested it with amarok from SVN compiled a few days ago
Version 2.0-SVN
Using KDE 4.1.73 (KDE 4.1.73 (KDE 4.2 >= 20081112))

Is there a chance of working around this problem by switching from xine to gstreamer as playback engine? (I just tried once but did not manage to make amarok play anything with this setting.)

Thanks,
Gert
Comment 38 Myriam Schweingruber 2009-03-04 16:12:45 UTC
Sorry folks, I close this bug, as the reasons for difficulties in gapless playing of mp3 has be thorougly explained above and this is definitely not an Amarok bug.
Also, the developement of the 1.4 has ended quite some time ago, so there is no reason to keep this open.