PDA

View Full Version : Synchronization



prvtpyle
2006-01-07, 14:19
Just got the Squeezebox yesterday. Main reason I got it was the "synchronization" feature that the sales guy assured me that it had. Well, as I have now learned the hard way (after reading this forum for a few hours and trying various things) the synch doesn't work as advertised. My softsqueeze player is consistently ~1 sec behind my squeezebox.

Before I give up on it completely, wanted to make a post of my own to see if someone could provide a checklist of steps to try to synch the squeezebox and softsqueeze. As of now, I have already:
1) installed the most recent Java and (1.5.0_06) and softsqueeze version (2.2)
2) Set audio to Primary Sound Driver
3) Installed Java MP3 plugin
4) Verified that the wireless connection is good (also connected it via ethernet cable and still have ~1 sec delay with squeezebox first)
5) Tried different music sources (iTunes, no iTunes, radio) and all had same delay.

Any ideas? I have seen many synch posts in here, but no comprehensive set of steps to try to resolve.

Thanks!

Pyle

Dan Sully
2006-01-07, 14:30
* prvtpyle shaped the electrons to say...

>Just got the Squeezebox yesterday. Main reason I got it was the
>"synchronization" feature that the sales guy assured me that it had.
>Well, as I have now learned the hard way (after reading this forum for
>a few hours and trying various things) the synch doesn't work as
>advertised. My softsqueeze player is consistently ~1 sec behind my
>squeezebox.

Synchronization works between hardware players. It will not always work with
SoftSqueeze because of the Java Sound buffer. I will speak with our sales
guys to make sure they understand the difference.

-D
--
<weezyl> $6.66: The Value Meal of the Beast.

rtitmuss
2006-01-07, 14:40
prvtpyle wrote:

>Before I give up on it completely, wanted to make a post of my own to
>see if someone could provide a checklist of steps to try to synch the
>squeezebox and softsqueeze. As of now, I have already:
>1) installed the most recent Java and (1.5.0_06) and softsqueeze
>version (2.2)
>
>
Try an older version of Softsqueeze from Sourceforge
(http://softsqueeze.sourceforge.net). Sync does not work in the latest
version, hopefully I should find some time to look at this over the next
couple of weeks. For some people sync with Softsqueeze apparently does
not work, others including myself have some success (it's still not 100%
solid).

>2) Set audio to Primary Sound Driver
>
>
To get sync working this is a must, otherwise the audio buffering in
Java introduces approx .5 second delay.

You'll find sync between hardware players works well, and I have spent
many hours getting Softsqueeze sync to work as well as possible. Once I
have fixed the current bug, if you find it still does not work I would
be happy to work with you to help debug this one ...

Richard

prvtpyle
2006-01-07, 14:48
Um, OK. That doesn't help me too much now though. Any ideas on massaging the settings to get the synch to work with the software? Is there a way to set an automatic delay in the hardware/software to manually fix the delay?

prvtpyle
2006-01-07, 14:58
Thanks Richard, I will give this a try and let you know how it works...

rtitmuss
2006-01-07, 16:40
Just to keep you updated I have had a first looked at getting sync to work again tonight. Found a couple of timing/buffer bugs that can mess things up. I have a rough fix for both of them, and am now listening to my four well sync'd track :). I need to refine the fixes a little more before releasing a new version, but this should be within the next few days.

Richard

PS I read the forum through a filtered mailing list, so please include Softsqueeze in your reply's or I might not get them. Thanks.

prvtpyle
2006-01-07, 19:04
It worked!

I downloaded the 2.0 beta version of softsqueeze and everything is all synched now. The whole house is blasting Radiohead at me.

This thing is so sweet...

kweller
2006-01-08, 04:52
In article <rtitmuss.21aglb (AT) no-mx (DOT) forums.slimdevices.com>, Rtitmuss
wrote:
> up. I have a rough fix for both of them, and am now listening to
> my four well sync'd track :). I need to refine the fixes a little more
> before releasing a new version

I think you've got it Richard :)

I have never got synchronisation to work well at all - it always got out
of sync within 5 or 6 tracks. I've been playing a Squeezebox 2 sync'd
with Softsqueeze for the last couple of hours and it's coped with
everything I've thrown at it to try to break it.

Nice work, thank you.

Kevin

Dave2
2006-01-08, 12:12
Has there been any progress on a possibly related issue of gapless playback?: http://forums.slimdevices.com/showthread.php?t=19130&highlight=gapless

"Softsqueeze 2.2 does not give me gapless flac
playback . . . . (An earlier version worked fine.
My SB2 is also fine.) Some other users have
reported the same problem here and on Softsqueeze's
own forum, http://sourceforge.net/forum/forum.php?forum_id=362090.

Thanks.

