PDA

View Full Version : LMS AAC/M4A gapless



AndyTwizzle
2018-03-03, 09:54
Setup:
• LMS 7.9.0-163 running on Synology 213air connected to Wi-Fi router via LAN cable
• 1 x Squeezebox Touch, 2 x Squeezebox Radios, 1 x Squeezebox Receiver - all connecting over Wi-Fi
• LMS library either ALAC Apple Lossles (scanned in on iTunes) or AAC/M4A 256kbps downloads from iTunes

Been listening to my digitised + iTunes music colleciton as one library via LMS for many years around the house. Much of my collection is scanned in from CDs, but for the last three years I've mostly been downloading from iTunes to save physical space in the house. I downloaded David Bowie's live album 'Stage (2017 Remaster)' as 256kbps AAC from iTunes recently and noticed split second audible gaps between the tracks when there is crowd noise. This really surprised me, as I know LMS is gapless and I have many, many mix, live and continuously-segued CDs that play perfectly gapless in their ALAC Apple Lossless digitised versions. The album plays gaplessly on my iPod Nano, so it's not a problem with the album's actual audio.

Now I stop to think about it, I guess most of my downloaded iTunes collection has silence between album tracks, so buying this particular live album could be the first time I've really noticed that an album from iTunes doesn't play perfectly gapless on my Squeezeboxes via LMS. Guessing it's not a pre-buffering issue, as ALAC files are much larger than 256kbps AAC, and transition gaplessly with no problems.

Anyone experienced this with iTunes downloads or other M4A/AAC tracks on LMS? Anyone know of any LMS or Squeezebox settings that might prevent it? Any other tips?

Thanks

Andy

Mnyb
2018-03-03, 23:31
Experiment for you .

Disable native AAC in file types and see if the server does a better job decoding AAC than the Today h itself ?

Hopefully your NAS is a recent model that have the grunt to run faad and SoX.
( otherwise test with a computer based lms ).

Over the years some shortcomings of the built in alac and aac decoder in Touch has been discussed.
I’m not sure if this gap issue is one of them .

bpa
2018-03-04, 02:07
Over the years some shortcomings of the built in alac and aac decoder in Touch has been discussed.
I’m not sure if this gap issue is one of them .

Gapless AAC has been discussed a numebr of times - one of the issues is the file format - IIRC unlike MP3,AAC in a M4A format has a file structure which if not set up right then the boundaries between files is apparent. I think the trick is to force LMS to always do AAC to Flac decoding - that can removes the "boundary" between files and make gapless appear. Older players always transcoed but newer player have native AAC which means the boundary issues is apparent.

OP should read other posts such as
http://forums.slimdevices.com/showthread.php?108464-AAC-not-fully-gapless

which links to the thread where andyg says AAC gapless is not there in newer player (2012).
http://forums.slimdevices.com/showthread.php?93714-Gapless-playback-no-longer-working-properly

AndyTwizzle
2018-03-04, 03:57
Thanks for the replies. Just tested the changes both threads mentioned (turning off sync between players and turning off native AAC transcoding) and neither worked. With both changes, CDs scanned in as ALAC play perfectly gaplessly, but AAC doesn't.

I mostly listen to shuffled playlists on my Squeezeboxes, so it's possible I've never noticed the AAC gapless glitches before, but I think it highly unlikely - I have almost 4,000 tracks downloaded from iTunes, so many of these must have gapless sections - Paul Daper's recent 'Spooky Action' being one, which I know I've played in full several times (my keen ear would've noticed the glitches in between tracks that I'm now hearing). But I'm not aware of changing anything in my LMS or NAS.

Anyone else got this problem with gapless AAC files on LMS? Is this something I can report as a bug to be looked into and hopefully resovled for the next version avaialble on Synology? I'm on version LMS 7.9.0-163 .

Any other potential solutions?

Thanks again.

Andy

AndyTwizzle
2018-03-04, 04:11
Just a thought... I disabled (what I thought were) unused plugins a few months ago. Is it possible I've disabled one (3rd party or otherwise) that may have prevented this bug)?

bpa
2018-03-04, 05:27
Just a thought... I disabled (what I thought were) unused plugins a few months ago. Is it possible I've disabled one (3rd party or otherwise) that may have prevented this bug)?

Plugins generally enable playback. So if playback happens (albeit with gaps) and plugin is disabled - the plugin is unlikelyt to be related.,

Did you read the thread I referenced ?

