Cast FLAC files not working only with Symfonium

Issue description:

Hi,

If I try to cast a FLAC 16bit file to a GoogleTV box (with Android 11) never works. With MP3 it’s fine.
This happens with tracks on my smartphone and on Jellyfin.

If i uninstall the Chromecast updates from the Mi Box S 2nd gen, it works but with the latest update (version 3.72.425634 from 19th July 2024) it always crashes if I try to play (only) FLAC files.

I also tried with the apps from Plex, Plexamp, Jellyfin, Emby, Synology DS Audio, and PowerAmp (local); always the exact same file/song to see if it was an issue with Chromecast built-in but all worked perfectly fine.

Thanks

Logs:

Upload description: • Kurt

Additional information:

 

 

Reproduction steps:

 
Press the Cast option and then start playing an MP3 file. All good. Then, I change to the next track, which is a FLAC file, the Cast crashes.
It happens also if I start with a FLAC file.
 

Media provider:

Local device

Screenshots:

     

The fact that uninstalling Google updates fix this is quite an indicator from where the issue is no ?

See Cast is not working for some songs on Google chromecast with Google TV 4k

Provide logcat from that device to see if it’s the same crash (It will be).

This is something that needs to be reported to Google so they fix, I’m using their most recent code on both sides, and without a broken device to reproduce to eventually try to workaround this Google bug (Yes I know OMG the others don’t crash so it’s Symfonium).

I gave the “example” of the other apps not to point the finger at you and your app but because I thought it was important to try out other apps and to let you know.

But yes, if all the others 6 apps don’t have any issue casting FLAC files, it seems that is something with your app. Which is not a criticising because sh*t can happens with any app!

As said provide the logcat from the mi so I can see the actual error.

There’s also newer version of Chromecast to test https://www.apkmirror.com/apk/google-inc/chromecast-built-in/chromecast-built-in-3-72-425634-release/chromecast-built-in-android-tv-3-72-425634-2-android-apk-download/ (and of course a hundred different versions to test when they broke this to report to them)

And I know it’s hard to understand but in this case this is not the app, The Chromecast crash.

Chromecast expose an API, Symfonium calls the API, Chromecast crash. An non broken Chromecast would return an error if there was a wrong API call not crash.
And since those API calls works fine on nearly all devices for all the other users tends to show that the API calls are correct.

The fact that other apps probably use deprecates Google code that maybe avoid the issue does not change how things works.

And you actually have a workaround with the older Chromecast version. Since with works better use it ?

Don’t know if it’s bad form to necro a year old thread, but I ran into this issue too while playing certain FLAC files (other FLACs were working fine), and I can provide the section of the logcat when I noticed the crash. Notably there is an error about the sampling rate (384 KHz) coming from the AudioTrack class.

Logcat
2025-10-25 22:19:40.316 23794-23794 MediaControlChannel     app.symfonik.music.player            W  received unexpected error: Invalid Request.
2025-10-25 22:19:47.606 23794-23794 SessionManagerImpl      app.symfonik.music.player            I  Select default route from route with the selected route ID: 5527067c-bc3e-4493-a031-885a3ca5a60a-groupRoute
2025-10-25 22:19:47.607 23794-23794 AxMediaRouter           app.symfonik.music.player            W  Changing selection(Living Room TV Box(BT=false, syncMediaRoute1Provider=true)) to default while BT is available: pkgName=app.symfonik.music.player- Stacktrace: [o7.e.k:223, o7.f0.h:9, com.google.android.gms.internal.cast.v.a:258, bv.i.onTransact:104, android.os.Binder.transact:1293, m4.rg.c:8, m4.uf.l:6, m4.tw.s:77, m4.tt.i:377, m4.te.A:81, m4.rh.onTransact:21, android.os.Binder.transact:1293, bv.a.J:41, fu.v.T:10, fu.f.b:8, bi.u.c:37, eu.y.run:92, android.os.Handler.handleCallback:1041, android.os.Handler.dispatchMessage:103, android.os.Looper.dispatchMessage:315, android.os.Looper.loopOnce:251, android.os.Looper.loop:349, android.app.ActivityThread.main:9041, java.lang.reflect.Method.invoke:-2, com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run:593, com.android.internal.os.ZygoteInit.main:929]
2025-10-25 22:19:47.609 23794-23794 MediaRouterCallback     app.symfonik.music.player            I  onRouteUnselected with reason = 3, routeId = 5527067c-bc3e-4493-a031-885a3ca5a60a-groupRoute
2025-10-25 22:19:47.609 23794-23794 MRCallbackImpl          app.symfonik.music.player            I  the route (5527067c-bc3e-4493-a031-885a3ca5a60a-groupRoute) is unselected with the reason: 3
2025-10-25 22:19:47.609 23794-23794 MediaRouterCallback     app.symfonik.music.player            I  onRouteUnselected with reason = 3, routeId = 5527067c-bc3e-4493-a031-885a3ca5a60a-groupRoute
2025-10-25 22:19:47.609 23794-23794 MediaRouter             app.symfonik.music.player            V  Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2025-10-25 22:19:47.610 23794-23794 MediaRouter             app.symfonik.music.player            I  Skip setBluetoothA2dpOn(): types=8388611, isPlaybackActive()=false, BT route=RouteInfo{ name=Chevrolet MyLink, description=Bluetooth audio, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO , presentationDisplay=null }
2025-10-25 22:19:47.611 23794-23794 AxMediaRouter           app.symfonik.music.player            W  Ignoring attempt to select selected route: MediaRouter.RouteInfo{ uniqueId=DEFAULT_ROUTE, name=Phone, description=null, iconUri=null, enabled=true, isSystemRoute=true, connectionState=0, canDisconnect=false, playbackType=0, playbackStream=3, deviceType=0, volumeHandling=1, volume=11, volumeMax=25, presentationDisplayId=-1, extras=null, settingsIntent=null, providerPackageName=android }
2025-10-25 22:19:47.611 23794-23794 MediaRouterCallback     app.symfonik.music.player            I  ignore onRouteSelected for non-remote selected routeId: DEFAULT_ROUTE
2025-10-25 22:19:47.611 23794-23794 MediaRouterCallback     app.symfonik.music.player            I  ignore onRouteSelected for non-remote selected routeId: DEFAULT_ROUTE
2025-10-25 22:19:47.624 23794-23794 MR2                     app.symfonik.music.player            W  releaseControllerOnHandler: Matching controller not found. uniqueSessionId=com.google.android.gms/.cast.media.CastMediaRoute2ProviderService_Persistent:757c26b4-2b58-431a-a7b2-01106edf3a42
2025-10-25 22:19:47.644 23794-23819 android.me...AudioTrack app.symfonik.music.player            E  getMinBufferSize(): 384000 Hz is not a supported sample rate.
2025-10-25 22:19:47.644 23794-23819 android.me...AudioTrack app.symfonik.music.player            E  getMinBufferSize(): 352800 Hz is not a supported sample rate.
2025-10-25 22:19:47.794 23794-4115  VolumeShaper            app.symfonik.music.player            D  setting id to 17

Completely unrelated and irrelevant.