Play Song in 2 Audio Sink Cannot Synchronous

asked 2014-07-16 18:46:50 -0700

Yossi Setiawan gravatar image

updated 2014-07-16 18:56:11 -0700

Dear All,

I tried play song the audio sink in 2 device. but sometimes they play the song out of sync, one device to play songs faster than others. any suggestion to solve this problem?

Thanks, -Yossi Setiawan-

edit retag flag offensive close merge delete


What platform is this?

msanu ( 2014-07-17 08:55:44 -0700 )edit

i use android platform. i use 3 device : 1device for android source and 2device for AudioSink. sometimes one device to play songs faster than others. Thanks

Yossi Setiawan ( 2014-07-18 02:54:47 -0700 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-19 17:53:21 -0700

bspencer gravatar image

The issue is in the Audio library for AndroidDevice.cc in the GetDelay method. It is set to 120000 right now and it would need to be enhanced to be aware of the actual time difference on the handset that it takes from when the write command is made to OpenSL audio engine.

The AllJoyn Audio Service is intended to be an alright form of synchronization. One thing you will find is when you use the Service for long term audio playback there will be drift and cause the devices to become out of sync.

edit flag offensive delete publish link more


hi, bspencer, i try change value of GetDelay method. From 120000 to 10000 and the result 2 device audio sink can synchronization. i still confused about GetDelay method, what the function of this method? Thanks :) Regards, Yossi Setiawan

Yossi Setiawan ( 2014-07-22 02:00:19 -0700 )edit

@yossi-setiawan The nature of the GetDelay method is to ask the Audio Driver how long it takes to play the audio once it receives the bytes. The OpenSL audio engine does not have the ability to get this value, so it was set to a value based on a few devices. For Linux alsa has an API that is used for to get the delay. Different platforms may have different delay values.

bspencer ( 2014-07-24 13:56:50 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-07-16 18:46:50 -0700

Seen: 122 times

Last updated: Jul 22 '14