google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.72k stars 6.03k forks source link

Exoplayer Audio only supports on Android WearOS #10071

Closed weicui1 closed 2 years ago

weicui1 commented 2 years ago

I tried playing downloaded item on a Samsung WearOS device.

The code worked well on phone. While on WearOs, I got such error logs:

03-14 12:53:57.131 6372 7084 D CCodec : allocate(c2.android.aac.decoder) 03-14 12:53:57.136 6372 7084 I Codec2Client: Available Codec2 services: "default" "software" 03-14 12:53:57.139 6372 7084 I CCodec : setting up 'default' as default (vendor) store 03-14 12:53:57.145 532 603 V C2Store : in init 03-14 12:53:57.145 532 603 V C2Store : loading dll 03-14 12:53:57.153 6372 7084 I CCodec : Created component [c2.android.aac.decoder] 03-14 12:53:57.154 6372 7084 D CCodecConfig: read media type: audio/mp4a-latm 03-14 12:53:57.158 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values 03-14 12:53:57.159 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values 03-14 12:53:57.160 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values 03-14 12:53:57.160 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values 03-14 12:53:57.160 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values 03-14 12:53:57.161 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values 03-14 12:53:57.161 6372 7084 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values 03-14 12:53:57.170 6372 7084 I CCodecConfig: query failed after returning 19 values (BAD_INDEX) 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2 config diff is Dict { 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 coded.aac-packaging.value = 0 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 coded.bitrate.value = 64000 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 coded.pl.level = 0 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 coded.pl.profile = 8192 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::i32 coding.drc.album-mode.value = 0 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::float coding.drc.attenuation-factor.value = 1 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::float coding.drc.boost-factor.value = 1 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::i32 coding.drc.compression-mode.value = 3 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::i32 coding.drc.effect-type.value = 3 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::float coding.drc.encoded-level.value = 0.25 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::float coding.drc.reference-level.value = -16 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 input.buffers.max-size.value = 8192 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 input.delay.value = 0 03-14 12:53:57.171 6372 7084 D CCodecConfig: string input.media-type.value = "audio/mp4a-latm" 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 output.delay.value = 2 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::float output.drc.output-loudness.value = 0.25 03-14 12:53:57.171 6372 7084 D CCodecConfig: string output.media-type.value = "audio/raw" 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 raw.channel-count.value = 1 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 raw.max-channel-count.value = 8 03-14 12:53:57.171 6372 7084 D CCodecConfig: c2::u32 raw.sample-rate.value = 44100 03-14 12:53:57.171 6372 7084 D CCodecConfig: } 03-14 12:53:57.174 6372 7084 D CCodec : [c2.android.aac.decoder] buffers are bound to CCodec for this session 03-14 12:53:57.175 6372 7084 D CCodecConfig: no c2 equivalents for flags 03-14 12:53:57.176 6372 7084 D CCodecConfig: c2 config diff is c2::u32 raw.channel-count.value = 2 03-14 12:53:57.176 6372 7084 D CCodecConfig: c2::u32 raw.sample-rate.value = 22050 03-14 12:53:57.179 6372 7084 W Codec2Client: query -- param skipped: index = 1107298332. 03-14 12:53:57.180 6372 7084 D CCodec : setup formats input: AMessage(what = 0x00000000) = { 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-album-mode = 0 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-boost-level = 127 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-cut-level = 127 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-effect-type = 3 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-heavy-compression = 3 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-encoded-target-level = -1 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-max-output-channel_count = 8 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-target-ref-level = 64 03-14 12:53:57.180 6372 7084 D CCodec : int32_t channel-count = 2 03-14 12:53:57.180 6372 7084 D CCodec : int32_t level = 0 03-14 12:53:57.180 6372 7084 D CCodec : int32_t max-input-size = 8192 03-14 12:53:57.180 6372 7084 D CCodec : string mime = "audio/mp4a-latm" 03-14 12:53:57.180 6372 7084 D CCodec : int32_t profile = 2 03-14 12:53:57.180 6372 7084 D CCodec : int32_t sample-rate = 22050 03-14 12:53:57.180 6372 7084 D CCodec : } and output: AMessage(what = 0x00000000) = { 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-album-mode = 0 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-boost-level = 127 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-cut-level = 127 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-effect-type = 3 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-heavy-compression = 3 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-drc-output-loudness = -1 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-encoded-target-level = -1 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-max-output-channel_count = 8 03-14 12:53:57.180 6372 7084 D CCodec : int32_t aac-target-ref-level = 64 ........

And the later decode also failed as: 03-14 12:53:57.219 532 7088 W C2SoftAacDec: aacDecoder_DecodeFrame decoderErr = 0x0005 03-14 12:53:57.219 532 7088 W C2SoftAacDec: AAC decoder returned error 0x0005, substituting silence 03-14 12:53:57.219 532 7088 D C2SoftAacDec: Invalid AAC stream 03-14 12:53:57.222 532 7088 W C2SoftAacDec: aacDecoder_DecodeFrame decoderErr = 0x0005 03-14 12:53:57.222 532 7088 W C2SoftAacDec: AAC decoder returned error 0x0005, substituting silence 03-14 12:53:57.222 532 7088 D C2SoftAacDec: Invalid AAC stream 03-14 12:53:57.226 532 7088 W C2SoftAacDec: aacDecoder_DecodeFrame decoderErr = 0x0005 03-14 12:53:57.226 532 7088 W C2SoftAacDec: AAC decoder returned error 0x0005, substituting silence 03-14 12:53:57.226 532 7088 D C2SoftAacDec: Invalid AAC stream

Any existing sample exoplayer app on WearOS?

weicui1 commented 2 years ago

Seemingly can't use MediaCodecSelector.DEFAULT directly for WearOs.

Anyone ever had experience on using Exoplayer on WearOS