[Q] Create a radio player for your android phone - Other Tools & General Discussion

hi guys,
In my area the range of FM stations is from 88 to 132 but my phone only supports 88 to 100 khz so i was thinking of make an application to override the 100 khz limit. Any idea where i should start

If your phone (hardware) only supports 88-100 kHz (MHz?) it doesn't matter how many applications you're developing.
You should check out developer.android.com, stackoverflow.com and Google.

Related

HTC Streaming Media Video Size/Bitrate

Hi guys
im testing a new service from my provider, kinda ''live TV'' Service.
I figuret out to allow my phone a HD2 changing the browser ID to a android phone,
that are allowed from my provider.
Now the problem:
when im connectet via 3G/HSPA i get a ugly video quality (tried to disable provider Proxy, no difference)
with WLAN a excellent one
I saw in the properties:
Bitrate 567, Codec H.264 ACC, dimesion 400 x 224 with WLAN
Bitrate 31, MPEG-4 AMR-NB, 176 x 144, over HSPA
Is there a setting to force the higher settings? I didnt find it in the settings, and played
arounnd in the Reg. found only 1 setting that change something.
VideoShouldCIFSize, when i cange the value from 1 to 0, the pic gone smaller.
Its a setting or is the stream server that decide what a codec and size?
surely i can provide the rtsp link but coz the service gonna be launched in the next
few days i cant spread the Link here.
Thanks u Guys, i know somebody have a answer out there
__________________

[ROM] [6.0.1] Unofficial CyanogenMod 13 - Jiayu S3 plus