rtitmuss
2006-01-08, 15:47
I have released a new version of Softsqueeze 2.3. This will be in the 6.2 nightlies or you can download it from Sourceforge (http://softsqueeze.sourceforge.net). Later in the week I'll release a new version on the trunk.

This fixes (for me anyway!) sync. I've been listening with out problem for nearly a couple of hours now. Gapless flac playback should also working again, but I have not tested this (please let me know).


Several times people have asked how the buffering / sync works, so if you interested in what the problems were please read on.

Three audio buffers are used in Softsqueeze; the decoder buffer holds encoded audio (mp3, flac, etc), the output buffer holds pcm samples, finally the small javasound buffer holds the samples written by Softsqueeze to the audio device. When two or more players are sync'd then the slimserver starts streaming the encoded audio but leaves all the players paused. The players send status information back to the slimserver reporting how fully the audio buffers are, when all players have enough data in the decoder buffer then the unpause command is send to all payers.

The first problem was a recently introduced typo that caused a block of silence to be written into the output buffer when a new track started to be decoded in Softsqueeze. This also broke gapless flac playback. Doh!

The Squeezebox decodes audio a few bytes at a time so it does not take long for the decoded pcm samples to play out of your speakers following the unpause command. In Java the most efficient to stream audio is to decode blocks of audio data, Softsqueeze uses a block size of 128000 bytes. It takes too long to decode a full audio block and start playback compared to the process in a hardware player. So Softsqueeze cheats, it starts decoding while the player is paused to reduce the latency when playback starts.

The second problem was that sometimes the decoder buffer had reached the playback threshold and the unpause command sent but the first block of audio had not yet been decoded. This made Softsqueeze play behind the Squeezebox. To fix this Softsqueeze now sends zero buffer fullness until some samples have been decoded to the output buffer, causing all players to wait until Softsqueeze is ready to start playback.

The opposite problem also exists, if the hardware player is slow to buffer (say working wirelessly) then Softsqueeze might have decoded lots of pcm samples. I then found that the first write to the javasound buffer could take too long, again causing lack of sync.

Now to help smoothly start playback both the decoder and output buffers are filled using an exponentially increasing block size, starting with 4096 bytes until the maximum block size is reached. This helps control the playback latency, but this approach does increase the risk of an audio buffer underrun at the start of a track. Only with wider testing can we be sure the balance here is correct.

I hope this now works for everyone!!

Richard

DABurleigh
2006-01-09, 00:18
Richard,

Last night tried both 2.2 downloaded with Slimserver over Christmas, and then latest 2.3, but my wireless SB3 is still significantly (0.5 to 1 sec?) BEHIND Softsqueeze on Windows XP Pro. If I could have a Softsqueeze delay knob ..... :-)

Dave

gorstk
2006-01-09, 01:57
rtitmuss wrote:
> I have released a new version of Softsqueeze 2.3. This will be in the
> 6.2 nightlies or you can download it from Sourceforge
> (http://softsqueeze.sourceforge.net). Later in the week I'll release a
> new version on the trunk.
>
> This fixes (for me anyway!) sync. I've been listening with out problem
> for nearly a couple of hours now. Gapless flac playback should also
> working again, but I have not tested this (please let me know).
>
>
> Several times people have asked how the buffering / sync works, so if
> you interested in what the problems were please read on.
>
> Three audio buffers are used in Softsqueeze; the decoder buffer holds
> encoded audio (mp3, flac, etc), the output buffer holds pcm samples,
> finally the small javasound buffer holds the samples written by
> Softsqueeze to the audio device. When two or more players are sync'd
> then the slimserver starts streaming the encoded audio but leaves all
> the players paused. The players send status information back to the
> slimserver reporting how fully the audio buffers are, when all players
> have enough data in the decoder buffer then the unpause command is send
> to all payers.
>
> The first problem was a recently introduced typo that caused a block of
> silence to be written into the output buffer when a new track started to
> be decoded in Softsqueeze. This also broke gapless flac playback. Doh!
>
> The Squeezebox decodes audio a few bytes at a time so it does not take
> long for the decoded pcm samples to play out of your speakers following
> the unpause command. In Java the most efficient to stream audio is to
> decode blocks of audio data, Softsqueeze uses a block size of 128000
> bytes. It takes too long to decode a full audio block and start
> playback compared to the process in a hardware player. So Softsqueeze
> cheats, it starts decoding while the player is paused to reduce the
> latency when playback starts.
>
> The second problem was that sometimes the decoder buffer had reached
> the playback threshold and the unpause command sent but the first block
> of audio had not yet been decoded. This made Softsqueeze play behind the
> Squeezebox. To fix this Softsqueeze now sends zero buffer fullness until
> some samples have been decoded to the output buffer, causing all players
> to wait until Softsqueeze is ready to start playback.
>
> The opposite problem also exists, if the hardware player is slow to
> buffer (say working wirelessly) then Softsqueeze might have decoded
> lots of pcm samples. I then found that the first write to the javasound
> buffer could take too long, again causing lack of sync.
>
> Now to help smoothly start playback both the decoder and output buffers
> are filled using an exponentially increasing block size, starting with
> 4096 bytes until the maximum block size is reached. This helps control
> the playback latency, but this approach does increase the risk of an
> audio buffer underrun at the start of a track. Only with wider testing
> can we be sure the balance here is correct.
>
> I hope this now works for everyone!!

Works great with Windows XP!

Am I right in thinking it is not possible to get accurate syncing with
linux?

Cheers

mherger
2006-01-09, 02:05
> Am I right in thinking it is not possible to get accurate syncing with
> linux?

Did you test it?

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

gorstk
2006-01-09, 02:11
Michael Herger wrote:
>> Am I right in thinking it is not possible to get accurate syncing with
>> linux?
>
>
> Did you test it?

Yep. Softsqueeze(linux) ran around 0.75 seconds behind my squeezebox1.
However this was with the output of my soundcard routed via an FM
modulator to my FM radio in the room next to where my squeezebox is. I
am not sure how much latency sending/recieving over FM adds to the process.

I note in audiomixer options in the linux version the only option is
'java sound audio engine' - I seem to remember this is /bad/ for syncing
but I cant remember how to enable the other options.

I think I will have to try moving the squeezebox up to the same room
were my linux box is.

mherger
2006-01-09, 02:21
> I note in audiomixer options in the linux version the only option is
> 'java sound audio engine' - I seem to remember this is /bad/ for syncing
> but I cant remember how to enable the other options.

Install the mp3 java plugin. This considerably reduced cpu load on my
machine and might improve delays as well. You'll find a link in the
softsqueeze's audio settings page.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

M3Rocket
2006-01-09, 03:22
Gapless flac playback should also working again, but I have not tested this (please let me know).

Confirmed--gapless FLAC playback is fixed on my systems (all XP) with 2.3! And to think my message on Sourceforge forum was ignored... :) Thanx Richard!

