Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Gapless playback

Mon Aug 06, 2012 8:18 pm

On my Debian PC I use the Windows music player Foobar2000, running in Wine, because it is the only way I have found to play back AAC files (.m4a) gaplessly. Ridiculous, I know, as the files are all encoded in Linux using the native NeroAacEnc command line AAC encoder provided by Nero Digital. Gstreamer applications, like Banshee, will play FLAC and WAV (and I believe Vorbis, though I haven't tried) without gaps, but don't work for me with Lame MP3s or Nero AACs, even though both support gapless. I run Debian testing on my PC.

Wine of course won't run on the Pi. Does anyone know of any music player (either jukebox style, a la iTunes, Banshee etc.; or non-library style, a la VLC) that will run natively in Linux and will play back my live albums without gaps between the tracks?

(Incidentally, if anyone knows of an Android player that can do the same, I would be grateful to hear. Poweramp will play Lame MP3s gaplessly, but not Nero AAC files.) Thanks!

trondis23
Posts: 42
Joined: Mon May 21, 2012 11:55 am

Re: Gapless playback

Tue Aug 07, 2012 10:39 am

I have gapless playback on an OpenElec build from June 23. It is broken on all other versions following this, in OpenElec, Raspbmc, Xbian etc. But try a build from June 23 from here http://sources.openelec.tv/tmp/image/openelec-rpi/

On Android you can try Neutron Music Player. It is much better at handling gapless than PowerAmp. It is better sounding too.

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Tue Aug 07, 2012 1:54 pm

Thanks trondis23, I'll try both those suggestions. Looks like I'm not going to get a chance for a few days now, which is annoying as I'm now itching to give them both a go! (Might have time to look at the Android app.) There seem to be two builds on 23 June; I guess I'll try the later one and hope they didn't break it between nine and eleven o'clock that night! Cheers.

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Thu Aug 09, 2012 6:54 pm

Could I ask for a bit more help? I've tried the 23 June build of OpenELEC as suggested. OpenELEC itself looks awesome; but I'm not getting gapless playback. I've tried WAV, FLAC, Lame MP3 and Nero AAC, and the result is pretty much the same for all formats: momentary stutters between each track. Not exactly two seconds of silence, I admit, but to me gapless means totally seamless, with absolutely no noticeable interruption between tracks. As if you were playing the CD. Nothing less is good enough for live albums or concept albums. Foobar2000 does this for all of the above files tested; Banshee under Linux does it for the WAVs and FLACs. Are you definitely getting absolutely seamless track changes? Are you using the later or earlier image dated 23 June? In what way did it get broken after that -- I presume the gaps got bigger?

Incidentally, I tried encoding the WAVs (CD rips) to AAC, and then decoding them back to WAVs, all using the native Linux neroAacEnc and neroAacDec executables from Nero Digital, and examining the files in Audacity. There is definitely no padding being introduced into the waveforms which Foobar2000 is somehow intelligently removing at playback time.

Surely Linux can play these things back? What's the point being able to encode them (and the same goes for gapless Lame MP3s) if you can't play them properly without needing Windows/WINE?

[Just read that back and realized it's verging on a rant. Sorry! Definitely not aimed at you, trondis23, or anyone else on here!]

trondis23
Posts: 42
Joined: Mon May 21, 2012 11:55 am

Re: Gapless playback

Sat Aug 11, 2012 10:46 am

I think I got my img from this site: http://sparky0815.de/openelec-download- ... omment-575

Try the one from June 26 for a 4 GB card.

Perfect gapless playback is a must for me also on a music player. I would say it is useless without it.

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Sat Aug 11, 2012 9:40 pm

Thanks again. I'll give it a go. Totally agree about gapless. I just can't believe the extent to which this seems unimportant to almost everyone. I've been pinning back an old version of gstreamer-plugins-good on my Debian system for at least a year because gapless (which used to work, at least for FLAC and WAV, as I mentioned) got broken in regression, and it took months for the bug even to get properly acknowledged, let alone fixed. Spotify is useless to me because it completely mangles track transitions, actually fading tracks in -- who on earth wrote that code? Most portable music players make no attempt to implement gapless (even though my Walkman had no trouble nearly thirty years ago) and as for listening on a mobile phone -- forget it!

Another rant... sorry. Makes me feel better!

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Wed Aug 15, 2012 4:25 pm

Thanks for your help so far, trondis23. I've tried the June 26 image from sparky0815's site. Unfortunately the performance is exactly the same: stutters between tracks for all file types. So there must be something else going on in my set-up that's causing this...

Power supply seems unlikely, as I'm now using a 4A supply, and that solved all the keyboard/wifi/instability problems I was originally having running the Debian image from a 1A phone charger. SD card too slow, maybe? It's a class 2 card (i.e. the slowest; but surely fast enough for music streaming? Depends on how the buffer refill code is written, I suppose). What speed card are you using, trondis23?

In the meantime, anyone else have any success or failure stories getting gapless, in OpenELEC or any other distribution or application, on a Pi or on Linux in general? (I'm still looking in general for a Linux solution that doesn't involve WINE!)

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: Gapless playback

Wed Aug 15, 2012 4:28 pm

I don't think track prefetch and mix-down have been written and so done if this is the case.
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Wed Aug 15, 2012 10:34 pm

Not sure I entirely understand that. I didn't know anything needed to be written, code-wise: I thought it was just a question of compiling the existing codebase to run on the Pi. But then I don't know much about OpenELEC. In any case, trondis23 says it already does work for him. Confused.

trondis23
Posts: 42
Joined: Mon May 21, 2012 11:55 am

Re: Gapless playback

Thu Aug 16, 2012 10:28 am

It works for me without any changes in the default settings. My only problem with it is that the database won't include mp3 or ogg files. Ogg even crashes the system. But it is the same with all distributions: raspbmc, xbian, openelec, Raspian with XBMC. So that probably have another reason. Maybe my NAS

I am using a samba server, by the way. It is a Patriot Gearbox - a very small , cheap and underpowered NAS adapter that doesn't really work well for anything else. But for Rapsberry Pi with this OpenElec version I have no problems except the above mentioned. (Mp3 does play, I just have to select from files instead of the database.)

Alan Thew
Posts: 32
Joined: Tue Mar 13, 2012 1:46 pm

Re: Gapless playback

Fri Aug 17, 2012 2:48 pm

I'm stumped, then. If it works for you off a network share, I can't imagine why it's not working for me off the local SD card, unless it's an SD speed issue, as I suggested. I haven't been able to dig out a faster SD card; mine are all old as I don't really use them much. Thanks again!

jcsbanks
Posts: 6
Joined: Sun Dec 02, 2012 11:05 pm

Re: Gapless playback

Tue Dec 04, 2012 10:10 pm

Late reply to this. Thanks trondis23, that Jun 23 build does gapless playback on my Raspberry Pi and makes it much nicer to listen to, later builds including from yesterday rush the first 5 seconds on the counter and cut off a second or two and are not gapless.

javaboyuk
Posts: 18
Joined: Mon Mar 05, 2012 7:07 pm

Re: Gapless playback

Sun Mar 03, 2013 12:28 am

guys, I have just started researching this....

OK, so where can I get the gapless playing version of openelec as the site only goes back to 26 June 2012 now :-( and I do soooo want gapless, live albums ar so messed up with out it!

As a matter of interest as well, can some one tell me which build of xbmc it has on it?
Maybe if I can't get a build I might be able to get the version of xbmc...


many thanks

trondis23
Posts: 42
Joined: Mon May 21, 2012 11:55 am

Re: Gapless playback

Tue Mar 05, 2013 12:05 pm

It seems like those images has been removed now. I downloaded them again just a few weeks ago, to have them in case of SD card corruption. The build is dated June 23. I installed a newer version of OpenElec and "downgraded" to June 23 afterwards. But there is now one new problem with this setup: If you use a phone to control it, you must have an older version of the official XBMC app. The library has changed, and the newer apps don't support the libraries of pre Frodo builds. Personally I have backed up my old XBMC app, so I can reinstall it if I get a new phone.

Recently I have started to use another program for music: Squeezeplug. The first time I tried it it wasn't gapless, and had other problems as well. But the most recent version, if you use the Squeezelite player, is gapless. I am controlling it from my Android phone. I didn't realise how good it was until I tried the right Android app: Squeeze Commander. This combo works perfectly. In addition to playing back your local files, you will also get internet radio, plus access to plugins like Spotify, Wimp etc. I am now using Wimp. If you have a Wimp account there is nothing more to install on the Pi. Squeeze Commander takes care of everything. The desktop or Android versions of Wimp doesn't support gapless playback. But with Squeezeplug/Squeezelite it is gapless. Another bonus is that my NAS reacts much faster when I access it from Squeezeplug rather than XBMC.

hickup
Posts: 2
Joined: Wed May 08, 2013 8:26 am

Re: Gapless playback

Wed May 08, 2013 10:23 am

Recently I have started to use another program for music: Squeezeplug. The first time I tried it it wasn't gapless, and had other problems as well. But the most recent version, if you use the Squeezelite player, is gapless. I am controlling it from my Android phone. I didn't realise how good it was until I tried the right Android app: Squeeze Commander. This combo works perfectly. In addition to playing back your local files, you will also get internet radio, plus access to plugins like Spotify, Wimp etc. I am now using Wimp. If you have a Wimp account there is nothing more to install on the Pi. Squeeze Commander takes care of everything. The desktop or Android versions of Wimp doesn't support gapless playback. But with Squeezeplug/Squeezelite it is gapless. Another bonus is that my NAS reacts much faster when I access it from Squeezeplug rather than XBMC.
@Trondis23
Would you please tell me your detailed setup?
Because I'm looking for a wife-likes-and-can-handle-it solution for gapless audio listening.
Including smartphone control and access to my music library (including search, playlist functionalities) and the there should be no need to tun on the TV.

Sound like you've managed it...

I've tried several DLNA/UPnP servers sending music to my WDTV live, but the music was far away from being gapless. WDTV fetching music directly from network shares ended in the same result.
Guess it's a client realted issue.

I'm fed up with being forced to have my laptop connected to my mixer to listen to music via Mediamonkey and a third party app to control it with my smartphone.

My Idea would be to have an USB HDD connected to a RPi, and use it with a local media server and renderer to achieve gapless audio. Or am I wrong? That's why I ask you to kindly provide me some information.

Thanks
Hicks.

trondis23
Posts: 42
Joined: Mon May 21, 2012 11:55 am

Re: Gapless playback

Thu May 09, 2013 7:07 pm

You will find Squeezeplug and a tutorial on how to set it up on http://squeezeplug.de/. Just follow that tutorial, and choose Squeezelite as your player. It is quite straight forward.

You will find Squeeze Commander on the Android Market.

You set up your library through a web browser with the address http://squeezeplug:9000/. Then you go to www.mysqueezebox.com where you set up your account. There you can also add other services, like radio and streaming services like Wimp or Deezer. Spotify is also available, but then you need to install a plugin in Squeezeplug. The other services here work just by activating them in Mysqueezebox. You need of course to be a registered user of paid streaming services. I use Wimp.

In the Android app you must log in to your account on MySqueezebox. Then you are connected to Squeezeplug and are ready to play.

I have connected the Pi to my receiver via HDMI. Since my receiver doesn't have HDMI in, I bought a cheap HDMI to VGA converter from DealExtreme. This has, in addition to VGA out, also SPDIF and analogue sound outputs. I use the SPDIF, and get excellent HF-FI sound.

hickup
Posts: 2
Joined: Wed May 08, 2013 8:26 am

Re: Gapless playback

Sun May 12, 2013 6:54 pm

Thanks a lot for your effort, trondis.
Very kind of you to help a bloody beginner like me ;)

My RPi is about to arrive Tuesday, so I will dive into your suggestions then.
I am really curious if I'll get everything working, will post here if I succeeded or not.

Have a nice rest-weekend,
best regards
Hicks.

javaboyuk
Posts: 18
Joined: Mon Mar 05, 2012 7:07 pm

Re: Gapless playback

Sun Sep 08, 2013 5:40 pm

I have been successfull with XMBC from OpenElec 3.1.6, by adding

"force_hdmi_open=1" to config.txt.

Return to “Graphics, sound and multimedia”