Basically disable "natiev" playback for AAC and M4A in WebUI Setting/Advanced/Fuiletypes (don't forget to click apply) and see if there is a difference.

If you play or sync with the Squeezebox receiver transcode will happen automatcially.
so for example
* If you played AAC through Receiver - it could be gapless.
* If you played AAC through synced Touch and Receiver - it could be gapless.
* if you played AAC synced through both Touch and Radio - there would be gaps.

AndyTwizzle
2018-03-04, 06:37
Hi yeah, I disabled all native AAC/M4A in the settings, but gapless AAC albums still have a momentary gap between tracks. Any other ideas?

Andy

bpa
2018-03-04, 07:42
Accordinging to https://www.synology.com/en-global/knowledgebase/DSM/tutorial/General/What_kind_of_CPU_does_my_NAS_have

The processor on your LMS server seems to be a Marvell Kirkwood 88F6282 which a single core prcoessor with no hardware Floating point support (i.e. no FPU) . Transcoding does a lot of floating point artihmetic which can load a processor with no FPU especially a single core. It is possible the processor is underpowered to do transcoding without delay (i.e. a gap) and without trasncoding AAC will have a gap.

You could test by installing LMS on a PC .

pinkdot
2018-03-05, 23:45
I don't know if AAC is gapless in every setup or not, but what DSM version is installed on your nas?
Why don't you update LMS to 7.9.1 166?

AndyTwizzle
2018-03-06, 05:53
I don't know if AAC is gapless in every setup or not, but what DSM version is installed on your nas?
Why don't you update LMS to 7.9.1 166?

I'm on DSM 6.1.5-15254-1, released on 27 Feb 2018. I haven't updated to the latest LMS as I only upgrade when there's a new packaged-up Beta version available from Synology's Package Center (plus I don't know how to manually install it myself).

Thanks

Andy

pinkdot
2018-03-06, 06:28
I'm on DSM 6.1.5-15254-1, released on 27 Feb 2018. I haven't updated to the latest LMS as I only upgrade when there's a new packaged-up Beta version available from Synology's Package Center (plus I don't know how to manually install it myself).

Thanks

Andy
Hi Andy,

The 166 build should be available in the Package Center! Did you uncheck the beta channel after you installed the 163 build? That would clarify why you don't see the 166 build.

Also in the AAC issue: I read here and there that sometimes AAC is converted which could be interfering with gapless playback. As you can read here, your Duet doesn't support AAC natively.
http://support.logitech.com/en_us/search?Id=kA1i00000007OCRCA2#q=Supported%20file%20 formats&t=All

Greetings,

Martin

AndyTwizzle
2018-03-06, 12:39
Thanks for the tip - I'd turned off Beta upgrades in DSM. Now have versiojn 7.9.1-166 (although have yet to test out gapless AAC/M4A).

I've never played with Settings>Advanced>File Types before (screenshot below). In fact, I'm not exactly sure what it is I'm setting. I understand that it is determining how/if each file format is to be transcoded by LMS into each player, but don't understand how to modifty this - for example:


Why is there more than one file format listed for each type?
Why do some file types have more than one transcode setting seleted?
Why are some stream formats greyed out?


Any advice you can give me would be much appreciated - couldn't find anything relevent in an online search.

Thanks

Andy

24664

Mnyb
2018-03-06, 14:47
For example AAC the first tab says “native” turn that to “disabled”
Do the same for ALAC.

AndyTwizzle
2018-03-06, 16:07
For example AAC the first tab says “native” turn that to “disabled”
Do the same for ALAC.
What should that achieve? And what do the other stream type options do?

pinkdot
2018-03-06, 23:48
That would trigger transcoding on your nas. Something you don't want according to bpa.

IMO, the best option here would be to find the CD's where gapless playback is wanted.
Convert these files to FLAC.
This way your nas doesn't have to do any transcoding, and FLAC is supported natively by all your squeezeboxes.

Sent from my Redmi 3S using Tapatalk

bpa
2018-03-06, 23:54
That would trigger transcoding on your nas. Something you don't want according to bpa.

IMO, the best option here would be to find the CD's where gapless playback is wanted.
Convert these files to FLAC.
This way your nas doesn't have to do any transcoding, and FLAC is supported natively by all your squeezeboxes.

Sent from my Redmi 3S using Tapatalk

NO - I said the only way to get gapless is to USE transcoding and disable native. This is according to [Andyg LMS developer? ] advice in the other referenced thread.

However, the NAS processor maybe not powerful enough for the transcoding in realtime and so you get gaps. I suggested OP to try LMS on a proper PC to test.

Gapless on LMS really only works with Flac and MP3. I think M4A/AAC gapless requires a lot of things to line up including right M4A file format.

Any time I say AAC - it is the same for ALAC.

Mnyb
2018-03-07, 00:01
What should that achieve? And what do the other stream type options do?

For the AAC exemple it would NOT send AAC to the players it would pick one of the remaining alternatives (in qualaity order and if the player supports it)

It would then try to send FLAC and doing that by using faad/flac helper apps and then convert the sound to flac on the server .

For ALAC it would try to use faad/sox .

These are just a list of options for how the server could handle each file formats. And it would chose the "best" option for a given situation.
It would naturally pick "native" first if the player supports the format by or otherwise it would choose to transcode to a format the player can deal with.
In 99 of use cases you should not change this.

In you case we want you to deliberatly disable native playback of AAC and ALAC to see if the server does a better jobb with gaps as its decoder migth be better.
So the server (your NAS) will transcode the stream to FLAC a formats thats very well fsupported on th Touch .

Mnyb
2018-03-07, 00:04
And to chime in with the rest of the guys .
The NAS migth not be upp to it (memory and cpu) .
So test nr 2 was to run LMS on more powerfull machine (any other computer you migth have ) and do the same test .

pinkdot
2018-03-07, 00:23
NO - I said the only way to get gapless is to USE transcoding and disable native. This is according to [Andyg LMS developer? ] advice in the other referenced thread.

Sorry, yes you are right. Are you referring to this post?
http://forums.slimdevices.com/showthread.php?93714-Gapless-playback-no-longer-working-properly&p=691896&viewfull=1#post691896

Sent from my Redmi 3S using Tapatalk

bpa
2018-03-07, 02:11
Sorry, yes you are right. Are you referring to this post?
http://forums.slimdevices.com/showthread.php?93714-Gapless-playback-no-longer-working-properly&p=691896&viewfull=1#post691896
yes.

It's all to do with the frames in audio streams. M4A / AAC does not have the same frames as Flac and MP3. AAC is audio encoding. M4A was initially a file format and so whole file contents was expected to be available at time of playing - this is not the case when streaming. For example, in M4A some metadata such as image could be at end of file which doesn't suit streaming.

AndyTwizzle
2018-03-07, 07:33
That would trigger transcoding on your nas. Something you don't want according to bpa.

IMO, the best option here would be to find the CD's where gapless playback is wanted.
Convert these files to FLAC.
This way your nas doesn't have to do any transcoding, and FLAC is supported natively by all your squeezeboxes.

Sent from my Redmi 3S using Tapatalk
As I stated in my original post, I have no problem with any CDs at all - they all play perfectly in my digital collection having been converted into Apply Lossless ALAC using iTunes. It's the gapless albums downloaded from iTunes that have momentary gaps in between tracks.

What confuses me is that both ALAC and AAC files have the same file extension of .m4a - so shouldn't LMS and Squeezeboxes handle them in the same way? Plus my ALAC files are CD quality, and therefore much larger in file size, yet they play gaplessly perfectly fine - yet AAC files have smaller file size and can't seamlessly handle gaps. All very confusing!

bpa
2018-03-07, 07:55
As I stated in my original post, I have no problem with any CDs at all - they all play perfectly in my digital collection having been converted into Apply Lossless ALAC using iTunes. It's the gapless albums downloaded from iTunes that have momentary gaps in between tracks.

What confuses me is that both ALAC and AAC files have the same file extension of .m4a - so shouldn't LMS and Squeezeboxes handle them in the same way? Plus my ALAC files are CD quality, and therefore much larger in file size, yet they play gaplessly perfectly fine - yet AAC files have smaller file size and can't seamlessly handle gaps. All very confusing!

1. ALAC and AAC are different audio encodings.
2. M4A is a a complicated standard with many options for a file format - but there dozens of ways the AAC or ALAC contents can be put into the file. For example metadata and indexed to file can be at the start or at the end. Some choice of options in the M4A file format do not suit streaming (i.e player is only given a little bit of the file at a time starting at the beginning unlike an iPod or PC based player which can see the whole file when starting to play)

Best option is to get a M4A analyser and find the difference between the good and bad files and convert the bad files to a LMS friendly version of M4A (i.e audio content doesn't change just the M4A file format).

atrocity
2018-03-11, 12:06
I noticed non-gaplessness with AAC a few months back and found that the problem only occurred with synced players. Streaming to a single player worked fine.

As others have pointed out the issues with M4A file layout, I'll mention that recent versions of Foobar2000 have an option under utilities to optimize the file layout. Not sure if that will help you, but in my experience it doesn't hurt anything.