CyanogenMod 13 is a free, community built distribution of Android 6.0.1 (Marshmallow) which greatly extends the capabilities of your phone.
This is the unofficial Build of CM 13 for Jiayu S3 plus (not advanced or basic), with mt6753 soc
​
Code:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
Installation Instructions:
Download rom from here: https://www.facebook.com/MediatekAndroidDevelopers/
OR from xda DevDB (DOWNLOAD Tab)
Download Gapps from OpenGapps: http://opengapps.org/, choose Arm64 and Android 6.0
boot to recovery
wipe data if you are not coming from CM13.0 already
install rom and gapps
reboot
XDA:DevDB Information
Cyanogenmod for Jiayu S3 plus, ROM for all devices (see above for details)
Contributors
DerTeufel1980, superdragonpt, fire855
Source Code: https://github.com/MediatekAndroidDevelopers
ROM OS Version: 6.0.x Marshmallow
ROM Kernel: Linux 3.10.x
ROM Firmware Required: custom recovery installed
Version Information
Status: Stable
Created 2016-07-26
Last Updated 2016-07-26
Reserved
Reserved
Q: After ROM boot up, I'm getting SetUP wizard errors / other Gapps FC / Black screen on first boot, why ?
A: On marshmallow based Roms, you need to flash ROM and gapps at the same time
TWRP even allows you to flash multiple .zip files
Q: Why no Mediatek Engineering Menu?
A: Its Mediatek proprietary, ugly , not needed on our builds.
Relevant features used on Mediatek E. Menu have been ported to our builds already using aosp / our implementations ( Sensors calibration , Band Mode, etc)
Q: Do we get The Fast Charge you guys made on Lollipop RC's ?
A: Yes, Fast Charge implementation was implemented on our MM builds
Q: App "x" is not working, why?
A: First make sure the app works under Marshmallow
Q: Something wrong with my Bluetooth, can't connect /pair with my "x" device , car-BT
A: Bluetooth should be backwards compatible , some OEMs don't also follow some guidelines , surely can be improved.
Post your BT model, Car model and year to help us out determining compatibility issues
Woot! Glad to see this up and running Thanks for all the support!
Full CM13 Android in Mediatek phone. Thank you
edit: fixedd
Hi, first of all I would like to say thank u for all your hardwork
I have came across on the specifications page for Mediatek's MT6753 well which was our chipset anyway.
http://www.mediatek.com/en/products/mobile-communications/smartphone1/mt6753/
The CPU clock speed stated on the page was 1.5ghz. Ours was max clocked at 1.3ghz?
Is there any possibility, (not sure if our mtk kernel source is open) that we could get a speedboost, a step up of 200mhz for our cpu?
Or was the 1.5ghz version is already stable and has a chance to boost it up to MT6572's 1.7ghz as well.
I would be glad if anyone can enlighten me about this. Thank you.
Thankyou!!!!
@superdragonpt
Not sure if this is the right thread to report issues of the ROM.
1. Bluetooth not pairing with car. It can detect the headunit but when I try to pair after i enter the pin it fails. I am using the headunit for mitsubishi mirage 2013
Mirage CNE-6515-N HU Specs:
Main Amplifier:
Power Output: 20 Watts RMS x 4 channels into 4-ohms @ < 10 % THD+N
S/N Ratio: 70 dBA below reference. (Ref.: 1 Watt, 4-ohms)
Max Power: 40 x 4 watts into 4-ohms, all channels driven
Frequency Response: 20 Hz to 20 kHz -3dB Aux input used as source reference
3 Band Equalizer (Treble, Mid, Bass)
Reference Supply Voltage: 14.4 VDC
DVD/CD Player:
Compatible Formats: DVD-R, , DVD-RW, DVD+R, DVD+RW, CD-R, CD-RW, CD-DA, MP3, WMA, HDCD, SVCD,VCD, MPEG, JPEG, MP3/WMA burned into a DVD+RW or DVD-RW and CD-R/RW
S/N Ratio: 85 dBA
Dynamic Range: > 95 dB
Frequency Response: 20 Hz to 20 kHz, -3dB
Channel Separation: > 60dB @ 1 KHZ
D/A Converter(s): 6-channels high performance 24-bit, 192 kHz, multi-bit Sigma Delta modulation. DAC supports sample rates from 8-192 kHz.
Electronic Skip Protection (ESP): DVD: 2-3 sec, CD-DA: 10 sec., MP3: 100 sec., WMA: 200 sec. (ESP time approximate)
Mechanical vibration stability: 10-200Hz, X/Y/Z direction: 1.0G
Video Section:
Format: NTSC, PAL (auto-detect)
Output: 1Vp-p (75-ohm), buffered
Input: 1Vp-p (75-ohm)
FM Tuner Section:
Tuning Range: 87.5 MHz - 107.9 MHz
Mono Sensitivity (-30dB): 10 dBu
Quieting Sensitivity (-50dB): 15 dBu
Alternate Channel Sensitivity: 70 dB
S/N Ratio @ 1KHz: 58 dB
Image Rejection: 60 dB
Stereo Separation @ 1 KHz; 30dB
Frequency Response: 30Hz - 15 KHz, -3 dB
AM Tuner Section:
Tuning Range: 530 kHz - 1710 kHz
Sensitivity (-20dB): 20 dBu
S/N Ratio @ 1KHz: 50 dB
Image Rejection: 60 dB
Frequency Response: 50Hz - 2 KHz, -3 dB
Monitor Section:
Screen Size: 6.2" (Measured diagonally)
Screen Type: TFT Digital Display active matrix
Response Time: 30 ms rise time, 50 ms fall tim/Compositee resolution, DVD
Video in: 280,280 sub pixels, 1200 (W) x 234 (H)
Built-in Navigation (Via Micro SD Card)
SD Card: Micro SD
GPS
SiRF Prima 600MHZ CPU, Advanced ARM 11 Architecture
256 MB Nand Flash ​
256 MB DDR-400MHz RAM
Windows CE 6.0
USB
High-Speed USB 2.0
Bluetooth:
Hands-Free, Phonebook, Recent Calls (Dialed, Missed, Received) Synchronize, Caller ID and Audio Streaming, Mobile Phone
TPMS Ready (optional)
General:
Auxiliary Input impedance: 10 K-ohms
Power Supply: 10.5 to 16 VDC, negative ground
Fuse: 10-amp, mini ATm type
DN chassis dimensions : 7"x7"x 2" (178mm x 178mm x 100mm)
2. When SD card is used as "Internal Storage" and app is installed at SD card, every time I reboot all the shortcut icon disappears in Home Screen.
3. FB Messenger hangs when uploading pictures. Workaround grant permissions via Settings > App > Messenger
makona said:
@superdragonpt
Not sure if this is the right thread to report issues of the ROM.
1. Bluetooth not pairing with car. It can detect the headunit but when I try to pair after i enter the pin it fails. I am using the headunit for mitsubishi mirage 2013
Mirage CNE-6515-N HU Specs:
Main Amplifier:
Power Output: 20 Watts RMS x 4 channels into 4-ohms @ < 10 % THD+N
S/N Ratio: 70 dBA below reference. (Ref.: 1 Watt, 4-ohms)
Max Power: 40 x 4 watts into 4-ohms, all channels driven
Frequency Response: 20 Hz to 20 kHz -3dB Aux input used as source reference
3 Band Equalizer (Treble, Mid, Bass)
Reference Supply Voltage: 14.4 VDC
DVD/CD Player:
Compatible Formats: DVD-R, , DVD-RW, DVD+R, DVD+RW, CD-R, CD-RW, CD-DA, MP3, WMA, HDCD, SVCD,VCD, MPEG, JPEG, MP3/WMA burned into a DVD+RW or DVD-RW and CD-R/RW
S/N Ratio: 85 dBA
Dynamic Range: > 95 dB
Frequency Response: 20 Hz to 20 kHz, -3dB
Channel Separation: > 60dB @ 1 KHZ
D/A Converter(s): 6-channels high performance 24-bit, 192 kHz, multi-bit Sigma Delta modulation. DAC supports sample rates from 8-192 kHz.
Electronic Skip Protection (ESP): DVD: 2-3 sec, CD-DA: 10 sec., MP3: 100 sec., WMA: 200 sec. (ESP time approximate)
Mechanical vibration stability: 10-200Hz, X/Y/Z direction: 1.0G
Video Section:
Format: NTSC, PAL (auto-detect)
Output: 1Vp-p (75-ohm), buffered
Input: 1Vp-p (75-ohm)
FM Tuner Section:
Tuning Range: 87.5 MHz - 107.9 MHz
Mono Sensitivity (-30dB): 10 dBu
Quieting Sensitivity (-50dB): 15 dBu
Alternate Channel Sensitivity: 70 dB
S/N Ratio @ 1KHz: 58 dB
Image Rejection: 60 dB
Stereo Separation @ 1 KHz; 30dB
Frequency Response: 30Hz - 15 KHz, -3 dB
AM Tuner Section:
Tuning Range: 530 kHz - 1710 kHz
Sensitivity (-20dB): 20 dBu
S/N Ratio @ 1KHz: 50 dB
Image Rejection: 60 dB
Frequency Response: 50Hz - 2 KHz, -3 dB
Monitor Section:
Screen Size: 6.2" (Measured diagonally)
Screen Type: TFT Digital Display active matrix
Response Time: 30 ms rise time, 50 ms fall tim/Compositee resolution, DVD
Video in: 280,280 sub pixels, 1200 (W) x 234 (H)
Built-in Navigation (Via Micro SD Card)
SD Card: Micro SD
GPS
SiRF Prima 600MHZ CPU, Advanced ARM 11 Architecture
256 MB Nand Flash ​
256 MB DDR-400MHz RAM
Windows CE 6.0
USB
High-Speed USB 2.0
Bluetooth:
Hands-Free, Phonebook, Recent Calls (Dialed, Missed, Received) Synchronize, Caller ID and Audio Streaming, Mobile Phone
TPMS Ready (optional)
General:
Auxiliary Input impedance: 10 K-ohms
Power Supply: 10.5 to 16 VDC, negative ground
Fuse: 10-amp, mini ATm type
DN chassis dimensions : 7"x7"x 2" (178mm x 178mm x 100mm)
2. When SD card is used as "Internal Storage" and app is installed at SD card, every time I reboot all the shortcut icon disappears in Home Screen.
3. FB Messenger hangs when uploading pictures. Workaround grant permissions via Settings > App > Messenger
Click to expand...
Click to collapse
1- Known issue, thanks for the BT unit details
2- already answered
3- seems you find the cause, FB apps sucks... Thank them
Sorry guys but what is this?
http://www.needrom.com/download/s3-cm13-0/
It's baptized CM13. 0 from JiaYu.de for S3plus.
Is it other Rom, or someone tries to play it "smart" to the community?
TapaTalk and JiaYu S3 with Android MM!
Having used this for a few days now I love it however I have discovered one bug and one suggestion for better quality of life.
Bug: The aeroplane mode in the power menu (press and hold power button) doesn't work. The tile in the drop down menu still works fine, just the power menu one doesn't.
Quality of Life: Currently there is no way of disabling both sims, one always has to be enabled. Not a big deal for most people, but as someone who travels between countries quite frequently, it would be nice to be able to switch one sim off before putting on the other to avoid any possible roaming charges.
Thanks again for all the support, I was also wondering what version of Xposed would work with CM13?
Regards,
Hey, sorry, I missed your pm.
I need to check airplane mode.... Didn't notice yet.
The other thing isn't meant to be done this way in aosp. I may take a look at it as well, but I can't promise...
The M.A.D. Team
DerTeufel1980 said:
Hey, sorry, I missed your pm.
I need to check airplane mode.... Didn't notice yet.
The other thing isn't meant to be done this way in aosp. I may take a look at it as well, but I can't promise...
The M.A.D. Team
Click to expand...
Click to collapse
No bother I only noticed the airplane mode thing when I was trying to activate it boarding my flight haha
Wow, so this is what you meant when you said
DerTeufel1980 said:
Yeah, I started working for a German section of Chinese smartphone manufacturer (jiayu.de). Didn't have time anymore....
Click to expand...
Click to collapse
Good job anyways!
Update:
https://www.facebook.com/MediatekAndroidDevelopers/
Build 2 : 20160810
Source Synced ( (including Security Updates )
Fixed: Bluetooth (headset , car-BT)
Fixed: Internal Android VPN Client (tested on PPPT protocol)
Fixed Wi-Fi (random connection drops)
Added option to select 2.4 or 5Ghz Wifi frequency to advanced wifi options
Fixed FMRadio (merged previous patch)
Rom link on xda DevDB as well
cheers
Latest twrp recovery, compiled from source:
https://www.androidfilehost.com/?fid=24591000424954599
- fix: mounting adoptable storage
- fix: mounting encrypted devices
The M.A.D. Team
still hoping for an update for this rom Found bugs: Music playback lag and video playing lags.. can't play 1080p videos
Everything is perfect but the BT-CAR....
Its a Citroen C-Elysée 2014

Improve Bluetooth audio quality on headphones without aptX or LDAC

The test is over. I'm no longer accepting libraries to patch.
SBC XQ Feature is available in LineageOS 15.1 build created on or after the 31st of March 2019, or a 16.0 build created on or after the 13th of May 2019.
Many note low sound quality and lack of high frequencies when using the standard SBC Bluetooth codec, which is supported by all headphones and other Bluetooth devices. A common recommendation to get better sound quality is to buy devices and headphones with aptX or LDAC codecs supported. These codecs require licensing fees, so devices with them are more expensive.
It turns out that the low quality of SBC is caused by artificial limitations of all current Bluetooth stacks and headphones' configuration, and this limitation can be circumvented on any existing devices.
Everyone interested in Bluetooth audio, please take part in high-bitrate SBC compatibility testing on various headphones, receivers, stereo systems, or automotive head units.
If the vast majority of devices work with high bitrates, I will make a patch for Android and send it to AOSP and third-party ROMs, and high quality Bluetooth audio will be available to everyone on any headphones and smartphones, regardless of codecs with licensing fees.
Short technical information about SBC codec
SBC has lots of different parameters that are negotiated during the connection setup phase:
Audio channel type and number: Joint Stereo, Stereo, Dual Channel, Mono;
Number of frequency bands: 4 or 8;
Number of audio blocks in one packet: 4, 8, 12, 16;
Quantization bit allocation algorithm: Loudness, SNR;
Maximum and minimum bit pool used in quantization process: usually 2-53.
The decoder is required to support any combination of these parameters. Encoder may implement only a part of them.
Existing Bluetooth stacks usually negotiate the following profile: Joint Stereo, 8 bands, 16 blocks, Loudness, bitpool 2..53. This profile encodes 44.1 kHz audio with a bitrate of 328 kbps.
Bitpool parameter directly affects the bitrate within the same profile: the higher it is, the higher the bitrate, and hence the quality.
However, the bitpool parameter is not bound to a specific profile. The bitrate is also significantly affected by other parameters: audio channel type, number of frequency bands, number of audio blocks. You can increase the bitrate indirectly by negotiating non-standard profiles, without changing the bitpool.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For example, Dual Channel encodes channels separately, using the entire bitpool for each channel. Forcing the device to use Dual Channel instead of Joint Stereo will get us almost doubled bitrate at the same maximum bitpool, 617 kbps.
To me it feels that bitpool should be an internal variable. It is an A2DP specification design fault that bitpool value is not bound to other codec parameters and only defined as a global value.
These fixed Bitpool and Bitrate values originate from recommended values for high-quality audio. But the recommendation is not an excuse to limit the profile to these values.
A2DP specification v1.2, which was active from 2007 to 2015, requires all decoders to work correctly with bitrates up to 512 kbps:
The decoder of the SNK shall support all possible bitpool values ​​that do not result in the excess of the maximum bit rate. This profile limits the available maximum bit rate to 320kb/s for mono, and 512kb/s for two-channel modes.
Click to expand...
Click to collapse
In the new version of the specification there is no bitrate limitation. It is assumed that modern headphones released after 2015 with EDR can support bitrates up to 730 kbps.
For some reason, all currently tested Bluetooth stacks (Linux (PulseAudio), Android, Blackberry and macOS) have artificial restrictions of maximum bitpool parameter, which directly affects the maximum bitrate. But this is not the biggest problem, almost all headphones also limit the maximum bitpool value to 53.
As I've already seen in my tests, most devices work fine on a modified Bluetooth stack with a bitrate of 507 kbps, without interrupts and crackling. But such a bitrate will never be negotiated under normal conditions, with stock Bluetooth stacks.
How to test on a PC
High bitrate SBC headphone compatibility test is the easiest to perform on the PC with a Bluetooth adapter. I've prepared Ubuntu image with a modified Bluetooth stack, which can be run as in a virtual machine (by connecting Bluetooth adapter as a USB device inside the virtual machine, it also works with the adapters built into the laptops) or by booting from the USB flash drive. This image uses the following profile: Dual Channel, 8 bands, 16 blocks, Loudness, bitpool 2..41, 44.1 kHz, which provides 485 kbps bitrate.
See the attachment in the end of this post.
Running in a VM
Download Virtualbox and Virtualbox Extension Pack: https://www.virtualbox.org/wiki/Downloads;
Install Virtualbox, start it;
Install Extension Pack using File → Preferences → Extensions;
Create new virtual machine: Linux, Ubuntu (64-bit), 1024 RAM. Do not create a HDD.
Navigate to virtual machine settings, in Storage choose Controller: IDE, Empty, press CD icon → Choose virtual optical disk file;
Select downloaded bluetooth-dualchannel-test-ubuntu-18.04.1-desktop-amd64.iso;
Save and close settings window, start virtual machine;
Right-click USB cable icon in the bottom right, select your Bluetooth adapter;
Running on a PC
The image supports BIOS/CSM and UEFI booting.
Burn the image to a USB flash drive using Etcher: https://etcher.io/. This operation will delete all existing files on a USB drive.
Turn off the PC;
Insert USB flash drive, turn on the PC and press boot order button (usually Esc or F12);
Select your USB flash drive.
Performing the test
(optional but recommended) Double click on "Btsnoop Dump" script on the desktop. It will start Bluetooth data capture for later analysis. Do not close terminal window.
Switch the headphones to pairing mode;
Click to the arrow in top right corner, select Bluetooth icon → Bluetooth Settings;
Choose your headphones, wait until pairing is complete and close the window;
Set Ubuntu volume to about 2/3. Also decrease volume using headset buttons as it could be very loud after pairing.
Open "music" folder, play "testrecord1.flac";
(optional but recommended) Close player, close terminal window. This will stop data capture.
(optional but recommended) Open Firefox browser, upload data dump (btsnoop_hci.btsnoop on the desktop) to https://btcodecs.valdikss.org.ru/
You can listen to other music in the music folder, or upload your own;
Post in this topic your headphone model and test results.
There should be no cracklings, audio interruption or other sound distortion in the headphones. If you hear a good high-quality sound, that means your headphones support audio with a bit rate of 485 kbps.
If you upload data to the server, please carefully follow the algorithm above. Especially, if you power off the headphones or disconnect after pairing, it's important to connect to the headphones manually from the bluetooth settings, do not allow auto connection!
How to test on Android device
In order to test from Android smartphone or tablet you need to use modified Bluetooth stack, which requires root privilege.
For regular users
Use PC method if possible.
Create backup before overwriting bluetooth library. Some patched libraries are attached to this post.
Unrestricted/unlimited versions negotiate Dual Channel mode and disable bitrate restriction (617-660 kbit/s will be used). Versions with 482 or 486 prefix negotiate 474-485 kbit/s.
For ROM developers (Android 5-7)
Patchset which increases maximum Bitpool value and adds Bluetooth Dual Channel option is available using the following link:
LineageOS 14.1 (Android 7.1.2)
The following information is outdated and is kept only for historical reasons:
Code:
[b]These modifications are designed only for test and should not be applied to the main ROM repository![/b]
[b]If you're a ROM developer, please provide flashable modified bluetooth library if possible![/b]
These modifications should be applied to stock Android bluetooth stacks Bluedroid (Android 5) and Fluoride (Android 6-7). Qualcomm-modified stack is not supported.
[b]1. Replace Joint Stereo with Dual Channel in standard SBC configuration[/b]
[url="https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/btif/co/bta_av_co.c#99"][i]android/platform/external/bluetooth/bluedroid/btif/co/bta_av_co.c:99[/i][/url]
[code]const tA2D_SBC_CIE btif_av_sbc_default_config =
{
BTIF_AV_SBC_DEFAULT_SAMP_FREQ, /* samp_freq */
A2D_SBC_IE_CH_MD_JOINT, /* ch_mode */
A2D_SBC_IE_BLOCKS_16, /* block_len */
A2D_SBC_IE_SUBBAND_8, /* num_subbands */
A2D_SBC_IE_ALLOC_MD_L, /* alloc_mthd */
BTA_AV_CO_SBC_MAX_BITPOOL, /* max_bitpool */
A2D_SBC_IE_MIN_BITPOOL /* min_bitpool */
};
Replace A2D_SBC_IE_CH_MD_JOINT with A2D_SBC_IE_CH_MD_DUAL.
2. Increase Dual Channel priority
android/platform/external/bluetooth/bluedroid/btif/co/bta_av_co.c:411
Code:
if (src_cap.ch_mode & A2D_SBC_IE_CH_MD_JOINT)
pref_cap.ch_mode = A2D_SBC_IE_CH_MD_JOINT;
else if (src_cap.ch_mode & A2D_SBC_IE_CH_MD_STEREO)
pref_cap.ch_mode = A2D_SBC_IE_CH_MD_STEREO;
else if (src_cap.ch_mode & A2D_SBC_IE_CH_MD_DUAL)
pref_cap.ch_mode = A2D_SBC_IE_CH_MD_DUAL;
else if (src_cap.ch_mode & A2D_SBC_IE_CH_MD_MONO)
pref_cap.ch_mode = A2D_SBC_IE_CH_MD_MONO;
Move if with A2D_SBC_IE_CH_MD_DUAL to the top.
3. Disable or increase bitrate restriction
Android bluetooth stack has not only bitpool limit, but also bitrate limit, 328 kbit/s. If the headphones support, for example, bitpool 53 for 48 kHz, Android will decrease the bitpool down to fit into 328 kbit/s limit. This will happen AFTER codec negotiation, on the encoding stage, do not take into account bitpool value in Bluetooth SetCapabilities packet.
android/platform/external/bluetooth/bluedroid/btif/src/btif_media_task.c:172
Code:
#define DEFAULT_SBC_BITRATE 328
Replace with 512.
4. (for experiments only) Disable MTU limit.
This is required for bitrates higher than ~580 kbit/s.
btif/src/btif_media_task.c:174
Code:
/* 2DH5 payload size of 679 bytes - (4 bytes L2CAP Header + 12 bytes AVDTP Header) */
#define MAX_2MBPS_AVDTP_MTU 663
[/code]
For ROM developers (Android 8-9)
Patchset which increases maximum Bitpool value and adds Bluetooth Dual Channel option is available using the following links:
LineageOS 15.1 (Android 8.1)
LineageOS 16.0 (Android 9)
AOSP Master (what will eventually become Android 9.1/10)
If you're a ROM developer, please provide flashable modified bluetooth library if possible!
The following information is outdated and is kept only for historical reasons:
1. Add Dual Channel support into A2DP SBC Source
/platform/system/bt/stack/a2dp/a2dp_sbc.cc:55
Code:
/* SBC SRC codec capabilities */
static const tA2DP_SBC_CIE a2dp_sbc_caps = {
A2DP_SBC_IE_SAMP_FREQ_44, /* samp_freq */
(A2DP_SBC_IE_CH_MD_MONO | A2DP_SBC_IE_CH_MD_JOINT), /* ch_mode */
(A2DP_SBC_IE_BLOCKS_16 | A2DP_SBC_IE_BLOCKS_12 | A2DP_SBC_IE_BLOCKS_8 |
A2DP_SBC_IE_BLOCKS_4), /* block_len */
A2DP_SBC_IE_SUBBAND_8, /* num_subbands */
A2DP_SBC_IE_ALLOC_MD_L, /* alloc_method */
A2DP_SBC_IE_MIN_BITPOOL, /* min_bitpool */
A2DP_SBC_MAX_BITPOOL, /* max_bitpool */
BTAV_A2DP_CODEC_BITS_PER_SAMPLE_16 /* bits_per_sample */
};
add A2DP_SBC_IE_CH_MD_DUAL in ch_mode.
2. Replace Joint Stereo with Dual Channel in default config
/platform/system/bt/stack/a2dp/a2dp_sbc.cc:82
Code:
/* Default SBC codec configuration */
const tA2DP_SBC_CIE a2dp_sbc_default_config = {
A2DP_SBC_IE_SAMP_FREQ_44, /* samp_freq */
A2DP_SBC_IE_CH_MD_JOINT, /* ch_mode */
A2DP_SBC_IE_BLOCKS_16, /* block_len */
A2DP_SBC_IE_SUBBAND_8, /* num_subbands */
A2DP_SBC_IE_ALLOC_MD_L, /* alloc_method */
A2DP_SBC_IE_MIN_BITPOOL, /* min_bitpool */
A2DP_SBC_MAX_BITPOOL, /* max_bitpool */
BTAV_A2DP_CODEC_BITS_PER_SAMPLE_16 /* bits_per_sample */
};
Replace A2DP_SBC_IE_CH_MD_JOINT with A2DP_SBC_IE_CH_MD_DUAL.
3. Increase Dual Channel priority
/platform/system/bt/stack/a2dp/a2dp_sbc.cc:1155
Code:
static bool select_best_channel_mode(uint8_t ch_mode, tA2DP_SBC_CIE* p_result,
btav_a2dp_codec_config_t* p_codec_config) {
if (ch_mode & A2DP_SBC_IE_CH_MD_JOINT) {
p_result->ch_mode = A2DP_SBC_IE_CH_MD_JOINT;
p_codec_config->channel_mode = BTAV_A2DP_CODEC_CHANNEL_MODE_STEREO;
return true;
}
if (ch_mode & A2DP_SBC_IE_CH_MD_STEREO) {
p_result->ch_mode = A2DP_SBC_IE_CH_MD_STEREO;
p_codec_config->channel_mode = BTAV_A2DP_CODEC_CHANNEL_MODE_STEREO;
return true;
}
if (ch_mode & A2DP_SBC_IE_CH_MD_DUAL) {
p_result->ch_mode = A2DP_SBC_IE_CH_MD_DUAL;
p_codec_config->channel_mode = BTAV_A2DP_CODEC_CHANNEL_MODE_STEREO;
return true;
}
if (ch_mode & A2DP_SBC_IE_CH_MD_MONO) {
p_result->ch_mode = A2DP_SBC_IE_CH_MD_MONO;
p_codec_config->channel_mode = BTAV_A2DP_CODEC_CHANNEL_MODE_MONO;
return true;
}
return false;
}
Move if with A2DP_SBC_IE_CH_MD_DUAL to the top.
4. Increase bitrate limit
/platform/system/bt/stack/a2dp/a2dp_sbc_encoder.cc:42
Code:
#define A2DP_SBC_DEFAULT_BITRATE 328
Replace with 512.
5. (for experiments only) Disable MTU limit
This is required for bitrates higher than ~580 kbit/s.
/platform/system/bt/stack/a2dp/a2dp_sbc_encoder.cc:47
Code:
#define MAX_2MBPS_AVDTP_MTU 663
[/code]
For advanced users and ROM developers (Android 5-7 binary patch)
Please refer to this post in Russian (use Google Translate): https://4pda.ru/forum/index.php?s=&showtopic=914135&view=findpost&p=76169677
How to capture Bluetooth data dump on Android
Turn off Bluetooth;
In Developer Settings, enable the "Enable Bluetooth HCI snoop log" switch;
Turn on Bluetooth, connect to your headset using Bluetooth menu (this is important! Do not allow auto connection!);
Play short audio sample;
Open developer settings, disable the "Enable Bluetooth HCI snoop log" switch;
There should be /storage/emulated/0/btsnoop_hci.log or /data/misc/bluetooth/logs/btsnoop_hci.log created. If it's missing, open /etc/bluetooth/bt_stack.conf with a text editor and see the path in BtSnoopFileName option.
Upload btsnoop_hci.log to https://btcodecs.valdikss.org.ru/;
Post in this topic your headphone model and test results.
There should be no cracklings, audio interruption or other sound distortion in the headphones. If you hear a good high-quality sound with the patched library, that means your headphones support audio with a bit rate of 512 kbps.
If you upload data to the server, please carefully follow the algorithm above. Especially, if you power off the headphones or disconnect after pairing, it's important to connect to the headphones manually from the bluetooth settings, do not allow auto connection!
Some of the files attached below have no MTU limit patched. Unlocked/unrestricted versions most probably will introduce cracklings.
Tested devices
Devices which support at least 512 kbit/s SBC
1MORE iBFree
JBL Everest 310
JBL Everest 700
JBL T110BT
JBL E55BT
JBL T460BT
JBL Endurance SPRINT (Claim to not support Dual Channel, but work if forced. Does not conform to A2DP specification.)
Skullcandy HESH 3
SoundPEATS Q30
Sony WH-H900N
Sony WI-C400
Sony MDR-1ABT
Sony MDR-ZX770BT
Sony MDR-ZX770BN
Sony MDR-XB650BT
Sony MDR-XB950B1
Sony SBH50
SVEN AP-B570MV
Syllable G600
Bluedio A/Air (Claim to not support Dual Channel, but work if forced. Does not conform to A2DP specification.)
Bluedio T4s (Bitpool max 39. Claim to not support Dual Channel, but work if forced, 462 kbit/s. Does not conform to A2DP specification.)
Bluedio T5 (Claim to not support Dual Channel, but work if forced. Does not conform to A2DP specification.)
Bluedio T6 (Claim to not support Dual Channel, but work if forced. Does not conform to A2DP specification. Adopt Max 97220 chipset.)
Marshall Major II Bluetooth
Overdrive RealForce D1
DEXP BT-210
DEXP BT-220
DEXP BT-250
DEXP BT-260
DEXP BT-280
Edifier W288BT
Edifier W830BT
Nomi BT 211
LeEco Le Sports BT
Xiaomi MI Portable Bluetooth Speaker
Xiaomi Square Box Bluetooth Speaker 2
Sennheiser HD 4.40BT
AKG K845BT
Beyerdynamic Amiron Wireless
Bowers & Wilkins PX
Bowers & Wilkins Zeppelin Wireless
House of Marley Liberate XLBT
Harman Kardon Onyx Studio 4
Harman Kardon Aura Studio 2
QCY QY8
Panasonic RP-BT10
Jaybird X3
Logitech BT Adapter
TP-Link HA100
Xiaomi Mi Bluetooth Audio Receiver
Overfly Portable Bluetooth Receiver
KZ Wireless Bluetooth Module
Excelvan B7
Hagibis X2
Pioneer SE-E7BT
Automotive DAC Lusya bluetooth 4.0 with AK4490, NE5532
Noname automotive head unit (CSR8645 chip)
Sony DSX-A400BT automotive head unit
Devices which support SBC higher than 512 kbit/s
JBL Everest 310 (617-660 kbps)
JBL T110BT (576 kbps)
JBL Endurance SPRINT (573 kbps)
SoundPEATS Q30
DEXP BT-210 (617 kbps)
DEXP BT-220 (617 kbps)
DEXP BT-260 (617 kbps)
DEXP BT-280 (617 kbps)
Sony WI-C400 (576 kbps)
Sony MDR-ZX770BT (617-660 kbps)
Sony MDR-ZX770BN
Marshall Major II Bluetooth (617-660 kbps)
Overdrive RealForce D1 (730 kbps, dual channel, 4 subbands)
Jaybird X3
QCY QY8 (617 kbps)
Edifier W288BT (617 kbps)
Panasonic RP-BT10 (596 kbps)
LeEco Le Sports BT (617 kbps)
Nomi BT 211 (617 kbps)
Xiaomi Mi Bluetooth Audio Receiver (576 kbps)
Overfly Portable Bluetooth Receiver (617 kbps)
Automotive DAC Lusya bluetooth 4.0 with AK4490, NE5532 (576 kbps)
Devices which don't work with higher bitrates or Dual Channel
Harper HB-202 (cracklings; Beken BK3256 chip)
Sony Ericsson MW600 (high frequency distortion, cracklings; device from 2009)
Sony SBH52 (too slow to handle packet rate)
BlitzWolf BW-F2 (no sound)
Overfly mini Bluetooth receiver (no sound)
Why this is important: SBC 328k and 485k vs aptX
Contrary to popular belief of aptX sound quality, in some cases it can produce worse audio quality than SBC with a standard 328k bitrate.
SBC dynamically allocates quantization bits for frequency bands, acting on a "bottom-to-top" basis. If the whole bitrate was used for the lower and middle frequencies, the upper frequencies are "cut off" (silenced).
aptX quantizes frequency bands with the same number of bits constantly, which makes it a constant bitrate codec: 352 kbps for 44.1 kHz, 384 kbps for 48 kHz. It can't "transfer bits" to frequencies that are mostly needed in them. Unlike SBC, aptX will not "cut" frequencies, but will add quantization noise to them, reducing the dynamic range of audio, and sometimes introducing crackles. SBC, on the contrary, "eats the details" - discards the quietest areas.
On average, compared to SBC 328k, aptX makes less distortion in music with a wide frequency range, but on music with a narrow frequency range and a wide dynamic range SBC 328k sometimes wins.
Let us consider a special case, a piano recording. Here's a spectrogram:
The most energy lies in the 0-4 kHz frequencies, and lasts up to 10 kHz.
The spectrogram of the file aptX file looks like this:
Here is SBC 328k:
It can be seen that the SBC 328k periodically completely cut off the range above 16 kHz, and used all available bitrates for ranges below this value. However, aptX introduced more distortions into the frequency spectrum audible by the human ear, which can be seen on the subtracted original spectrogram from the aptX spectrogram (the brighter, the more distortion):
While the SBC 328k has introduced less distortion the signal in the range from 0 to 10 kHz, and the rest has been сut:
Bitrate 485k for SBC was enough to save the entire frequency range, without cutting off the bands.
SBC 485k on this audio sample is much better than aptX in the range of 0-15 kHz, and with a smaller but still noticeable difference - at 15-22 kHz (the darker, the less distortion):
Switching to a high-bitrate SBC, you will get a sound superior to aptX most of the time, on any headphones.
Bro. The concepts sound amazing.
I have Le Max 2 (Oreo). I have attached Bluetooth .so files.
If you patch I will try on Sony Bluetooth system and share with my friends patched files to see how much it works.
Thanks.
rohit3192 said:
Bro. The concepts sound amazing.
I have Le Max 2 (Oreo). I have attached Bluetooth .so files.
If you patch I will try on Sony Bluetooth system and share with my friends patched files to see how much it works.
Thanks.
Click to expand...
Click to collapse
For some reason I can't download your file, always get 404 not found. Another person with LeEco LeMax 2 (x820) contacted me and I made a patch, but only for 32-bit library. Since your archive is >2 MB, I suppose it contains 32 and 64 bit libraries. Please write your exact OS version and build number.
Would you mind to try? Backup your files first, replace 32-bit library with the file from the archive and rename 64-bit library, so it won't be used, and follow the instructions in the second post to capture the dump and upload it to btcodecs.
OK .
I try. Allow me some time.
Yes both libs were in one file. Now sending you separate libs.
rohit3192 said:
OK .
I try. Allow me some time.
Yes both libs were in one file. Now sending you separate libs.
Click to expand...
Click to collapse
Try these.
I have replaced file in /system/lib with permission.
And renamed /lib64 file as instructed.
Bluetooth switch doing nothing.
After renaming lib64 to original name the Bluetooth switch works and connects.
Build no attached.
rohit3192 said:
I have replaced file in /system/lib with permission.
And renamed /lib64 file as instructed.
Bluetooth switch doing nothing.
After renaming lib64 to original name the Bluetooth switch works and connects.
Build no attached.
Click to expand...
Click to collapse
Please try the latest archive. It includes patched 64 bit libraries.
The new patched 64bit file worked.
Tried 486 one only.
Here is Bluetooth log. (Upload was too slow at given link so sending GD link)
Post edited: thanks @ValdikSS a lot.
rohit3192 said:
Here is Bluetooth log. (Upload was too slow at given link so sending GD link)
Click to expand...
Click to collapse
Yes, it worked, the bitrate is 485 kbit/s. Did you hear any cracklings or interruptions?
The audio you played is of low quality. That's probably an MP3 ~160-192 kbit/s?
There is no crackling. Yes mp3 was of low quality that I tested.
Yet sound seems improved. I will need more time to get proper impression. I will post later here.
Also I have spread the word in few telegram channels.
Thanks
@op here you have my lib from Huawei P9 Android 7.0
Can you check and modded to test. I be test on my LG HBS910 with aptx
https://mega.nz/#!G3gR3RrC!yNysYtkk1DhlBk-ec87bIP56aupCwKvfiWM1k32Qy7k
chudy_85 said:
@op here you have my lib from Huawei P9 Android 7.0
Can you check and modded to test. I be test on my LG HBS910 with aptx
Click to expand...
Click to collapse
Patched version has been added to the second post.
This sound enhancement is only for SBC codec, it won't do anything with aptX. You should disable aptX to test patched version.
Hello
I have 1more ibfree sport headphone that supports AAC HD codec only with apple devices as company has mentioned in their site. (https://india.1more.com/collections...ore-ibfree-sport-bluetooth-earphones-with-mic)
As in your post you have mentioned 1more ibfree, that support aptx codec .
My headphone is newer version of ibfree series.
So the problem is in developer setting I can't change to AAC from SBC codec.
It stays to SBC only so I think I can get help from here from you.
So here the link to those .so files
https://mega.nz/#F!tj5AlahL!yCrNHYB-ft-zaJl2uc7kig
Phone - Le Max2 Lineage Oreo 8.1
AdityaDharewa said:
Hello
So the problem is in developer setting I can't change to AAC from SBC codec.
It stays to SBC only so I think I can get help from here from you.
Phone - Le Max2 Lineage Oreo 8.1
Click to expand...
Click to collapse
Please capture a dump and upload it to https://btcodecs.valdikss.org.ru, you'll see all codec information which the device supports.
And by the way, patched libraries for Le Max2 Oreo are already in the second post, give them a try.
ValdikSS said:
For regular users
Send me your bluetooth stack libraries: /system/lib/hw/bluetooth.default.so and /system/lib64/hw/bluetooth.default.so (if it exists).
Click to expand...
Click to collapse
Hmmm those files don't exist on my device (Pixel 2 XL, Pie 9.0 stock OS)
LeifAlbor said:
Hmmm those files don't exist on my device (Pixel 2 XL, Pie 9.0 stock OS)
Click to expand...
Click to collapse
/system/lib/libbluetooth.so and /system/lib64/libbluetooth.so for Android 9.
ValdikSS said:
/system/lib/libbluetooth.so and /system/lib64/libbluetooth.so for Android 9.
Click to expand...
Click to collapse
Done

[APP][Android 4.0+] Anti Mosquito

Hi,
Here you can test my new app Android:
Title : Anti Mosquito
Anti Mosquito is a free application that allows mosquitoes to escape by emitting high frequency sounds inaudible to humans!
The application is very simple, you can activate or deactivate the anti mosquito with a simple On / Off button.
You have the choice of the frequencies among these:
- 8 kHz
- 10 kHz
- 12 kHz
- 14 kHz
- 15 kHz
- 16 kHz
- 17 kHz
- 18 kHz
- 19 kHz
- 20 kHz
- 21 kHz
- 22 kHz
It is normal that you will not hear certain frequencies, but the application emits a sound that is noticeable by mosquitoes.
✪✪ How does it work? ✪✪
1) Press the On / Off button to activate the mosquito repellent
2) Choose the frequency sound you want the application to emit by clicking on it
3) At this time, the anti mosquito is operational and will loop a high frequency sound
4) To stop the anti mosquito, simply click on the On / Off button
5) When you want to switch to another frequency, first press the frequency that is playing and then press another frequency
5a) Example: I pressed the 10 kHz frequency to activate it. If I want to test the frequency 12 kHz, I first press the frequency 10 kHz to stop it, then I press the 12 kHz frequency to activate it on it.
Google Play : https://play.google.com/store/apps/details?id=com.sospc95.Anti_Moustique
Install it and test it
Thanks
Nice icon! I think it made your app popular
Thanks
Sounds nice. I never knew that you can use a simple android app to fight against mosquitoes. I am living near the forest, and in the summer we are literally attacked by mosquitoes. My dad bought a Mosquito Magnet to deal with them, and this thing seems to help. By the way, I have an interesting question. What should I do if I have an iPhone? Are there similar apps on the IOS system, or you can use these apps only on android. I am really curious about this. I am waiting for your message.
I can sorta imagine Anti Mosquito 2.0 - an app that plays Scary Monsters and Nice Sprites from Youtube. /s

ViPER4Android Phone Speaker EQ Profile

This is an EQ profile for v4a's EQ bands from a moto g6 plus running Android Pie and Dolby audio in Music mode. Taken with a Dayton EMM6 with Room EQ Wizard. I have Impulse Responses (for convolution) for the same target curves but can't link to them because of XDA rules.
House curve target (1.8dB/octave rise from 100Hz to 20Hz, 1.8dB/octave fall from 1 kHz to 20 kHz):
The house curve sounds warmer than the flat curve.
Frequency Gain
31 Hz 12.0 dB
63 Hz 10.8 dB
125 Hz 8.5 dB
250 Hz -4.1 dB
500 Hz -2.3 dB
1 kHz -11.6 dB
2 kHz 2.8 dB
4 kHz -1.5 dB
8 kHz -9.3 dB
16 kHz 12.0 dB
Flat target:
Frequency Gain
31 Hz 12.0 dB
63 Hz 10.8 dB
125 Hz 8.5 dB
250 Hz -4.1 dB
500 Hz -2.2 dB
1 kHz -12.0 dB
2 kHz 4.4 dB
4 kHz -0.8 dB
8 kHz -1.4 dB
16 kHz 12.0 dB

Categories

Resources