Related
Hey all,
I recently started using App Inventor to try to create a small app for my brother's beauty clinic (essentially a before & after photo app) for an ASUS Transformer. I have taken baby steps to have a button that launches the camera, and when I'm done shooting and hit ok, it should return the picture and set image1 (previously defined) to be that picture.
However, pressing okay does nothing. It stays in the camera app and refuses to return to my app. I also tried this on my N1 and it works fine, image1 shows the picture I just took.
Logcat from the Transformer:
Code:
D/Form ( 896): Form Screen1 got onActivityResult, requestCode = 2,
resultCode = 0
I/CameraComponent( 896): Returning result. Request code = 2, result
code = 0
I/CameraComponent( 896): Deleted file file:///mnt/sdcard/Pictures/app_inventor_1309992125941.jpg
Logcat from the N1:
Code:
D/Form (13091): Form Screen1 got onActivityResult, requestCode = 2,
resultCode = -1
I/CameraComponent(13091): Returning result. Request code = 2, result
code = -1
Any help would be appreciated!
Thanks
I wish to turn off continous autofocus when i take videos, the only thing this continously does is - it continoutly ruin my videos with excessive amout of blur that makes it impossible to use in many cases.
Interior videos, even outside it tends to totally mess up any attempts to make a decent video.
I saw some custom roms have a option to disable it in options, but i would like to keep the original rom - Root it and change whatever magic inaccesible settings i need to change (like the silent camera shutter ro.camera.sound.forced=0 setting).
I saw Potatoman's camera.apk mod but that does not have any options regarding video autofocus.
totally useless
i am with you on that problem, i don't even film anymore. all movies with moving objects or even if i move my camera are useless. i don't know why they made it this way. hope for a quick and reliable solution.
Its annoying as hell. I also dont bother recording! . Sad really.
Sent from my porn shoot using GT-I9100.
+1 for this problem.
I saw some custom roms have a option to disable it in options
Click to expand...
Click to collapse
Can you provide a link to a such rom?
It is miui for galaxy s2, i saw this in action and it has a option to disable auto-bluring of videos but i dislike the rest of gui. Plus i lose stuff like usb otg if i put that rom on so i'm searching for another solution:
http://forum.xda-developers.com/showthread.php?t=1130951
No luck Tried the camera apk from miui and it doesn't work on my kf3 stock rom.
I think our best hope is that Potatoman fixes this, i cannot reply in his topic (10 posts limit), but i sent him a private message about this and i hope he reads it.
I looked into disassembly tools for apk files and so far had no success taking apart the camera app myself, otherwise if i had a working way to disassemble and reassemble it i would do this myself (baksmali fails on me with a "Could not find the main class: R:\Internet\baksmali-1.2.7.jar. Program will exit." message).
JernejL said:
I looked into disassembly tools for apk files and so far had no success taking apart the camera app myself, otherwise if i had a working way to disassemble and reassemble it i would do this myself (baksmali fails on me with a "Could not find the main class: R:\Internet\baksmali-1.2.7.jar. Program will exit." message).
Click to expand...
Click to collapse
You should extract the classes.dex file from the Camera.apk (using WinRar) and put it to the same folder with baksmali-1.2.7.jar.
I managed to do that, and found the magic command line parameters for running it, i have the smali files but this looks like one big mess.
I found startTimer in onVideoRecordingStart
and .method public handleMessage(Landroid/os/MessageV in camera main handler, this contains text such as "AF_WAIT_TIMER_EXPIRED" and calls to restartTouchAutoFocus, it could be the timer which continously calls autofocus, but it's not in camcorder classes but the camera class - i am not sure how the classes are interconnected and if this is really what i was looking for, i wish potatoman can help better with this.
I found something else, it looks like continous focus is a camera property - focusing mode:
.method public static getFocusModeString(I)Ljava/lang/String;
it has modes: "auto, fixed, macro, facedetect, continuous-video" and is saved to preferences as "pref_camera_focus_key" (this is my guess based on what i am seeing)
It seems that android api confirms this:
developer.android.com/reference/android/hardware/Camera.Parameters.html#FOCUS_MODE_CONTINUOUS_VIDEO
called with:
developer.android.com/reference/android/hardware/Camera.Parameters.html#setFocusMode%28java.lang.String%29
camcorderengine:
.method public doPrepareVideoRecordingAsync()V
const-string v3, "continuous_af"
this goes into..
const-string v1, "continuous_af"
const/4 v1, 0x0
invoke-virtual {v0, v3, v1}, Lcom/sec/android/seccamera/SecCamera$Parameters;->set(Ljava/lang/String;I)V
useful info here too:
pastebin.com/V94HYCnk
Code:
// Parse continuous autofoucs into a format the driver understands
conAf = pars.get("enable-caf");
if (conAf != 0 && strcmp(conAf, "on") == 0) {
mContinuousAf = true;
}
else {
mContinuousAf = false;
}
pars.set("continuous_af", mContinuousAf ? 1 : 0);
I hope this research opens up the possibility that potatoman fixes this for us, i can barely read this .smali assembly and i'm afraid i'll break everything if i change anything.
note: i had to cripple all the http links because i have too few posts to link to things externally.. :/
Hey guys, just a heads up that I'm working on v2 of my mod now, so while I'm doing that I'll take a look at this too. I don't usually film video though, so just to be clear, do you guys want it to just stop adjusting the focus entirely, or adjust the focus faster so that it isnt blurry for so long (since atm it takes like 5s before refocusing.) Personally I think the best solution would be to refocus on tapping the screen like the camera does, but I'm not sure if that's possible during capture, so I'd have to look into it.
Please post telling me which, so I know what I'm trying to implement here. I don't want to make it worse!
Refocus when tapping the screen will be the best way i think...
Sent from my GT-I9100 using XDA App
Based on the code and documentation that i saw, it's not even possible to adjust the focusing speed.
I would prefer that any automatic focusing is simply disabled during video recording / camcorder mode.
If tap to focus works can be done that would be brilliant, but no automatic adjustments as this ruined every video i took so far.
The phone simply starts refocusing / enters blur mode for no reason while the picture is already totally crisp and then ruins 3-5 seconds of video with blur while it tries to find "focus".
we need touch to focus
is the best solution
today i read online that choosing for a lower resolution then the full had filming wil fix the problem, i havent got any time yet to test it ........
Tap2Focus would be awesome! BUT simple disabling continuous af would be enough for start
I wish the operation is as following:
1, The focus start and lock when I touch the Record icon.
2, The focus is disable and start to record when I release my finger from the Record icon
mrky said:
today i read online that choosing for a lower resolution then the full had filming wil fix the problem, i havent got any time yet to test it ........
Click to expand...
Click to collapse
I tried this - one of first things i tried, it doesn't really help at all in my case (tested this outside in a clear well sun lit scene)
stev2010 said:
I wish the operation is as following:
1, The focus start and lock when I touch the Record icon.
2, The focus is disable and start to record when I release my finger from the Record icon
Click to expand...
Click to collapse
+1 Yes please!
But I would settle for ANYTHING to disable auto-focus because it make videos totally useless.
I actually have no problem with autofocus itself... but my issue is that auto focus does not work at ALL on any resolution lower than 1080... Anyone else have this issue?
Since I'm not allowed to post in the dev forum, I'll just leave this here:
The light sensor code on the HTC vision is out of date. It can only return 10 light levels, which range from 0..1024. I've been told this is apparently a Froyo standard and that modern phones return from 0..10240.
github dot com/CyanogenMod/android_device_htc_vision/blob/gingerbread/libsensors/LightSensor.cpp
wtf, can't even link to things as a new user?!?
On line 143, you can see the 10 constants that the light sensor code picks between. They are supposed to be in "Lux", but can anyone with a photography rig confirm this? Looking at this chart,
engineeringtoolbox dot com/light-level-rooms-d_708.html
1024 lux is an overcast day. If that's the maximum it can report, that seems like a particularly ****ty light sensor.
Is the hardware that bad, or is the Cyanogenmod code not taking full advantage?
Once we can figure out what the light sensor readings should be, I'll submit a patch to fix the default Automatic Brightness settings (which right now are totally out of sync with the hardware light levels). See line 40 here.
github dot com/CyanogenMod/android_device_htc_vision/blob/gingerbread/overlay/frameworks/base/core/res/res/values/config.xml
Anyhow, only 9 more posts to go before I can participate in the CM9 dev thread
Definitely submit a CM bug report explaining this. Then when you can post links, post a link to the issue thread and everyone will happily plus 1 it.
Hardware is not that bad - this is a CM problem. I've patched mine so it works properly, also, don't use CM. My recommendation.
Thanks for the encouragement. I've filed a bug here. My etiquette may or may not get a warm reception there, so +1s would be appreciated.
code.google [dot] com/p/cyanogenmod/issues/detail?id=4796
I agree with the comment, you should submit it as a patch on gerrit cm review
code.google.com/p/cyanogenmod/issues/detail?id=4796
Alright, installing git now, let's see if I can use it properly.
I might just submit the easy update to the default config.xml AutoBrightness values. My C++ is pretty crap and I doubt I can tell what's going on with the light sensor code.
That seems like an ugly kludge, but it is an open source project after all...
ERROR - JOKES NOT ALLOWED AS NEW USER
What a pain to sync the entire CM source with my crappy internet connection... the 'repo' script recommended in the Gerrit howto hangs overnight.
Code:
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j16
Killing and restarting the script seems to start again from scratch, so I'm making no forward progress.
I wonder if there's a way to submit patches to gerrit by way of github or some other remote git hosting service?
While setting up git / repo to submit a change to Gerrit, I learned two things - the G2 / Desire Z has a Capella Microsystems CM3602 Light sensor, and the reason the lux values are screwed up - cyanogen did it!
https://github.com/CyanogenMod/andr...mmit/2b53447ec6b2a3fd3e299428d359b3603db19025
Why, I don't understand. The change reason is "Match lightsensor values to kernel". Anyone know more?
Nice, I saw your gerrit submission here http://review.cyanogenmod.com/#change,12845
I hope it gets some good feedback!
Thanks c00ller, I wish I could have added some explanation to the change submission. It would make it a lot easier for a reviewer to figure out what's going on. The real fix would be to change the Vision's lightsensors values to the standard 10..10240 . But without knowing why cyanogenmod reverted them to 1..1024, there's a lot of potential confusion.
The reason for the change is, like the commit message says:
"Match lightsensor values to kernel"
If you look at the kernel source,
Code:
github.com/CyanogenMod/htc-kernel-msm7x30/blob/android-msm-2.6.35/arch/arm/mach-msm/board-vision.c#L317
you can see that these are exactly those levels:
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
.levels = { 0x1, 0x3, 0x5, 0x13, 0x1A, 0x45, 0xDB, 0x135, 0x1F2, 0x3FF },
.channel = 3,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
He probably just forgot to adjust the sensor <-> display level mappings in the config.xml (which is what you did in your patch):
Code:
review.cyanogenmod.com/#change,12845
I tried it and it works fine, and I gave it +1
Aha, thanks for the explanation m0viefreak!
I still don't understand exactly where in the code the hardware sensor outputs should be translated into engineering "lux" units. Libsensors seems like the right place to me (naiive non-programmer).
I'd like to advocate for migrating to the gingerbread light sensor standard, since some cyanogenmod auto brightness functionality assumes its 1..10240 lux light sensor range. For example, the "reset threshold".
Is the kernel code using the obsolete 1..1024 range for reverse-compatibility with froyo?
Thanks for bringing this up. I was actually just wondering if the kb backlight issue on Vision keeps coming up because of incorrect light sensor range.
..although this would seem to suggest that the backlight would be on all the time, rather than never on...anyway
I was going to talk to somebody about this but didn't know who to tell about this issue. The brightness can be right at times but the brightness can be changing every few seconds.
Sent from my HTC Vision using xda premium
Any update on the submitted Gerrit change?
Sent from my HTC Vision using Tapatalk 2 Beta-5
azrash said:
Any update on the submitted Gerrit change?
Sent from my HTC Vision using Tapatalk 2 Beta-5
Click to expand...
Click to collapse
Was wondering the same thing.
Same here.
Would anyone be willing to file a glitch/issue in the CM7 github for me?
Any news on this one?
When the light sensor can work properly, than battery life would also get a boost.
Can someone maybe post a link to a (flashable)file to get the right readings from the light sensor? Or tell me if there's a editable file on the system partition I can manually edit?
So, I could not find the answer to this, when is it exactly the doze mode activated (becoming active).
All articles only mention, after some time when the device is stationary (no movement).
How long is that some time?
After some read, found this article:
https://newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-doze
And here is the source code of the DeviceIdleController:
http://tools.oesf.biz/android-MNC/xref/com/android/server/DeviceIdleController.java
It looks like, the doze mode will be activated after 1 hour (2 times 30 minutes).
But again, I am not Java developer, probably there are much more detail in the process.
What if the device is moved? Will the doze mode "cancelled"?
Well, it would be nice if custom ROM developer could add some customization in this, like shorten the activation time. Or even better, after the doze mode activated, it will stay active even if the device is moved (inside pocket), until the user do something (e.g. waking up, pressing button).
We need a developer to perform doze!!!!!
Enviado desde mi Nexus 6 mediante Tapatalk
I had these exact same questions. How long does it take to enter doze and how much does it take to wake from doze? Like if I bump my phone on desk is it going to hop out of doze mode? Would be cool to alter the time limits. Glad someone is looking into this!
And what parameters are measured for "stationary"? If the GPS is involved then truckers, EMTs, highway patrols and there like will never hit doze.
Sent from my Nexus 6 using Tapatalk
Hoyt Thompson said:
And what parameters are measured for "stationary"? If the GPS is involved then truckers, EMTs, highway patrols and there like will never hit doze.
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
I would really hope Google would have considered that when making doze.
Sent from my Nexus 6
Mr Patchy Patch said:
I would really hope Google would have considered that when making doze.
Sent from my Nexus 6
Click to expand...
Click to collapse
I am sure they did but it would be easier for the devs to tweak it or us to use it to its potential if a more descriptive instruction is given rather than "stationary"
inquiring minds want to know and searches are turning up few results
Hoyt Thompson said:
And what parameters are measured for "stationary"? If the GPS is involved then truckers, EMTs, highway patrols and there like will never hit doze.
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
If I am not mistaken, the doze will detect "significant motion" for that stationary checking.
Code:
void startMonitoringSignificantMotion() {
if (mSigMotionSensor != null && !mSigMotionActive) {
mSensorManager.requestTriggerSensor(mSigMotionListener, mSigMotionSensor);
mSigMotionActive = true;
}
}
void stopMonitoringSignificantMotion() {
if (mSigMotionActive) {
mSensorManager.cancelTriggerSensor(mSigMotionListener, mSigMotionSensor);
mSigMotionActive = false;
}
}
However, how much significant? That's up to the manufacturer implementation. At least this is not defined in the software. That's what I understood. This is an explanation I found:
http://stackoverflow.com/questions/...-of-type-significant-motion-sensor-in-android
But again, I am not Android developer.
I guess, to know about that significant motion, you can install this app (FREE) and then test with some motions
https://play.google.com/store/apps/details?id=com.axelk.sensorapp
From the app description:
Android Sensors is an very useful and simple application.
With Sensor Test for Android on your device you can view and read ALL AVAILABLE android-sensors. (similar to Sensor Box for Android or Phone Tester)
Additionally, you'll receive via the info button other useful information such as the sensor works and what it does.
I'd appreciate a good rating and a +1 (Google+)!
Sensor Test for Android is tested on different devices and versions.
I was not able to test all 8000 different types of Android devices, it´s possible that on some devices appear errors.
Affected people with a not working Sensor-Test-App should reboot and run it again.
Sensor Test for Android is still under construction!
If you have any troubles with your device, please send me an e-mail with the problem (Device-type, Android version, screenshot) before submitting a bad rating.
[email protected]
List of available sensors: (not all sensors will be present in your device)
- ACCELEROMETER
- MAGNETIC FIELD
- ORIENTATION
- GYROSCOPE
- LIGHT
- PRESSURE
- TEMPERATURE
- PROXIMITY
- GRAVITY
- LINEAR ACCELERATION
- ROTATION VECTOR
- RELATIVE HUMIDITY
- AMBIENT TEMPERATURE
- MAGNETIC FIELD UNCALIBRATED
- GAME ROTATION VECTOR
- GYROSCOPE UNCALIBRATED
- SIGNIFICANT MOTION
- STEP DETECTOR
- STEP COUNTER
- GEOMAGNETIC ROTATION VECTOR
- HEART RATE
About me:
Sensor Test for Android is my technicians work I programmed in the summer holidays of my training as a technician (electrical engineering).
Before starting programming, I knew just how to spell JAVA.
I only had contact with LabView, a "painting by numbers" for programmers. For this application a documentation will be created, with which following students can easily incorporated into the Java programming language.
I'd appreciate a good rating and a +1 (Google+)!
Downloaded the sensor app @gogol seems a good amount of movement is needed for significant motion be counted(walking a few steps). Gonna do some more testing... Thanks for the info!
anthonyg45157 said:
Downloaded the sensor app @gogol seems a good amount of movement is needed for significant motion be counted(walking a few steps). Gonna do some more testing... Thanks for the info!
Click to expand...
Click to collapse
Good to know!
I am wondering if putting the phone inside our pocket would trigger significant motion. Otherwise, we need to put it lay down stationary on the table
Thanks for the experiment.
This is interesting, "Agressive Doze" mode from Greenify!
http://forum.xda-developers.com/apps/greenify/aggressive-doze-experimental-feature-t3223731
This isn't based on anything code related but Pebble users are reporting that on marshmallow their pebble's lose connection to the phone app almost 15 minutes on the dot after the phone screen turning off so that's my guess
Seriously 1 hour for doze mode to be activated? Sounds flawed. I'm still hesitating whether to buy Nexus 6...
How is the experiment goes?
Note: This post summarizes the experiences I had when fixing Bluetooth on the sltexx device.
Even though parts of the following are device specific some fixes may also be ported to other device overlays after testing.
Also the shared audio HAL in android_harware_samsung might be used by other devices.
Please do not use this thread to report any issues you are having on your device. This is an advisory for fellow developers only!!
Short description of known Bug Reports:
1) Some BT features are not working, such as: Receiving files, Bluetooth tethering, OBEX, etc.
Reported as: BUGBASH-653
Affects: Bluetooth.apk
Devices: Possibly all, but caused by a rare condition, port to your device if neccesary2) The phone does not connect to cars / bt-headsets using the hands-free profile for calling
Reported as: BUGBASH-308
Affects: Bluetooth.default.so
Devices: Possibly all Devices with WBS=off in combination with bt-device relying on WBS3) The phone connects, media working, but in-call sound is completely garbled or muted on both ends
Reported as: BUGBASH-302 / BUGBASH-264
Affects: build.prop, libbt-vendor.so, Bluetooth.default.so, audio.primary.universal5430.so
Devices:
a) Samsung devices using qualcomm HAL msm8974 (klte)
b) Samsung devices using android_hardware_samsung audio HAL (sltexx, and devices with: TARGET_AUDIOHAL_VARIANT := samsung, see list in 3rd post)
c) Samsung devices using qualcomm HAL msm89** (jfltexx)
4) While connected to bt-headset systems sound such as volume change and ringtone are played on speaker and headset simultaneously.
Reported as: none, fixed internally
Affects: mixer_paths_0.xml
Devices: sltexx specific, maybe other Samsung behave similar
Detailed background description and fixes in next post….
1) Description: https://jira.lineageos.org/browse/BUGBASH-653
Background: The registration of the "EMAIL Message Access" Service seems to be faulty.
The MAP: MSE MAS Email Instance Support was added to CM14.1 but not CM13!
https://github.com/LineageOS/androi...mmit/819847bb7f72a69a7d7fc662bcd37625247fceec
There is also a switch to disable all new non-aosp bt data features:
https://github.com/LineageOS/androi...mmit/96a55efb0edac3c2af523f938b338dd16d4f8ac4
However it might be useful to fix the originating issue which I assume is the SDP registration of those features: -> No one has checked this until now..
Fix: https://review.lineageos.org/#/c/177998/
2) Description: https://jira.lineageos.org/browse/BUGBASH-308
Background: The BMWs (and probably other cars also) check the available codecs first:
Code:
BTA_AG_AT_BAC_EVT /* avablable codec */
and expect the wide-band speech [WBS] profile. Because that is not enabled on compile level the BMW sends a BTA_AG_CLOSE_EVT.
The connection is terminated and phone_state_change tries to continue with an invalid idx because the SLC connection is already down.
If you look at the logcat of the motog closely, you can find the following:
Code:
bt_btif : btif_hf_upstreams_evt: event=BTA_AG_WBS_EVT
audio_hw_primary: adev_set_parameters: enter: bt_wbs=on
Therefore the build must have been compiled with: BTM_WBS_INCLUDED
Code:
#if (BTM_WBS_INCLUDED == TRUE )
#define BTA_AG_WBS_EVT 31 /* SCO codec info */
#endif
Fix: https://review.lineageos.org/#/c/177996/
NOTE: If you are experiencing mute calls or garbled incall sound after this, continue with 3a/3b depending on your device
3a) Description: Garbled /mute incall sounds on bluetooth (msm8974)
Background:
The sample rate for calls is usually 8k, however for wide-band speech it is 16k. It seems that some devices cannot handle this sample rate and will only work on WBS with 8k.
This behavior was confirmed on the klte. The fix might be ported to other devices:
Fix: https://review.lineageos.org/#/c/178371/
3b) Description: Garbled /mute incall sounds (Universal HAL)
Background: Unlike the klte, many Exynos devices have a shared audio HAL that supports 16k WBS however there was a small misuse of the sample rate constant resulting in garbled sound.
The usage of audio_hal.force_voice_config = (wide or narrow) is usually not required (add if needed)
If the fix from 3a has been applied or was previously set, remove any definitions of SCO_WBS_SAMPLERATE in the vendor config.
Fix: https://review.lineageos.org/#/c/182054/
Right now this in in testing. We are looking for more affected devices that are using android_hardware_samsung as audio HAL.
Update: See the detailed list of possible affected devices below, as far as I see all of them have not yet enabled WBS yet.
3c) Description: Garbled /mute incall sounds on bluetooth (msm89** / jfltexx)
@jorgemiguel4 Found out what fixes the mute calls: Thanks to you!
#define BTM_WBS_INCLUDED TRUE
#define BTIF_HF_WBS_PREFERRED FALSE //With this set to TRUE there is no sound on my side.
Click to expand...
Click to collapse
This will enable WBS (for the car support) but it will use the default codec instead which does not have the WBS samplerate issue.
Therefore audio quality might not be perfect but at least it works.
4) Description: Ringer & notification sounds through headset and speaker
Background:
When pressing volume up/down buttons or on incoming calls the sound is played on both headset and speaker which seems to be an odd behaviour. This is not only for bluetooth, also for wired headsets and headphones. The issue seems to be quite old and some might say it works as designed: https://forum.xda-developers.com/showthread.php?t=2320446
However as this is a custom firmware we can change the corresponding audio routes!
Fix: https://github.com/Harinus/android_...mmit/f104a3d9775e6c6cfdfbb6e61f16b036d207c18b (will need modification for other devices)
Wrote this with my best knowledge and belief. If there is any incorrect information, please let me know.
Special thanks to @akk29, @side and everyone on webchat, gerrit and jira who provided help/logs
Collection of all TARGET_AUDIOHAL_VARIANT := samsung Devices I could find on github!
sltexx ...........Samsung Galaxy Alpha / SM-G850F....... [exynos5430]
#LineageOS/
noblelte-common ..Samsung Galaxy Note 5................. [exynos7420]
zero-common ......Samsung Galaxy S6..................... [exynos7420]
k3gxx ............Samsung Galaxy S5 / SM-G900H.......... [exynos5422]
hero-common ......Samsung Galaxy S7 Edge................ [exynos8890]
gts2-common ......Samsung Galaxy Tab S2................. [exynos5433]
#others/
klimtlte .........Samsung Galaxy Tab S 8.4 / SM-T705.... [exynos5420]
ja3gxx ...........Samsung Galaxy S4 Exynos / GT-I9500... [exynos5410]
lt033g ...........Samsung Galaxy Note 10.1 3g / SM-P601. [exynos5420]
on5xelte .........Samsung Galaxy J5 Prime....... ....... [exynos7570]
zenlte-common ....Samsung Galaxy S6 Edge +.............. [exynos7420]
chagalllte .......Samsung Galaxy Tab S 10.5 / SM-T805... [exynos5420]
chagallltetmo ....Samsung Galaxy Tab S 10.5 / SM-T807T.. [exynos5420]
j7elte ...........Samsung Galaxy J7 / SM-J700........... [exynos7580]
. The usage of audio_hal.force_voice_config = (wide or narrow) is usually not required (add if needed)
If the fix from 3a has been applied or was previously set, remove any definitions of SCO_WBS_SAMPLERATE in the vendor config.
Click to expand...
Click to collapse
On code review I read ur the discussion with shevt regarding using "audio_half.force_voice_config". So using this line in build.prop will always force hal to use wideband or narrow whichever specified OR
But removing this line I believe will allow audio hal to decide wide band or narrow based on network. I may be wrong.
When shevt removed force.voice.config I assume audio hal may be using "pcm_config_voice_sco" and not "pcm_config_voice_sco_wb" in which has been defined .rate 8000 which may be causing the problem for shevt.
I just want to understand. I have seen in pcm_config_voice_sco_wb rate defined as "SCO_WB_SAMPLING_RATE". what is value passed when you define this. Is it .rate=16000 or .rate=0?
@Harinus hope you can help me
i have same issue on BUGBASH-96 but WPS didn't fix it
i have this lines on logcat :
Code:
08-12 13:40:24.866 6824 6861 D bt_btif : A2DP-CTRL-CHANNEL EVENT UIPC_RX_DATA_READY_EVT
08-12 13:40:24.866 6824 6861 D bt_btif : a2dp-ctrl-cmd : A2DP_CTRL_CMD_START
08-12 13:40:24.866 6824 6861 W bt_btif : btif_recv_ctrl_data: A2DP command A2DP_CTRL_CMD_START while AV stream is not ready
08-12 13:40:24.866 6824 6861 D bt_btif : ## a2dp ack : A2DP_CTRL_CMD_START, status 1 ##
08-12 13:40:24.866 6824 6861 D bt_btif : a2dp-ctrl-cmd : A2DP_CTRL_CMD_START DONE
08-12 13:40:24.866 371 6892 I bt_a2dp_hw: a2dp_command: A2DP COMMAND A2DP_CTRL_CMD_START DONE STATUS 1
08-12 13:40:24.866 371 6892 E bt_a2dp_hw: a2dp_command: A2DP COMMAND A2DP_CTRL_CMD_START error 1
08-12 13:40:24.866 371 6892 E bt_a2dp_hw: start_audio_datapath: Audiopath start failed (status -1)
08-12 13:40:24.877 371 6892 I bt_a2dp_hw: start_audio_datapath: state 3
08-12 13:40:24.878 371 6892 I bt_a2dp_hw: start_audio_datapath: state AUDIO_A2DP_STATE_STOPPED
08-12 13:40:24.878 371 6892 I bt_a2dp_hw: a2dp_command: A2DP COMMAND A2DP_CTRL_CMD_START
my device tree links : https://github.com/LG-K10
@macs18max
You basically got it right.
The HAL consists of 2 parts:
android_hardware_samsung (1, audio HAL)
android_hardware_broadcom_libbt (2, bluetooth RIL)
Both must handle the sampling rate of the incoming and outgoing audio streams.
For the WBS codec both 8k and 16k are valid by specification. Other codecs may use only 8k.
1) PCM Config / force_voice_config
The audio HAL (pcm config) uses 16k for WBS (after my fix) and 8k for the other codecs.
It decides which sample rate based on the wb_amr_type that it gets from the RIL.
When setting "audio_hal.force_voice_config" it overrides the wb_amr_type and therefore the samplerate of the pcm config.
(pcm_config_voice_sco_wb or pcm_config_voice_sco)
voice_session_init registers a RIL callback for WB. That wont be registered when "audio_hal.force_voice_config" is set at all. https://github.com/LineageOS/android_hardware_samsung/blob/cm-14.1/audio/voice.c#L444
2) SCO_WBS_SAMPLE_RATE
The value is used in hw_sco_i2spcm_config https://github.com/LineageOS/android_hardware_broadcom_libbt/blob/cm-14.1/src/hardware.c#L1516 and defines the sample rate on hw layer.
The values 0 and 1 are used. -> SCO_WBS_SAMPLE_RATE is a macro, documented here: https://github.com/LineageOS/androi...bt/blob/cm-14.1/include/bt_vendor_brcm.h#L262
3) Conclusion.
From what I experienced both values on RIL and HAL must be equal. Otherwise the audio will be garbled.
However some HALs (e.g. klte) seem to not support 16k, so we force 8k there.
Maybe it does not work for @ShevT without the line in build.prop because the wb-amr callback is not working properly on that device.
Can not answer that without a device for testing.
@erfanoabdi
The issue looks like something not related to WBS. Do you have a full log?
Harinus said:
@erfanoabdi
The issue looks like something not related to WBS. Do you have a full log?
Click to expand...
Click to collapse
tnx for reply
yeah, logcat attached
interested thing is i can see this error is passed by using prebuilt audio hals but still no sound :
Code:
A2DP COMMAND A2DP_CTRL_CMD_START DONE STATUS 0
i don't want to use prebuilt hals, need to find way for fixing this.
erfanoabdi said:
tnx for reply
yeah, logcat attached
interested thing is i can see this error is passed by using prebuilt audio hals but still no sound :
Code:
A2DP COMMAND A2DP_CTRL_CMD_START DONE STATUS 0
i don't want to use prebuilt hals, need to find way for fixing this.
Click to expand...
Click to collapse
The origin of the error is: https://github.com/LineageOS/android_system_bt/blob/cm-14.1/audio_a2dp_hw/audio_a2dp_hw.c#L569. android_hardware_bt is the bluetooth stack that has changed quite a lot for the last versions of android.
Your build config of the stack(https://github.com/LG-K10/android_device_lge_m216/blob/cm-14.1/bluetooth/bdroid_buildcfg.h) is using definitions that seem to be obsolete since Android M (and also Nougat)
Check the related motorola https://github.com/LineageOS/androi...mmit/69feab615584f2b8bf7f51c0fd12817181453e02 repository!
Some parameters were renamed:
Code:
BLUETOOTH_QCOM_SW -> BLUETOOTH_QTI_SW
BTC_INCLUDED -> BLE_VND_INCLUDED
The currently missing "BLE_VND_INCLUDED" enables several CTRL feature callbacks that seem to be related to: "A2DP_CTRL_CMD_START"
I suggest porting the current version from motorola with all its defines:
Code:
#define BLUETOOTH_QTI_SW TRUE
#define MAX_ACL_CONNECTIONS 7
#define MAX_L2CAP_CHANNELS 16
#define BLE_VND_INCLUDED TRUE
#define BT_CLEAN_TURN_ON_DISABLED TRUE
plus the WBS enabling..
Code:
#define BTM_WBS_INCLUDED TRUE /* Enable WBS */
#define BTIF_HF_WBS_PREFERRED TRUE /* Use WBS */
I can not guarantee that this will fix the issue, but it is surely a good idea to fix the parameters.
I posted a AOSP Bluetooth patch to the jira bugtracker under issue
https://jira.lineageos.org/browse/BUGBASH-717
And here is the xda thread where the dev built this patch...
https://forum.xda-developers.com/go...m-dark-rom-t3492150/post73199372#post73199372
...maybe helpful !?!
lulli1 said:
I posted a AOSP Bluetooth patch to the jira bugtracker under issue
https://jira.lineageos.org/browse/BUGBASH-717
And here is the xda thread where the dev built this patch...
https://forum.xda-developers.com/go...m-dark-rom-t3492150/post73199372#post73199372
...maybe helpful !?!
Click to expand...
Click to collapse
See my comment on jira.. For axon7 its clearly the WBS issue that has been described above.
On jfltexx got it working in my car with the following, hope it helps somebody
#define BTM_WBS_INCLUDED TRUE
#define BTIF_HF_WBS_PREFERRED FALSE //With this set to TRUE there is no sound on my side.
and
SCO_WBS_SAMPLE_RATE = 0 or SCO_WBS_SAMPLE_RATE = 1 //worked fine with both. 0=8Hhz and 1=16kHz
Harinus said:
See my comment on jira.. For axon7 its clearly the WBS issue that has been described above.
Click to expand...
Click to collapse
Yes you were right. Thanks a lot. We solved the issue on the Nexus 5 by setting
BTIF_HF_WBS_PREFERRED to FALSE
Using HFP several users of the herolte got distorted sound when calling. See regression 1194. The problem occurred after enabling WBS in LOS nightly. What has to be done to apply a workaround? Is it sufficient to change the build.prop? Issue is really annoying.
nostromo12 said:
Using HFP several users of the herolte got distorted sound when calling. See regression 1194. The problem occurred after enabling WBS in LOS nightly. What has to be done to apply a workaround? Is it sufficient to change the build.prop? Issue is really annoying.
Click to expand...
Click to collapse
LOS Version: lineage-14.1-20171018-nightly-herolte-signed
Baseband: G930FXXU1DQF1
Kernel version: 3.18.14-gadb2bc5
I have Samsung Galaxy S7 G930F running latest nightly and have the voice distortion issue.
audio_hal.force_voice_config = wide [This is default, I didn't change this]
---------- Post added at 01:30 PM ---------- Previous post was at 12:33 PM ----------
padraigdoran said:
LOS Version: lineage-14.1-20171018-nightly-herolte-signed
Baseband: G930FXXU1DQF1
Kernel version: 3.18.14-gadb2bc5
I have Samsung Galaxy S7 G930F running latest nightly and have the voice distortion issue.
audio_hal.force_voice_config = wide [This is default, I didn't change this]
Click to expand...
Click to collapse
I got it working on my S7 by changing to the following:
audio_hal.force_voice_config = narrow
The audio person on the other end says they can hear me fine, but I think the audio quality of the incoming voice isn't that great. The voice is very understandable, just not super clear.
I tested
audio_hal.force_voice_config = narrow
on herolte with same nightly , but older baseband G930FXXU1BPJG. But it did not work. There is absolutely silence. No dial tone. No partner voice. Nothing. I have sadly to go back to nightly 20170919.
I've got a problem with Bluetooth on my Note 4 with Lineage OS 14.1. I've paired my android wear watch with my phone and can receive notifications and data from apps on the phone, but the watch can't access the internet through the Bluetooth connection. It worked fine on my old Touchwiz ROM. Is this related to problem 1 or something else?
none of these are the problem I have, my problem is that bluetooth doesn't even turn on
@Harinus
I have got issues with Call Audio on zerofltexx (S6). We are using the common audio HAL. Well the issue is I have got a pair of Beats Solo 3 Wireless Headphones which require WBS for Calls. Media audio works great. However there is no call audio whatsoever. Now I have tried many of the fixes you mentioned in your previous posts and non have solved this issue. I have tried the prebuilt audio HAL on LineageOS and it works fine with these headphones. Even the one by @macs18max for the same device works. I will attach a log when making a call. I have BT WBS as ON but PREFERRED to FALSE when this log was taken.
LG G6
this is what bluetooth does on my LG G6: The phone connects, media working, but in-call sound is completely garbled or muted on the other end
No idea on how to fix this. Phone is rooted and has the nightly from 20180206 with the microG-Patch. Same issue with previous versions.
any help would be appreciated
thnx lemonskater
I have this exact problem...
I'm now looking for the "How To" push code or config changes to my device? In the thread, there are a couple of fixes to try, and some files... but I don't have a single clue about what to do with them, how to "install" those fixes on my LOS 15.1 Galaxy S7. Im guessing I need an app on my phone to run and apply the changes... but I didn't find exactly how to.
I'm an experienced Windows sys admin, but I'm a total N00b as when it comes to Android. I want to learn to exploit the maximum of my phone, but I gotta start by making it work normal again. Can you help me with this? I'm totally lost as how I can solve my Bluetooth problem with the thread linked a little earlier!
Thank you SOOOOO much for every bit of help you could provide me.