[FIXED] gapless issues on galaxy s3

Support questions for Neutron Player only.
cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

[FIXED] gapless issues on galaxy s3

Post by cantara256 » Mon Jul 16, 2012 2:04 am

Hi, I just bought Neutron for my shiny new Galaxy S3 and overall love it. However, it is not playing gapless flawlessly; all my gapless MP3s, which display "GAPLESS" when played, have a small but noticeable "skip" when switching to the next track in the album. It's not so much a gap in the music, but more like a couple of frames are dropped and there's a small skip in the music.

I have tested with several MP3 albums that play flawlessly in iTunes and my iPod Touch. Mostly these have been ripped via LAME (e.g. Pink Floyd The Wall), but it also happens with Dark Side of the Moon, which I bought from Amazon MP3. The ALAC rips of these CDs play fine, but unfortunately most of my music that requires gapless is in MP3 and I don't have many of the original CDs anymore.

Thanks for the help,

Raul

Liveinthemoment
Posts: 209
Joined: Fri Feb 24, 2012 2:40 am

Re: gapless issues on galaxy s3

Post by Liveinthemoment » Mon Jul 16, 2012 3:26 am

Dmitry will probably ask to analyse your file for you.

You may also want to look at this post to check for errors in your MP3s:
http://neutronmp.com/forum/viewtopic.php?f=3&t=410#wrap

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: gapless issues on galaxy s3

Post by dmitrykos » Mon Jul 16, 2012 8:43 am

MP3 in general is not good for gapless playback. Its decoder makes silence gaps in the very beginning of the music. If you try opening any of your MP3 using Audacity editor you will notice that there is a gap of silence for each MP3. Neutron's MP3 decoder does some job by removing that silence but MP3 standard does not define anything related to gapless support and thus that silence removal is more experimental and sometimes gap is not removed fully, or sometimes some of audio data is removed.

LAME encoder has additional setting to enforce gapless encoding mode. But if LAME encoder was used but gapless mode wasn't enforced the result will be not guaranteed.

Here is some information about it (http://www.rockbox.org/wiki/GaplessHowTo):
Method 2

Lame has a --nogap command line option which does basically the same. This is useful if you don't want to rip the whole CD as one file and it has the additional benefit that this way you'll get completely valid mp3 files. For this method it is necessary to have Lame encode all tracks at once! Because many MP3 players are not able to strip metadata properly, Lame removes all tags by default. The additional option --nogaptags overrides this behaviour. Use it this way:
lame --other_options --nogaptags --nogap track01.wav track02.wav track03.wav ...

Lame can only produce gapless mp3s (by pushing the track boundaries slightly) if it gets all the tracks in the right order!
Neutron itself guarantees that after the last audio sample provided by decoder of current music file follows first audio sample of next music file.

cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

Re: gapless issues on galaxy s3

Post by cantara256 » Mon Jul 16, 2012 6:37 pm

Why does it work in iTunes and iPods but not Neutron?

cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

Re: gapless issues on galaxy s3

Post by cantara256 » Tue Jul 17, 2012 7:15 am

Poweramp has similar issues with gapless playback. GoneMad actually does have flawless gapless. I do understand the technical high level issues behind MP3 gapless, I've been running into them a very long time and is one of the main reasons I've stayed with iTunes/iPod for so long. What are iTunes/iPod/GoneMad doing that allows them to do gapless without any problems?

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: gapless issues on galaxy s3

Post by dmitrykos » Tue Jul 17, 2012 1:00 pm

iTunes could be tagging MP3 as gapless and use some additional information from tags to cut the silence. May be you could e-mail me 2 files where one is following another so I could analyze them and try to improve Neutron's gapless? If you decide to help could you please e-mail to me to address: neutronmp@gmail.com

cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

Re: gapless issues on galaxy s3

Post by cantara256 » Tue Jul 17, 2012 5:29 pm

I just emailed you two MP3 tracks from Dark Side of the Moon. Let me know what you figure out. Thank you!

cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

Re: gapless issues on galaxy s3

Post by cantara256 » Fri Jul 20, 2012 7:29 pm

Looking at this a little more closely it seems that --nogap is not necessarily ideal; it encodes the beginning of the next track into the current one, so if you listen to a single track (instead of playing tracks in sequence) it will sound odd at the very start/end. This option seems to be deprecated and isn't even mentioned in http://wiki.hydrogenaudio.org/index.php?title=LAME.

Apparently the "official" way to support gapless with LAME encoded tracks is for the player software to read the LAME INFO tag which says where the silence begins/ends for each track. That does mean the player has to have code specific for LAME, but it does seem to be the way other players make it work, and should support perfect gapless since LAME is providing the metadata necessary. (See http://wiki.hydrogenaudio.org/index.php ... at_support.)

This gives me hope that it won't be too difficult to support LAME gapless in Neutron. :)

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: gapless issues on galaxy s3

Post by dmitrykos » Tue Jul 24, 2012 2:23 pm

Have some update on this question. Well, LAME tag is being read but MP3 format has specifics - whn MP3 track starts it has 'warm up' slice of samples in the very beginning of the track, like it is shown on this screenshot:
Untitled2.jpg
Untitled2.jpg (165.26 KiB) Viewed 11558 times
So when LAME tags exists it says how many audio frames to chop from the beginning of the start. As you can understand there is no ideal transition for MP3. I checked how Neutron is playing FLAC and it joins both files perfectly. For MP3 I made some pre-processing of very first portion of audio data and very last, which helps to chop some zeroes on track start and end and thus it helps to join 2 MP3 files almost perfectly.

cantara256
Posts: 24
Joined: Sat Jul 14, 2012 3:26 am

Re: [IN PROGRSS] gapless issues on galaxy s3

Post by cantara256 » Wed Jul 25, 2012 12:40 am

Thank you, that's awesome. I know this is a very tricky issue.

I think the LAME Technical FAQ discusses this issue in very great detail: http://lame.sourceforge.net/tech-FAQ.txt. It is way too technical for me to fully understand, but perhaps it will help here.

There is another page that claims it is possible to fully implement gapless based on LAME tags: http://www.compuphase.com/mp3/mp3loops.htm. See "Part 2 - Theory of operation".

I hope this information is useful, your efforts are very much appreciated.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests