@ratty So if i understand the sonos ray will not solve the lip sync issue since the optical cable come from the tv line-in.
TV audio -- via a Ray/Beam/Arc/Amp -- is different from a general purpose Line-In.
As hinted above, a Line-In needs a 75ms (minimum) buffering delay, because the audio packets have to transit a general-purpose, shared local network. As such the packets can sometimes get delayed by other network usage.
TV audio on the other hand is handled locally, either within the Sonos unit connected to the TV or over a dedicated (not shared) 5GHz link to the surrounds/Sub. As such the delays are much more tightly controllable, so the lip-sync will be close enough not to matter.
Note however that if TV audio is sent to another, grouped, room then the Line-In buffering issues arise again, but only for those other rooms. In other words the grouped room/s is/are slightly behind (i.e. out of sync with) the Ray/Beam/Arc/Amp.
The only solution should be hdmi arc connection with the sonos beam and sonos arc then?
No, because all the home theatre units behave the same: Ray/Beam/Arc/Amp. It doesn’t matter how the audio gets to them. Delays are network-related, not as a result of the incoming audio format.
EDIT: @jgatie typed faster, but since I’d composed it here it is.