kweller
2006-01-09, 13:15
> I hope this now works for everyone!!

I hate to be a party-pooper but it doesn't seem to be working for me I'm afraid.

Synchronisation on softsqueeze_windows_2_0b11.exe was rock solid but, having put 2.3 on this evening, it drifts off quite quickly.

Kevin

gorstk
2006-01-09, 15:39
Michael Herger wrote:
>> I note in audiomixer options in the linux version the only option is
>> 'java sound audio engine' - I seem to remember this is /bad/ for syncing
>> but I cant remember how to enable the other options.
>
>
> Install the mp3 java plugin. This considerably reduced cpu load on my
> machine and might improve delays as well. You'll find a link in the
> softsqueeze's audio settings page.
>

I am streaming flac/wav so this should not come into the equation.

kweller
2006-01-10, 03:53
> I hope this now works for everyone!!

I hate to be a party-pooper but it doesn't seem to be working for me I'm afraid.

I wonder whether it's something I've done although I can't imagine what! I reinstalled the 2.0b11 version of SoftSqueeze but still have the problem. I realise now that both SoftSqueeze and SqueezeBox *are* actually synchronised, the problem is that the SqueezeBox is slightly in front of SoftSqueeze.

Kevin

wei
2006-01-10, 17:30
I am not sure if synchronizing Internet Radio playback between SoftSqueeze and Squeezebox is a common practice. I started with SoftSqueeze 2.2 and there is a constant and predictable gap.

After reading the first few posts of this thread, I tried 2.0beta. It worked great for 30 minutes and then started drifting more and more. After 2.3 released, it seems to behave similar to 2.0beta: the drift starts after about 30 minutes and the gap gets more noticable over time.

The way to get around it, I found so far, is to power off SoftSqueeze and on again. I wonder whether SoftSqueeze or the Slim protocol itself support resynchronization at a regular interval. That would probably help mitigate drifting.

stinkingpig
2006-01-12, 10:39
>
> I am not sure if synchronizing Internet Radio playback between
> SoftSqueeze and Squeezebox is a common practice. I started with
> SoftSqueeze 2.2 and there is a constant and predictable gap.
>
> After reading the first few posts of this thread, I tried 2.0beta. It
> worked great for 30 minutes and then started drifting more and more.
> After 2.3 released, it seems to behave similar to 2.0beta: the drift
> starts after about 30 minutes and the gap gets more noticable over
> time.
>
> The way to get around it, I found so far, is to power off SoftSqueeze
> and on again. I wonder whether SoftSqueeze or the Slim protocol itself
> support resynchronization at a regular interval. That would probably
> help mitigate drifting.
>
>

Not at this time. Currently the synchronization is done at the beginning
of tracks. The developers are aware and considering the problem.


--
Jack Coates At Monkeynoodle Dot Org: It's A Scientific Venture!
"I spent all me tin with the ladies drinking gin, so across the Western
ocean I must wander" - traditional

joek
2006-01-13, 12:36
The Grateful Dead has some long tracks which means things will start to drift. As far as I can tell SouthBridge sync is broken - according to their forums. Not sure how Sonic implements sync. I would believe synchronization is very difficult to achieve.