In my device which is on Android N (7.1.2),Music Player (Play Music application) Volume suddenly goes down if "Google quick search bar APP" is Launched and Volume comes back to normal as soon as we minimizes the Google quick search bar application
tried to put and debug with logs in below files but didnt get the root cause
frameworks/base/media/java/android/media/AudioManager.java
frameworks/base/services/core/java/com/android/server/audio/AudioService.java
Any advise how the Music Volume Fades in and Fades out ?
Logs for Reference:
01-01 07:52:51.668 437-7351/? D/audio_hw_primary: copl(0xac8c46c0):out of compress_wait
01-01 07:52:51.668 437-7353/? D/audio_hw_primary: copl(0xac8c46c0): writing buffer (65536 bytes) to compress device
01-01 07:52:51.669 437-7353/? D/audio_hw_primary: copl(0xac8c46c0): writing buffer (65536 bytes) to compress device
01-01 07:52:51.672 437-7353/? D/audio_hw_primary: No space available in compress driver, post msg to cb thread
01-01 07:52:51.672 437-7351/? D/audio_hw_primary: copl(0xac8c46c0):calling compress_wait
01-01 07:52:53.839 971-1186/system_process I/Test_log: AudioService.java :handleMessage::msg:{ when=-1ms what=5 arg2=-1000 target=com.android.server.audio.AudioService$AudioHandler }
01-01 07:52:53.839 971-1186/system_process I/Test_log: AudioService.java :handleMessage::msg.what:5
01-01 07:52:53.839 971-1186/system_process I/Test_log: AudioService.java :handleMessage: onPlaySoundEffect:msg.arg1:0
01-01 07:52:53.839 971-1186/system_process I/Test_log: AudioService.java :handleMessage: onPlaySoundEffect:msg.arg2:-1000
01-01 07:52:53.839 971-1186/system_process I/Test_log: onPlaySoundEffect_11111
01-01 07:52:53.840 971-1186/system_process I/Test_log: AudioService.java : onPlaySoundEffect: stackdump
java.lang.Throwable: stack dump
at com.android.server.audio.AudioService$AudioHandler.onPlaySoundEffect(AudioService.java:4689)
at com.android.server.audio.AudioService$AudioHandler.handleMessage(AudioService.java:4811)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at com.android.server.audio.AudioService$AudioSystemThread.run(AudioService.java:4455)
--------- beginning of system
01-01 07:52:53.840 971-1409/system_process I/ActivityManager: START u0 {act=android.search.action.GLOBAL_SEARCH cat=[com.google.android.googlequicksearchbox.category.SEARCH_WIDGET] flg=0x10008000 cmp=com.google.android.googlequicksearchbox/com.google.android.apps.gsa.searchnow.SearchNowActivity bnds=[191,145][593,243] (has extras)} from uid 10035 on display 0
01-01 07:52:53.862 437-655/? D/audio_hw_primary: start_output_stream: enter: stream(0xac8c41c0)usecase(1: low-latency-playback) devices(0x2)
01-01 07:52:53.862 437-655/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: )
01-01 07:52:53.862 437-655/? D/hardware_info: hw_info_append_hw_type : device_name = speaker
01-01 07:52:53.862 437-655/? W/audio_hw_utils: audio_extn_utils_update_stream_app_type_cfg: App type could not be selected. Falling back to default
01-01 07:52:53.862 437-655/? I/audio_hw_primary: select_devices Selected apptype: 69936
01-01 07:52:53.863 437-655/? V/audio_hw_dolby: audio_extn_dolby_set_dmid Dolby device manufacturer id is:0
01-01 07:52:53.864 437-655/? V/audio_hw_dolby: audio_extn_dolby_set_license Setting DS1 License, key:0x0 dmid 0
01-01 07:52:53.864 437-655/? E/DAP_HAL: dap_hal_set_hw_info: dmid=0
key 00x
01-01 07:52:53.883 437-655/? E/audio_hw_dolby: audio_extn_dolby_set_license Could not set DS1 License. Status: -1
01-01 07:52:53.883 437-655/? E/audio_hw_dolby: audio_extn_dolby_ds2_set_endpoint: Dolby set endpint :0x2
01-01 07:52:53.883 437-655/? D/soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_id 1 of type 0 for Event 3, with Raise=0
01-01 07:52:53.883 437-655/? D/ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 14, path = 0
01-01 07:52:53.883 437-655/? D/ACDB-LOADER: ACDB -> send_asm_topology
01-01 07:52:53.883 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-01 07:52:53.883 437-655/? D/ACDB-LOADER: ACDB -> send_adm_topology
01-01 07:52:53.883 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> send_audtable
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE_SIZE
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> send_audvoltable
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_STEP_TABLE
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_VOL_CAL
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> send_afe_cal
01-01 07:52:53.884 437-655/? D/ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_COMMON_TABLE
01-01 07:52:53.885 437-655/? D/ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL
01-01 07:52:53.885 437-655/? D/ACDB-LOADER: ACDB -> send_hw_delay : acdb_id = 14 path = 0
01-01 07:52:53.885 437-655/? D/ACDB-LOADER: ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
01-01 07:52:53.885 437-655/? I/audio_hw_utils: audio_extn_utils_send_app_type_cfg: PLAYBACK app_type 69936, acdb_dev_id 14, sample_rate 48000
01-01 07:52:53.886 437-655/? D/audio_hw_primary: enable_audio_route: apply mixer and update path: low-latency-playback
01-01 07:52:53.887 437-655/? D/audio_hw_primary: select_devices: done
01-01 07:52:53.892 971-1409/system_process I/ActivityManager: Killing 6348:com.android.musicfx/u0a24 (adj 906): empty for 3043s
01-01 07:52:53.900 437-655/? D/msm8916_platform: platform_set_channel_map mixer_ctl_name:Playback Channel Map12
01-01 07:52:53.900 437-655/? D/msm8916_platform: platform_set_channel_map: set mapping(1 2 3 0 0 0 0 0) for channel:2
01-01 07:52:53.900 437-655/? D/audio_hw_primary: start_output_stream: exit
01-01 07:52:53.901 971-1409/system_process D/ActivityTrigger: ActivityTrigger activityPauseTrigger
01-01 07:52:53.923 2096-2096/com.google.android.googlequicksearchbox:search E/LegacyNowServiceClient: skipping logEndstates, service is null
01-01 07:52:53.964 371-371/? W/SurfaceFlinger: couldn't log to binary event log: overflow.
01-01 07:52:53.994 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#15c0524
01-01 07:52:53.995 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#b97588d
01-01 07:52:53.995 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#679da42
01-01 07:52:53.995 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#36e3a53
01-01 07:52:54.000 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#9adf089
01-01 07:52:54.000 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#14f588e
01-01 07:52:54.033 971-1576/system_process D/ActivityManager: cleanUpApplicationRecord -- 6348
01-01 07:52:54.039 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#84a5e43
01-01 07:52:54.039 2096-2096/com.google.android.googlequicksearchbox:search V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance#b34bcc0
01-01 07:52:54.174 971-1029/system_process I/ActivityManager: Displayed com.google.android.googlequicksearchbox/com.google.android.apps.gsa.searchnow.SearchNowActivity: +247ms
01-01 07:52:54.183 5385-5466/com.android.launcher3 D/OpenGLRenderer: endAllActiveAnimators on 0x898dc380 (RippleDrawable) with handle 0x93e15e20
01-01 07:52:54.190 437-7353/? D/audio_hw_primary: out_set_parameters: enter: usecase(3: compress-offload-playback) kvpairs: routing=2
01-01 07:52:54.245 1217-1217/com.google.android.inputmethod.latin W/InputMethodService: Window size has been changed. This may cause jankiness of resizing window: -1 -> -2
When you play audio on an Android device the application has to request audio focus. The operating system has different ways of dealing with a conflict in audio focus, it either performs audio ducking, stops the audio briefly, or completely hands over control to another application that requests focus:
From Managing audio focus Android documentation:
Two or more Android apps can play audio to the same output stream
simultaneously. The system mixes everything together. While this is
technically impressive, it can be very aggravating to a user. To avoid
every music app playing at the same time, Android introduces the idea
of audio focus. Only one app can hold audio focus at a time.
TL;DR: It sounds to me like the Google Search bar is requesting audio focus, perhaps for voice control, and the OS is ducking your application audio briefly during this action - after which audio focus is handed back to your application.
See Managing audio focus for more detail.
I'm using this code snippet to activate voice command on android.
Intent newIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().sendBroadcast(newIntent);
it doesn't do anything, not even an error in my log cat:
06-03 13:26:24.325 203-822/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
06-03 13:26:24.335 203-822/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
06-03 13:26:24.335 203-822/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(15)
06-03 13:26:24.335 203-822/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
06-03 13:26:24.338 203-822/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback
--------- beginning of system
06-03 13:26:26.277 786-892/? D/ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 100]
06-03 13:26:27.551 203-822/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
disable_snd_device: snd_device(2: speaker)
when I run this in ADB, it brings the google assistant up:
adb shell am start -a android.intent.action.VOICE_COMMAND
which is weird, it's technically the very same thing.
is there permission i'm missing or something?
From Docs
Activity Action: Start Voice Command.
So to bring up the voice command assistant activity, Use startActivityas
getApplicationContext().startActivity(newIntent);
instead of
getApplicationContext().sendBroadcast(newIntent);
like
Intent newIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(newIntent);
// ^^^^^^^^^^^^
is there a way for the UI not to come up and cover my UI? or at least
for google assistant to go away after it listened and acted on my
voice command?
You can use Google Assistant Service sdk and here is the android quick start guide
I need to force an Android phone to use oob data for pairing. That means I want the Android phone to have the "OOB Data Flag" being set, when the phone sends a Pairing Request to a device.
What I've tried so far: I've identified platform/system/bt to be the current (6.0.1) Android Bluetooth implementation and platform/packages/apps/Bluetooth being a Java wrapper around BT.
platform/system/bt exposes it's interface through a bt_interface_t structure. That structure contains a function named create_bond_out_of_bandthat should do what I need. Unfortunately, that function is not exposed by the Java Wrapper.
First I've tried to use the JNI function const bt_interface_t* android::getBluetoothInterface() from libbluetooth_jni.so. I managed to lookup that function during runtime, but when I call it, it returns 0. At that point, the app used already a lot of the bluetooth API.
This led me to the conclusion, that either, the shared object was loaded a second time, or that the bluetooth library is not part of my application, but somehow implemented in a different process.
Second, I've tried to use the Android libhardware API. I've managed to get the BT module, a BT device and finally call the create_bond_out_of_band() from the bt_interface_t. The function returns 0, which indicates success, but no Pairing Request is send out. I see following messages in the logs:
02-02 15:24:38.083 5791-5824/? E/bt_btif: btif_hh_virtual_unplug: Error, device C4:BE:84:BA:DA:0B not opened.
02-02 15:24:38.083 5791-5791/? E/Gatt: createBondOutOfBand: create_bond_out_of_band(0)
02-02 15:24:38.086 490-2881/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
02-02 15:24:38.101 490-2881/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
02-02 15:24:38.101 490-2881/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(101)
02-02 15:24:38.101 490-2881/? I/soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 1
02-02 15:24:38.108 490-2881/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(69) acdb_id(102)
02-02 15:24:38.108 490-2881/? D/audio_hw_primary: enable_snd_device: snd_device(69: vi-feedback)
02-02 15:24:38.108 490-2881/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: spkr-vi-record
02-02 15:24:38.132 490-2881/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(27) acdb_id(4)
02-02 15:24:38.132 490-2881/? I/ACDB-LOADER: ACDB AFE returned = -19
02-02 15:24:38.133 490-2881/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback
02-02 15:24:38.672 490-2881/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
02-02 15:24:38.674 490-2881/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
02-02 15:24:38.690 600-600/? E/QCALOG: [MessageQ] ProcessNewMessage: [LOWI-SERVER] unknown deliver target [OS-Agent]
02-02 15:24:38.693 490-2881/? D/audio_hw_primary: disable_snd_device: snd_device(69: vi-feedback)
02-02 15:24:38.693 490-2881/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: spkr-vi-record
02-02 15:24:38.696 490-2881/? I/soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 0
C4:BE:84:BA:DA:0B is the device, I try to pair with.
Any ideas? How I can archive my goal or at least some pointers to where an active Android community can be found?
Thanks in advance,
Torsten
My application has Vimeo HTML5WebView integrated. The video is working fine, when it is portrait mode(on all devices), but when the orientation is changed to landscape, the video starts to flicker.This is happening in tablets - in 7 and 10 inch tablets. When the video flickers, I get a warning in the logcat saying, the window already focused, ignored focus gain.Please refer to the logcat below.
I tried looking at various questions on StackOverflow, but couldn't get a decent solution.
12-13 14:15:11.730: D/dalvikvm(505): JIT code cache reset in 1 ms (1048548 bytes 8/0)
12-13 14:15:11.740: D/dalvikvm(505): GC_EXPLICIT freed 868K, 25% free 18906K/24960K, paused 5ms+7ms, total 131ms
12-13 14:15:12.521: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#4286b2f0 attribute=null, token = android.os.BinderProxy#42458f80
12-13 14:15:12.531: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:12.621: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:16.915: I/AwesomePlayer(180): cache is running low (1.58 secs) , pausing.
12-13 14:15:16.915: W/MediaPlayer(22724): info/warning (703, 1843)
12-13 14:15:16.915: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:16.925: I/MediaPlayer(22724): Info (703,1843)
12-13 14:15:16.925: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:19.928: D/audio_hw_primary(180): out_standby: enter: usecase(1: low-latency-playback)
12-13 14:15:19.988: D/audio_hw_primary(180): stop_output_stream: enter: usecase(1: low-latency-playback)
12-13 14:15:19.988: D/audio_hw_primary(180): disable_audio_route: reset mixer path: low-latency-playback
12-13 14:15:19.988: D/audio_hw_primary(180): disable_snd_device: snd_device(2: speaker)
12-13 14:15:19.998: D/audio_hw_primary(180): stop_output_stream: exit: status(0)
12-13 14:15:19.998: D/audio_hw_primary(180): out_standby: exit
12-13 14:15:27.916: I/AwesomePlayer(180): cache has filled up (6.09 secs), resuming.
12-13 14:15:27.916: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:27.936: D/audio_hw_primary(180): start_output_stream: enter: usecase(1: low-latency-playback) devices(0x2)
12-13 14:15:27.936: D/audio_hw_primary(180): select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
12-13 14:15:27.936: D/audio_hw_primary(180): enable_snd_device: sending audio calibration for snd_device(2) acdb_id(14)
12-13 14:15:27.936: D/ACDB-LOADER(180): ACDB -> send_afe_cal
12-13 14:15:27.936: D/audio_hw_primary(180): enable_snd_device: snd_device(2: speaker)
12-13 14:15:27.946: D/audio_hw_primary(180): enable_audio_route: apply mixer path: low-latency-playback
12-13 14:15:27.956: D/audio_hw_primary(180): start_output_stream: exit
12-13 14:15:28.016: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:29.608: I/InputReader(505): Reconfiguring input devices. changes=0x00000004
12-13 14:15:29.608: I/InputReader(505): Device reconfigured: id=6, name='elan-touchscreen', size 1200x1920, orientation 1, mode 1, display id 0
12-13 14:15:29.608: I/InputReader(505): Reconfiguring input devices. changes=0x00000004
12-13 14:15:29.608: I/InputReader(505): Device reconfigured: id=6, name='elan-touchscreen', size 1200x1920, orientation 1, mode 1, display id 0
12-13 14:15:29.608: I/ActivityManager(505): Config changes=1480 {1.0 404mcc?mnc en_US ldltr sw600dp w960dp h527dp 320dpi lrg land finger -keyb/v/h -nav/h s.51}
12-13 14:15:29.678: D/audio_hw_primary(180): adev_set_parameters: enter: rotation=90
12-13 14:15:29.678: D/audio_hw_primary(180): adev_set_parameters: exit with code(0)
12-13 14:15:29.748: D/PhoneStatusBar(587): mSettingsPanelGravity = 8388661
12-13 14:15:29.808: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:29.828: I/WindowManager(505): Screen frozen for +274ms due to Window{4290b200 u0 Panel:com.xx.xxx/com.xx.xxx.WebViewActivity}
12-13 14:15:29.908: E/CABL(203): MSMFB_HISTOGRAM_STOP failed!
12-13 14:15:31.970: D/dalvikvm(505): GC_EXPLICIT freed 858K, 25% free 18826K/24960K, paused 7ms+5ms, total 120ms
12-13 14:15:32.911: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#4283d658 attribute=null, token = android.os.BinderProxy#42458f80
12-13 14:15:32.921: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:32.961: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:35.924: I/AwesomePlayer(180): cache is running low (1.84 secs) , pausing.
12-13 14:15:35.934: W/MediaPlayer(22724): info/warning (703, 1811)
12-13 14:15:35.934: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:35.934: I/MediaPlayer(22724): Info (703,1811)
12-13 14:15:35.934: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:36.064: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#423e5920 attribute=null, token = android.os.BinderProxy#42458f80
12-13 14:15:36.074: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:36.184: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:36.785: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:36.785: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:37.045: I/NuCachedSource2(180): new range: offset= 32665175
12-13 14:15:38.967: D/audio_hw_primary(180): out_standby: enter: usecase(1: low-latency-playback)
12-13 14:15:39.007: D/audio_hw_primary(180): stop_output_stream: enter: usecase(1: low-latency-playback)
12-13 14:15:39.007: D/audio_hw_primary(180): disable_audio_route: reset mixer path: low-latency-playback
12-13 14:15:39.007: D/audio_hw_primary(180): disable_snd_device: snd_device(2: speaker)
12-13 14:15:39.007: D/audio_hw_primary(180): stop_output_stream: exit: status(0)
12-13 14:15:39.007: D/audio_hw_primary(180): out_standby: exit
12-13 14:15:39.978: D/audio_hw_primary(180): start_output_stream: enter: usecase(1: low-latency-playback) devices(0x2)
12-13 14:15:39.978: D/audio_hw_primary(180): select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
12-13 14:15:39.978: D/audio_hw_primary(180): enable_snd_device: sending audio calibration for snd_device(2) acdb_id(14)
12-13 14:15:39.978: D/ACDB-LOADER(180): ACDB -> send_afe_cal
12-13 14:15:39.978: D/audio_hw_primary(180): enable_snd_device: snd_device(2: speaker)
12-13 14:15:39.978: D/audio_hw_primary(180): enable_audio_route: apply mixer path: low-latency-playback
12-13 14:15:39.978: I/AwesomePlayer(180): cache is running low (0.07 secs) , pausing.
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (703, 1625)
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:39.978: W/MediaPlayer(22724): info/warning (702, 0)
12-13 14:15:39.988: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:39.988: D/audio_hw_primary(180): start_output_stream: exit
12-13 14:15:40.008: V/PhoneStatusBar(587): setLightsOn(true)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (703,1625)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:40.088: I/MediaPlayer(22724): Info (702,0)
12-13 14:15:40.088: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#4221e640 attribute=null, token = android.os.BinderProxy#42458f80
12-13 14:15:40.969: I/AwesomePlayer(180): cache is running low (1.45 secs) , pausing.
12-13 14:15:40.969: W/MediaPlayer(22724): info/warning (703, 1625)
12-13 14:15:40.969: W/MediaPlayer(22724): info/warning (701, 0)
12-13 14:15:40.969: I/MediaPlayer(22724): Info (703,1625)
12-13 14:15:40.969: I/MediaPlayer(22724): Info (701,0)
12-13 14:15:42.640: D/dalvikvm(22724): GC_FOR_ALLOC freed 420K, 4% free 11555K/12012K, paused 24ms, total 24ms
12-13 14:15:43.101: W/InputMethodManagerService(505): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#4215b9e0 attribute=null, token = android.os.BinderProxy#42458f80
Please let me know, if the webview code helps, and I will add it to my question. From the questions that I have seen on StackOverflow, I feel, this might be a configuration issue, and in my code for webview, I have overwritten, onConfigurationChanged() and also included, android:configChanges to WebViewActivity.
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
<activity android:name=".WebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>
Thanks for your help!!!
By placing
android:configChanges="orientation"
for your activity, you are indicating to the system that your activity will handle the orientation change. But you are not really doing anything because all you are doing is:
super.onConfigurationChanged(newConfig);
So, how to solve your issue?
You said you are having the issue when orientation changes occur only on large screens (tablets) and esp. when changing from portrait to landscape. Yo don't see the issue when orientation changes occur on phone devices.
It makes me think that the video quality might not be of good enough quality to be played in landscape mode. Is that true? i.e if you start your activity in the landscape mode initially, do you still see the flickering?
Are you sure it's not a device specific issue? i.e does this issue you described occur on all large screen devices or just one that you are testing?
You have said you are using Vimeo HTML5WebView to render the video. Have you tried on a regular WebView that the platform provides and does similar issues happen with the framework provided widget as well?
Last but not least, you can always save the state of the player (like the timestamp where the video is before orientation) and then use that state to restore your webview after orientation changes. To do that, stop handling configuration yourself and then follow the guidelines mentioned in Saving Activity State and Handling configuration changes and Handling Runtime Changes. If you are absolutely convinced you can handle config changes yourself, then go ahead and do it but don't just call super and expect the system to magically handle the activities object states for you.
Hope this helps.
Best solution every one does is during changes between modes landscape to portrait or portrait to landscape pause the video and leave foucus of webview ie set focus false to webview and after complete restore of the webview gain the focus and play the video. offcouse u need to do some extra java script coding and javascript bridge coding but solution will work.
I'm looping and audiotrack with...
audioTrack.setLoopPoints(0, length, -1);
audioTrack.play();
But after random time (several minutes), it stop sounding, but state is STATE_INITIALIZED and PLAYSTATE_PLAYING.
In that moment, I get this message ...
09-20 19:32:27.989: D/audio_hw_primary(176): out_standby: enter: usecase(1: low-latency_playback)
09-20 19:32:28.039: D/audio_hw_primary(176): stop_output_stream: enter: usecase(1: low- latency-playback)
09-20 19:32:28.049: D/audio_hw_primary(176): disable_audio_route: reset mixer path: low-latency-playback
09-20 19:32:28.049: D/audio_hw_primary(176): disable_snd_device: snd_device(2: speaker)
09-20 19:32:28.049: D/audio_hw_primary(176): stop_output_stream: exit: status(0)
09-20 19:32:28.049: D/audio_hw_primary(176): out_standby: exit
I need to loop audiotrack limitless, please, anyone knows how to solve it ?
PD: The stop seems to happen only in versions 4.1 and later.
Seems like the phone is entering stand by, when you configured your MediaPlayer, did you get a wakelock?
yourMediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
Don't forget to release your mplayer later.