How do you fire the iblazr programmatically?
No API I can find, they're not responding to inquiry.
I'm looking for a solution for iPhone and Android.
Since you have to enable the flash device with the media volume at max, I suspected it must have something to do with the volume output that triggers it.
So, I plugged it in, started my music player, and it started flashing to the music for the most part.
Turning down the volume stopped the flashing and turning it back up caused the LED to again start flashing.
Based on that I would assume you simply have to output a loud audio clip to turn it on while the media volume is set to max.
Update:
After experimenting on my theory, the device I have (iblazr compatible 16 LED Chinese version), the frequency of the tone is the key and determines the brightness. Using the Windows API Beep(frequency, duration) function, the light first turns on at a frequency of 6500 and gets brighter as the frequency increases. Seems like it is pretty bright at 7000!
They finally published it here:
https://github.com/ConcepterDev/iblazr-original-protocol
You can control the original iblazr by sending the specified tone for the specified duration to the headphone jack:
function frequency (Hz) duration
----------------------------------------------
wake iblazr 800 200±150ms
flash 15750 300ms (auto)
pre-flash 10000 until focused
constant light 2500-9500 infinite
Related
Imagine an Android device (possibly any device from any manufacturer) that is connected via bluetooth to a speaker (or any bluetooth audio device)... and there has been a "significant" amount of time where no audio has been played from the device.
At the moment audio resumes playing from this device, there is more often than not a "speaker is slowly waking up" phase where no audio is heard and the audio is late to become audible.
This is less obvious when the audio is being "kept alive" with constant audio, or only taking short breaks of silence, but what if you have an application that makes very short and intermittent sounds at unpredictable times... like an alarm that measures environmental conditions with a sensor?
I'm not sure if:
A) This behavior is some kind of power-saving feature of the output device and we would have no control over it other than to play some kind of fake audio/silence prior to our desired sound... or have a low-volume sound/white noise on a constant loop... in order to pre-empt/prevent the "warm up."
B) It's part of the bluetooth protocol/standard/definition
C) It's controllable in software with something like (on Android):
bluetooth.setMode(BluetoothMode.NO_NAPPING_ALLOWED);
I'm hoping the case is (C), and if so, then what is the proper code for this?
I'm sure there is a similar question out there that is asked in a different way, but I can't find it, and I have searched through the documentation for AudioManager and although bluetooth is mentioned in many places, I can't find this functionality.
For fun, I accessed developer options on my phone and picked the option to keep the device awake. I also tried to disable any battery optimization.
My SONY XB-900 headphones turned off after some minutes of silence, my cheapo Monster headphones did not turn off, and a cheapo Bluetooth Speaker did not turn off.
I repeated the same thing on Windows, exactly the same results.
Then I searched on some forums, using the keywords "Bluetooth" "prevent" "awake" "power saving" "standby" "disconnected" "annoying" and "silence".
This commenter told something interesting:
I read that sony SRS-X1 bluetooth speaker doesn't cut off bluetooth
audio connection after a period of inactivity. It just enters standby
mode which it takes about 0.1 second to exit when audio signals
arrive. So, you can lose 0.1 second of audio when audio is played
after a period of inactivity. However, you can prevent it from
entering standby mode by playing 20Hz noise continuously. Speakers
cannot react to 20Hz noise, so 20Hz noise is silent.
This makes me believe that is a pure playback device-side implementation, and the OS nor Bluetooth have anything to do with it. The fact that you did not find any documentation about it supports the theory. Looks like the solution is the one you already mentioned: Play a very low or very high frequency on loop to keep the device awake.
I'm currently working on a Visible Light Communication project and need some help to programm a fast blinking (>200Hz) LED Flashlight. My device is a HUAWEI CUN-L21 with firmware B115 and it is also rooted.
I already programmed an app using Android SDK that turns the Flashlight on and off with a specific delay using Thread.sleep(delay). The problem is, that even if I set the delay to just a few milliseconds, the max. frequency I get is around 35Hz which is too low.
I also tried to blink it fast via the timer trigger in shell. But the frequency was to low as well.
So here is my question: Is there any other way to get the LED to blink in a frequency of 200 Hz? Do I have to modify the LED driver in the kernelspace? And if so, how can I do that?
I managed to blink the LED via the timer trigger in shell with delay_on = 1ms and delay_off = 1 ms. So the frequency theoretically had to be 500 Hz. But somehow the LED doesn't blink constant. In the picture below, one can see, that after 10ms the LED stops to blink. To me it looks like some kind of PWM.
Measurement of the blinking frequency
So the LED is able to blink with a delay_on = delay_off = 1ms. But is there a way to get the LED of this smartphone to blink in this frequency for a longer period? Why does it stop after 10ms. Is there some kind of restriction, that is deeper than the LED driver in kernelspace?
In my app I have an additional library for SIP calling, which on some phones (Huawei 5.1) locks volume to around 50% (or even less) for some reason and it keeps it like that for the whole phone volume meanwhile service is running.
I tried setting:
am.SetStreamVolume(Android.Media.Stream.Music,am.GetStreamMaxVolume(Android.Media.Stream.Music), 0);
And playing beeping noise with MediaPlayer/Soundpool.
I also tried setting Microfone to
Mode.Ringtone / Mode.Normal,...
but the volume is still low when this library/service is running.
Is there any other setting option possible that could override some setting in the library, because if I look current volumes, it's all on MAX (Media/Notification/Ringtone/...)?
In this library, you have to initialize sampleRate / buff size, which I do with getting default values from Android
String rate = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
String size = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
Some companies add a volume limit to protect user. I met similar issue before on samsung note 4. I am not sure whether APP has the permission to break this limit(mostly not allow).
In order to find the relative setting, please try this: Play music by the default music player, and press volume+. Keep volume up and then your phone may toast a dialog to tip you. And you can change this setting.
Hope it works :)
My application is measuring volume of captured audio as a function of samples absolute amplitude.
I've noticed and unexpected behavior in android.media.AudioRecord of Android SDK. Let's assume following flow:
Application is launched
Audio volume is being measured
Phone call is answered/dialed
Audio volume is being measured
The noise around the microphone is produced by TV with constant volume setting. Values measured for point 2 are in range [55-65] and values measured for point 4 are in range [15-25] (please see the audio visualization for 2. and 4. below).
I understand that there must be some volume adjustment going on when phone call occurs. Is it possible to monitor those adjustments or to get rid of them?
I've tried AutomaticGainControl but it is not supported on my Nexus 5 and I do not want to use it since the target devices might not support it as well.
Update
This volume adjustment is happening not only after phone call. I've just noticed the same behavior when phone was just lying on the table measuring volume.
In regard to resources that your app is sharing with other apps (the microphone in this matter) - you should always treat them carefully and assume there configuration may change during a phone call or other usage like switching to another app that's using the microphone.
Instead of trying to monitor for changes in gain , which may require root or other elevated privileges - I would take another approach and do the following:
Save the mic sensitivity level to a configuration file (shared_prefs) in your recording activity when the user is recording . do the same if the user changes it of course during usage of your app.
In the onResume proc of your recording activity - load the mic sensitivity level value and set it before continuing to record (How to adjust microphone sensitivity while recording audio in android - Solved)
If there is a phone call that throws your app to the background and takes control of the mic, once it's finished - your app will return to the foreground and retain the mic sensitivity level for further recording.
Hope this helps.
I have a tablet whose volume I have set to maximum, and I listen to the output from my program through a headset which is also set to maximum. My program takes the input through the microphone, performs some DSP on it, calculates a gain, applies this gain and sends the output to the headphones. This gain value is greater than 1 and I further multiply it with t a constant, whose value I have determined through trial and error, so that the output in the headphone is just undistorted. But I still feel the output is not loud enough.
Is there any way I can further increase the volume of the output, (preferably without distortion) either programmatically or using something else such as a bluetooth headset? I need the output to come through a headset, so I cannot use lodspeakers that plug into the wall outlets.