Can't boost mic volume (tried mixed_paths.xml and tinymix) - Android Q&A, Help & Troubleshooting

Phone NameAPI LevelJava VMKernelLineageOS VersionMagiscXiaomi Redmi 732 (Android 12L)2.1.04.9.333-LineageOS+19-20221204-NIGHTLY-oncliteYes, patched boot.img
The Problem​The microphone works fine on phone calls but sounds too quite on audio/video recordings. I tried to boost it by editing the mixed paths file and using tinymix tool but neither works.
Attempt 1: Editing the Mixed Paths File​The first thing I tried was editing the mixed_paths_mtp.xml file on the vendor partition as this is the only file available beginning with mixed_paths. After many trials and errors, I found that DEC2 is responsible for the mic volume. This is how it originally looks:
XML:
<ctl name="DEC1 Volume" value="84" />
<ctl name="DEC2 Volume" value="84" />
The Problem​Changing these to any value higher than 40 doesn't have any effect on the mic volume. It seems that only integers between 0 and 40 are accepted. If set to such a value, then I will have to scream to hear my voice in the recording.
Attemp 2: Using the tinymix​After some research, I found a binary tool named tinymix. It is a tool to change or view alsa mixer controls like amixer on PC.
The Problem​If I enter a value higher than 40, the following error shows up on adb root shell:
onclite:/ # tinymix 'DEC2 Volume' 41
Error: invalid value
Click to expand...
Click to collapse
Here is the output of another command:
onclite:/ # tinymix 'DEC2 Volume'
DEC2 Volume: 84 (dsrange 0->124)
Click to expand...
Click to collapse
My interpretation is that the valid range is between 0 and 124. If so, why won't it allow me to set it above 40?

Related

[Dev]Media_profiles.xml Configuration Values/Mod For Our X8 6/3/12

Aim:
This is for all people/dev/noob for posting and suggest a new media_profiles.xml configuration that suit our x8 the most...
The desired configuration must be,
1. No lag during recording, delay, stuck, Video/Audio interleave (Video and audio does not match each other).
2. Can be played on our x8 stock player.
3. Must be high quality enough/fine to be viewed.
4. The highest bit-rate available.
Okay, here is it, the media_profiles.xml configuration for all our X8
Code:
<MediaSettings>
<CamcorderProfiles>
<EncoderProfile quality="high" fileFormat="mp4" duration="60">
<Video codec="[COLOR="Red"]h264[/COLOR]"
bitRate="[COLOR="Red"]2500000[/COLOR]"
width="[COLOR="Red"]640[/COLOR]"
height="[COLOR="Red"]480[/COLOR]"
frameRate="[COLOR="Red"]30[/COLOR]" />
<Audio codec="[COLOR="Red"]aac[/COLOR]"
bitRate="[COLOR="Red"]128000[/COLOR]"
sampleRate="[COLOR="Red"]48000[/COLOR]"
channels="[COLOR="Red"]1[/COLOR]" />
</EncoderProfile>
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
<Video codec="[COLOR="Red"]h263[/COLOR]"
bitRate="[COLOR="Red"]70500[/COLOR]"
width="[COLOR="Red"]176[/COLOR]"
height="[COLOR="Red"]144[/COLOR]"
frameRate="[COLOR="Red"]15[/COLOR]" />
<Audio codec="[COLOR="Red"]armnb[/COLOR]"
bitRate="[COLOR="Red"]12200[/COLOR]"
sampleRate="[COLOR="Red"]8000[/COLOR]"
channels="[COLOR="Red"]1[/COLOR]" />
</EncoderProfile>
<ImageEncoding quality="[COLOR="Red"]99[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]99[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]99[/COLOR]" />
<ImageDecoding memCap="[COLOR="Red"]80000000[/COLOR]" />
<Camera previewFrameRate="0" />
</CamcorderProfiles>
<!--AAC and HQ encorder for shakira-->
<EncoderOutputFileFormat name="mp4" />
<EncoderOutputFileFormat name="3gp" />
<VideoEncoderCap name="[COLOR="Red"]h264[/COLOR]" enabled="true"
minBitRate="[COLOR="Red"]2500000[/COLOR]" maxBitRate="[COLOR="Red"]2500000[/COLOR]"
minFrameWidth="[COLOR="Red"]640[/COLOR]" maxFrameWidth="[COLOR="Red"]640[/COLOR]"
minFrameHeight="[COLOR="Red"]480[/COLOR]" maxFrameHeight="[COLOR="Red"]480[/COLOR]"
minFrameRate="[COLOR="Red"]30[/COLOR]" maxFrameRate="[COLOR="Red"]30[/COLOR]" />
<VideoEncoderCap name="[COLOR="Red"]h263[/COLOR]" enabled="true"
minBitRate="[COLOR="Red"]70500[/COLOR]" maxBitRate="[COLOR="Red"]70500[/COLOR]"
minFrameWidth="[COLOR="Red"]176[/COLOR]" maxFrameWidth="[COLOR="Red"]176[/COLOR]"
minFrameHeight="[COLOR="Red"]144[/COLOR]" maxFrameHeight="[COLOR="Red"]144[/COLOR]"
minFrameRate="[COLOR="Red"]15[/COLOR]" maxFrameRate="[COLOR="Red"]15[/COLOR]" />
<AudioEncoderCap name="[COLOR="Red"]aac[/COLOR]" enabled="[COLOR="Red"]true[/COLOR]"
minBitRate="[COLOR="Red"]128000[/COLOR]" maxBitRate="[COLOR="Red"]128000[/COLOR]"
minSampleRate="[COLOR="Red"]48000[/COLOR]" maxSampleRate="[COLOR="Red"]48000[/COLOR]"
minChannels="[COLOR="Red"]1[/COLOR]" maxChannels="[COLOR="Red"]1[/COLOR]" />
<AudioEncoderCap name="[COLOR="Red"]amrnb[/COLOR]" enabled="[COLOR="Red"]true[/COLOR]"
minBitRate="[COLOR="Red"]12200[/COLOR]" maxBitRate="[COLOR="Red"]12200[/COLOR]"
minSampleRate="[COLOR="Red"]8000[/COLOR]" maxSampleRate="8000"
minChannels="[COLOR="Red"]1[/COLOR]" maxChannels="[COLOR="Red"]1[/COLOR]" />
Click to expand...
Click to collapse
Note: This configuration is for Class 4 Sdcard only! Class 10 Sdcard would have higher write that could accept higher rate of incoming data... or
Our phone is limited to 2.5 MB/s due to CPU/GPU speed
-For who after edit got a bootloop, video recording gone white, there's is something wrong with your value...
-For who is going a bootloop, you got two option
-Restore
-Adb replace the file
For who is lazy enough Click thanks and download this
6/3/12 media_profile.zip
All people in xda is welcomed to use my mod as it credited and link to it.
Change Logs:
6/3/12
-Fixed no audio issue, it turn out i put 96000 sampling rate instead of 48000 Sorry guys
-Now you can record and play 2.5 mb/s @ 128 kb/s video audio without any problem...
5/3/12
-Added MMS low profile support to enable mms sending...
-The video will have very low quality to ensure video can keep up to 30 sec of recording.
-Blame GSM & 3GPP
-MMS low profile recording can record up to 30s (Thanks my effort for rebooting my phone a thousand time )
-Average bitrate for MMS low profile recording... 80 KB/s
-Link to this page and give credit pls
how about in fde 2.4.5,no overclock with 8gb & a class 4 sdcard...thanx...
daddy_rhon said:
how about in fde 2.4.5,no overclock with 8gb & a class 4 sdcard...thanx...
Click to expand...
Click to collapse
erm... i don't quite understand your question
CKKnot said:
erm... i don't quite understand your question
Click to expand...
Click to collapse
Rules of posting here....
1. State kernel that you used=stock kernel
2. State the rom you used=fde 2.4.5
3. Governor and Min - Max CPU
Speed=no overclock
4. State the SDCARD Class(R/W speed=8gb class4...
Are this clear enough...thanx for keep sharing...
daddy_rhon said:
Rules of posting here....
1. State kernel that you used=stock kernel
2. State the rom you used=fde 2.4.5
3. Governor and Min - Max CPU
Speed=no overclock
4. State the SDCARD Class(R/W speed=8gb class4...
Are this clear enough...thanx for keep sharing...
Click to expand...
Click to collapse
@daddy_rhon, this thread is about the files that alter the video recording of our x8.
my goal was to search for the perfect one to used with out x8
CKKnot said:
@daddy_rhon, this thread is about the files that alter the video recording of our x8.
my goal was to search for the perfect one to used with out x8
Click to expand...
Click to collapse
sorry my fault,i understand,thanx for the info...
daddy_rhon said:
sorry my fault,i understand,thanx for the info...
Click to expand...
Click to collapse
it's nvm, it will take a long time to becomming a pro also
So, folks there are no configuration that is better than this?
sorry for noob's question but how to insalt it
mabdullah007 said:
sorry for noob's question but how to insalt it
Click to expand...
Click to collapse
just install it though cwm
Its true ?
<AudioEncoderCap name="aac" enabled="true"
minBitRate="128000" maxBitRate="128000"
minSampleRate="48000" maxSampleRate="48000"
minChannels="1" maxChannels="1" /> minBitRate="128000" maxBitRate="128000"
minSampleRate="48000" maxSampleRate="48000"
minChannels="1" maxChannels="1" />
Click to expand...
Click to collapse
or this ?
<AudioEncoderCap name="aac" enabled="true"
minBitRate="128000" maxBitRate="128000"
minSampleRate="48000" maxSampleRate="48000"
minChannels="1" maxChannels="1" minBitRate="128000" maxBitRate="128000"
minSampleRate="48000" maxSampleRate="48000"
minChannels="1" maxChannels="1" />
Click to expand...
Click to collapse
I thisnk that in your xml ( /> ) is not true !!!
plz help
Thanks, this is a much welcomed initiative!
SinaH said:
Its true ?
or this ?
I thisnk that in your xml ( /> ) is not true !!!
plz help
Click to expand...
Click to collapse
i can't see what is wrong, the both are the same
@ ALL
Please edit and test this now, i have edited the configuration. See if you can attach it as MMS
CKKnot said:
Please edit and test this now, i have edited the configuration. See if you can attach it as MMS
Click to expand...
Click to collapse
yes now your XML file is true and work
Thread updated! Look for the first post for more info
-MMS supported! (Very low quality, limited to 30s recording)
-Perhapes the final version...
Thread updated! Look for the first post for more info
-MMS supported! (Very low quality, limited to 30s recording)
-Perhapes the final version...
Click to expand...
Click to collapse
thank you my friend
I test it on miniCM & GingerDX ROM .
Good work !
SinaH said:
thank you my friend
I test it on miniCM & GingerDX ROM .
Good work !
Click to expand...
Click to collapse
Your welcomed!
thanks for this
Hi CKKnot,
Is this working good for the X8? Good enough to be in the next MiniCM build?
Thanks.
Very thanks, i thinks its best configuration for custom rom but i still prefer to original x8 vid rec
like this (just for reference)
Code:
General
Complete name : G:\DCIM\100MSDCF\MOV00005.3gp
Format : MPEG-4
Format profile : 3GPP Media Release 4
Codec ID : 3gp4
File size : 73.4 MiB
Duration : 5mn 8s
Overall bit rate : 1 998 Kbps
Law rating : (empty)
Released date : 0
Classification : (empty)
Video
ID : 1
Format : MPEG-4 Visual
Format profile : [email protected]
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : 20
Duration : 5mn 8s
Bit rate mode : Constant
Bit rate : 2 000 Kbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 29.321 fps
Minimum frame rate : 1.767 fps
Maximum frame rate : 40.000 fps
Color space : YUV
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.222
Stream size : 72.8 MiB (99%)
Language : English
mdhd_Duration : 308034
Audio
ID : 2
Format : AMR
Format/Info : Adaptive Multi-Rate
Format profile : Narrow band
Codec ID : samr
Duration : 5mn 7s
Bit rate mode : Variable
Bit rate : 12.8 Kbps
Channel(s) : 1 channel
Sampling rate : 8 000 Hz
Bit depth : 13 bits
Stream size : 480 KiB (1%)
Writing library : pvmm
Language : English
mdhd_Duration : 307020
sory my english very bad

[HOW TO] WORKING screen mirroring ON ROOTED DEVICES, bypass HDCP and ALL of allshare

so here's the deal. trying to start screen mirroring on a rooted device in most cases HDCP will fail to initialize, when this happens screen mirroring will connect then disconnect with an error.
after a lot of research, logging and testing on my device I have found a way to bypass HDCP and also bypass Samsung restriction on allowing screen mirroring without HDCP.
HDCP is not a requirement for screen mirroring but Samsung has programmed the s4 to fail if the HDCP connection is not initialized. I have found that when the phone speaks to the miracast dongle the phone is programmed to force the setting of "Display service Type = HDMI" instead of allowing it to connect as Type = Wifi.
when the phone forces type = HDMI it makes screen mirroring fail if HDCP fails, this is a basic and enforced protocol of HDMI, this results in screen mirroring shutting off if HDCP fails, I believe this is Samsung's attempt to stop people from rooting their phones and also to stop people from using non Samsung dongles.
some people have found ways around this by hacking the HDCP lib files, but in my case this was not possible because I own a Sgh-i337 on mf3 with a locked bootloader.
unfortunately I can't post pictures so I can post my screen mirroring logs, but heres an explanation as to how this was accomplished.
First was to quarantine all Samsung Apps & services that were related to screen mirroring, this was an attempt to get the system to fall back to the native screen mirroring services and not use samsung's implementation.
I locked up:
Com.sec.allsharecastplayer
Com.samsung.shareshot
Samsung watch on
Samsung briefing
Allshare.controlShareService
Allshare.fileShareService
Samsung context provider
All Knox
Samsung MDM app
Allshare.service.mediaShare
Samsung apps
Samsung apps UNA2
Samsung apps widget
Samsung link
Samsung push
next I tried to find out a way to edit the DisplayManagerService's forced type of HDMI to change it to Type = Wifi, unfortunately because I was on Mf3, this couldn't be done.
but I was able to force this option with a build prop edit and last download and enable
https://play.google.com/store/apps/d...HOm-sQSyqoCgCA
Even if multi window plus doesnt work. Keep it for now untill I can trace down a setting change.
surprisingly after all this was done screen mirroring now works.
below I will post copies of my build prop and also the WFDConfig files from /system/ect
---- Build prop :
debug.sf.hw=0
debug.composition.7x27A.type=mdp
debug.composition.7x25A.type=mdp
dalvik.vm.heapsize=24m
debug.composition.type=dyn
persist.hwc.mdpcomp.enable=false
service.camera.gpu.enable=0
Debug.Disable.HWC=1
debug.sf.disablehwc=1
ro.display.switch=0
#dyn
# system props for the cne module
#
persist.cne.feature=0
#
# system props for the MM modules
#
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=false
media.stagefright.enable-fma2dp=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.enable-commonsource=true
media.stagefright.enable-rtsp=true
#
# system props for the LPA/TUNNEL
#
lpa.decode=true
tunnel.decode=true
lpa.use-stagefright=true
tunnel.audiovideo.decode=true
#
# system prop for opengles version
#
ro.opengles.version=131072
#
# system props for the data modules
#
ro.use_data_netmgrd=true
persist.data.ds_fmc_app.mode=0
#
# system props for IMS module
#
persist.ims.regmanager.mode=0
#
# System prop to disable strict mode flash on display
#
persist.sys.strictmode.visual=false
#
# System prop to enable/disable OMH. Enabled by default
#
persist.omh.enabled=1
#System prop to enable ehrpd capability
ro.config.ehrpd=true
# System property for cabl
ro.qualcomm.cabl=0
#
#
# Turn off tiled rendering
#
debug.enabletr=false
#
#property to enable user to access Google WFD settings.
#
persist.debug.wfd.enable=1
debug.wfd.enable=1
ext_only.debug=1
persist.sys.ext_only.debug=1
persist.sys.hwc.ext_only.debug=1
persist.sys.hwc.disable=1
#property to choose between virtual/external wfd display
#
persist.sys.wfd.virtual=0
#
# System prop for Tvout/HDMI
#
persist.sys.camera.transform=0
persist.sys.camera.connect=0
persist.sys.videomode=1
ro.hdmi.enable=false
------- WFDConfig. Xml
<WFDConfig>
<Capability>
<AudioLPCM>
<Name>LPCM</Name>
<Valid>1</Valid>
<Channels>2</Channels>
<SamplingFreq>48000</SamplingFreq>
<Latency>33</Latency>
</AudioLPCM>
<AudioAAC>
<Name>AAC</Name>
<Valid>1</Valid>
<Channels>2</Channels>
<SamplingFreq>48000</SamplingFreq>
<Latency>0</Latency>
</AudioAAC>
<AudioAC3>
<Name>AC3</Name>
<Valid>0</Valid>
<Channels>0</Channels>
<SamplingFreq>0</SamplingFreq>
<Latency>0</Latency>
</AudioAC3>
<VideoHeader>
<VideoMethod>1</VideoMethod>
<PreferredDisplaySupport>0</PreferredDisplaySupport>
<H264Profiles>1</H264Profiles>
<Valid>1</Valid>
</VideoHeader>
<CBP>
<VideoCodec>
<Profile>1</Profile>
<Level>1</Level>
<HorizontalResolution>1280</HorizontalResolution>
<VerticalResolution>720</VerticalResolution>
<Latency>0</Latency>
<MinimumSliceSize>0</MinimumSliceSize>
<SliceEncodingParams>0</SliceEncodingParams>
<FrameRateControlSupp>1</FrameRateControlSupp>
<VideoFps>30</VideoFps>
</VideoCodec>
</CBP>
<StandbyResumeCapability>
<Valid>1</Valid>
</StandbyResumeCapability>
<!--
IDR interval is to trigger an IDR request from sink.
This can be applcable only to sink. IDRInterval is in msec
-->
<IDRRequest>
<Valid>0</Valid>
<IDRInterval>0</IDRInterval>
</IDRRequest>
<AVFormatChange>
<Valid>0</Valid>
<AVInterval>0</AVInterval>
</AVFormatChange>
<!--
Frame skipping interval is in the scale of 500 msec/half second.
FrameInterval can be between 1 to 7, according to the WFD spec.
-->
<FrameSkipping>
<Valid>0</Valid>
<FrameInterval>0</FrameInterval>
</FrameSkipping>
<ContentProtection>
<HDCPValid>0</HDCPValid>
<Version>WFD_HDCP_2_1</Version> <!-- Valid values WFD_HDCP_2_0 and WFD_HDCP_2_1 -->
<CPPort>6789</CPPort>
<EncryptAudio>0</EncryptAudio> <!-- Valid values 0 / 1 to indicate Audio encryption or not -->
</ContentProtection>
<RTPDumpEnable>
<Valid>0</Valid>
</RTPDumpEnable>
<BufferCtrlEnable>
<Valid>1</Valid>
</BufferCtrlEnable>
<UIBC>
<UIBCValid>1</UIBCValid> <!-- 0/1 UIBC supported or not -->
<InputCategory>
<Generic>1</Generic> <!-- 0/1 - support generic or not -->
</InputCategory>
<InputEvents>
<GenericInputEvents>
<Mouse>1</Mouse> <!-- 0/1 for all Input Event Types -->
<Keyboard>1</Keyboard>
<SingleTouch>1</SingleTouch>
<MultiTouch>1</MultiTouch>
<JoyStick>0</JoyStick>
<Camera>0</Camera>
<Gesture>0</Gesture>
<RemoteControl>1</RemoteControl>
</GenericInputEvents>
</InputEvents>
<TcpPort>4321</TcpPort>
</UIBC>
</Capability>
---- Capability. Xml
<Capability>
<AudioLPCM>
<Name>LPCM</Name>
<Valid>1</Valid>
<Channels>2</Channels>
<SamplingFreq>48000</SamplingFreq>
<Latency>33</Latency>
</AudioLPCM>
<AudioAAC>
<Name>AAC</Name>
<Valid>1</Valid>
<Channels>2</Channels>
<SamplingFreq>48000</SamplingFreq>
<Latency>0</Latency>
</AudioAAC>
<AudioAC3>
<Name>AC3</Name>
<Valid>0</Valid>
<Channels>0</Channels>
<SamplingFreq>0</SamplingFreq>
<Latency>0</Latency>
</AudioAC3>
<VideoHeader>
<VideoMethod>1</VideoMethod>
<PreferredDisplaySupport>0</PreferredDisplaySupport>
<H264Profiles>1</H264Profiles>
<Valid>1</Valid>
</VideoHeader>
<CBP>
<VideoCodec>
<Profile>1</Profile>
<Level>1</Level>
<HorizontalResolution>1280</HorizontalResolution>
<VerticalResolution>720</VerticalResolution>
<Latency>0</Latency>
<MinimumSliceSize>0</MinimumSliceSize>
<SliceEncodingParams>0</SliceEncodingParams>
<FrameRateControlSupp>1</FrameRateControlSupp>
<VideoFps>30</VideoFps>
</VideoCodec>
</CBP>
<CHP>
<VideoCodec>
<Profile>2</Profile>
<Level>1</Level>
<HorizontalResolution>800</HorizontalResolution>
<VerticalResolution>480</VerticalResolution>
<Latency>0</Latency>
<MinimumSliceSize>0</MinimumSliceSize>
<SliceEncodingParams>0</SliceEncodingParams>
<FrameRateControlSupp>1</FrameRateControlSupp>
<VideoFps>30</VideoFps>
</VideoCodec>
</CHP>
<StandbyResumeCapability>
<Valid>1</Valid>
</StandbyResumeCapability>
<!--
IDR interval is to trigger an IDR request from sink.
This can be applcable only to sink. IDRInterval is in msec
-->
<IDRRequest>
<Valid>0</Valid>
<IDRInterval>0</IDRInterval>
</IDRRequest>
<AVFormatChange>
<Valid>0</Valid>
<AVInterval>0</AVInterval>
</AVFormatChange>
<!--
Frame skipping interval is in the scale of 500 msec/half second.
FrameInterval can be between 1 to 7, according to the WFD spec.
-->
<FrameSkipping>
<Valid>0</Valid>
<FrameInterval>0</FrameInterval>
</FrameSkipping>
<ContentProtection>
<HDCPValid>0</HDCPValid>
<Version>WFD_HDCP_2_1</Version> <!-- Valid values WFD_HDCP_2_0 and WFD_HDCP_2_1 -->
<CPPort>6789</CPPort>
</ContentProtection>
<RTPPortType>
<ConnectionType>0</ConnectionType> <!-- 0 - UDP ,1 - TCP -->
</RTPPortType>
<RTPDumpEnable>
<Valid>0</Valid> <!-- Enable RTP Dump Valid = 1 or Valid = 0-->
</RTPDumpEnable>
<UIBC>
<UIBCValid>0</UIBCValid> <!-- 0/1 UIBC supported or not -->
<InputCategory>
<Generic>1</Generic> <!-- 0/1 - support generic or not -->
</InputCategory>
<InputEvents>
<GenericInputEvents>
<Mouse>1</Mouse> <!-- 0/1 for all Input Event Types -->
<Keyboard>1</Keyboard>
<SingleTouch>1</SingleTouch>
<MultiTouch>1</MultiTouch>
<JoyStick>1</JoyStick>
<Camera>0</Camera>
<Gesture>0</Gesture>
<RemoteControl>1</RemoteControl>
</GenericInputEvents>
</InputEvents>
<TcpPort>4321</TcpPort>
</UIBC>
</Capability>
I claim no responsibility for you changing files on your own phone, this fixed took me about a month of constant work and if you change the wrong files it may brick your phone.
I have had a 90% success rate with connecting when I connect Right after restarting the phone.
Restart, and as soon as your lock screen comes up. Unlock your phone and connect to your dongle. Then you will have clean connects.
If ive helped you fix screen mirroring
And you would like to thank me.... buy me a coffee
PayPal: [email protected]
Or you can just patch the lib files like it was done here: http://forum.xda-developers.com/showthread.php?t=2621550

[Q] Connecting USB Sound Device(esp. Microphone) to Android

Hello,
I hope that this is the right Forum section where I can ask my question. If it is the wrong place, I would be pleased if the Mods can place it in the right Forum.
So to my Problem now
I am trying for hours without any luck, so before I spend another day resolving the problem without solution, I am trying my luck here
I have an Android Device with rooted Omnirom kitkat that have no internal microphone built in. So I was hoping to connect any sort of usb microphone as default android audio input device that can be used for google voice for example.
I connected a Logitech webcam that has a built in microphone.
The usb audio device of the webcam get well recognized by the OS:
Code:
cat /proc/asound/cards
gives me
Code:
0 [SMDKI2S ]: SMDK-I2S - SMDK-I2S
SMDK-I2S
1 [U0x46d0x819 ]: USB-Audio - USB Device 0x46d:0x819
USB Device 0x46d:0x819 at usb-s5pv210-1.2, high speed
So the hardware device I would like to use, has the number 1 and it's name is U0x46d0x819.
Code:
cat /proc/asound/devices
gives me
Code:
0: [ 0] : control
16: [ 0- 0]: digital audio playback
24: [ 0- 0]: digital audio capture
32: [ 1] : control
33: : timer
56: [ 1- 0]: digital audio capture
So the mic is also detected as digital audio capture.
When I connect the webcam I get in /proc/asound/card1/ the following entries:
id
stream0
usbbus
usbid
usbmixer
usbmixer has the following content (some sort of controls):
Code:
USB Mixer: usb_id=0x046d0819, ctrlif=2, ctlerr=0
Card: USB Device 0x46d:0x819 at usb-s5pv210-1.2, high speed
Unit: 5
Control: name="Mic Capture Volume", index=0
Info: id=5, control=2, cmask=0x0, channels=1, type="S16"
Volume: min=768, max=6912, dBmin=300, dBmax=2700
Unit: 5
Control: name="Mic Capture Switch", index=0
Info: id=5, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
When connecting the Webcam I get under /dev/snd/ two new devices:
controlC1 and pcmC1D0c
When I try the mic with this app (link) where I can choose the usb audio device to test it, I get cristal clear recording! So it is working from the hardware point of view.
My issue now is how can I get that sound device configured to be the default mic for all apps in android?
I've read that it has to do with asound.conf or audio_policy.conf files in /system/etc, but I have absolutly no idea how they can be configured correctly.
May be it is a very basic question for all the modders and dev gurus out there, so thanks for any help for taking time pointing me to the right direction.:good:
Did you ever get this to work?
I have the same issue.
I created the /system/etc/asound.conf but the Android 4.4-r3 seems to be ignoring the config file.

KGL Unit + USB DAC SABRE ES9023

Following the instructions below, I managed to get my USB DAC to work. I will attach the drivers that worked for me.
aluver said:
So, I am glad to say, we have USB Audio (DACs) support now.
If you want to build a serious car sound system, you have to make a digital out to your amp (or DSP) instead of using our head units line outs.
I will try to write in more detail and more simply as to repeat it.
For the redirection of all sounds of the Android to your USB device (a sound card, DAC) it is necessary:
1. To be convinced that a system's kernel version is 3.0.36+ . The version of a firmware can be any. At me I was KLD-1.98 and 4.2.2. But despite it I pulled out driver modules from a tablet firmware on the Android 4.4.2.
2. Get root, root explorer and Android terminal emulator.
3. Copy by root explorer USB Audio support modules *.ko from the applied archive in /system/lib/modules/, and set them permissions to 0644.
4. It is obligatory to try loading modules manually from the terminal exactly in that order:
Code:
[email protected]:/ $ su
[email protected]:/ # insmod /system/lib/modules/snd-hwdep.ko
[email protected]:/ # insmod /system/lib/modules/snd-rawmidi.ko
[email protected]:/ # insmod /system/lib/modules/snd-usbmidi-lib.ko
[email protected]:/ # insmod /system/lib/modules/snd-usb-audio.ko
If the device reboots at execution of this commands, these drivers don't suit to you (though probability of it is small as our HU are identical)
If system silently swallowed your commands - everything normally, we go further.
5. Connect your USB device to one of the back USB ports intended for 3G/Wifi (as we surely need port with support of USB-host).
6. In the terminal enter the following commands and check your device, what number it was defined.
Code:
[email protected]:/ # ls dev/snd
controlC0
controlC1
controlC2
pcmC0D0c
pcmC0D0p
pcmC1D0p
[COLOR="Red"]pcmC2D0c
pcmC2D0p[/COLOR]
timer
[email protected]:/ # cat /proc/asound/cards
0 [RK29WM8731 ]: RK29_WM8731 - RK29_WM8731
RK29_WM8731
1 [RKHDMII2S ]: RK-HDMI-I2S - RK-HDMI-I2S
RK-HDMI-I2S
[COLOR="red"]2 [Headset ]: USB-Audio - Plantronics Headset
Plantronics Plantronics Headset at usb-usb20_host-1.3, full speed[/COLOR]
[email protected]:/ #
Apparently from replies of system, my test Plantronics headset received the address pcmC2D0p - that is Card 2 Device 0. Remembered these figures. Due to the identical architecture of our HU, I think, it will be similar for all of us.
7. To make modules *.ko were loaded at each start of a system, it is necessary to copy by root explorer install-recovery.sh script from archive to /system/etc/install-recovery.sh, set permissions 0755.
8. For providing the redirection of a sound to our USB device it is necessary to deceive system. For this purpose it is necessary to replace number of the device (card) in file /system/lib/hw/audio.primary.rk30board.so. You need find 'pcmC0D0p' string and change it to your remembered value (pcmC2D0p, I think so). It is best of all to make it on the computer by any binary files editor. But I put already my edition of the audio.primary.rk30board.so file with pcmC2D0p value. Don't forget to set it permission 0644. And it is obligatory to make a backup of the original file for ability to return to an initial state.
Click to expand...
Click to collapse
At step 7. my unit looses root capability, therefore I created a script that runs after boot with Script manager.
The script contains the following:
insmod /system/lib/modules/snd-hwdep.ko
insmod /system/lib/modules/snd-rawmidi.ko
insmod /system/lib/modules/snd-usbmidi-lib.ko
insmod /system/lib/modules/snd-usb-audio.ko
At step 8, I didn't find that PCM in my unit so I used another audio.primary.rk30board.so file. I will attach it below.
Problems:
After the sound was rerouted to the DAC, I discovered that I can't control the volume.
Therefore, I bought USB AUdio Player PRO. Now I can control volume, but only from the app, the buttons still doesn't work.
!!!!!! I want to change the tracks from the buttons + SWC and the volume too.
I tried Headunit app, but it doesn't do anything with this player.
PS: Viper4Android doesn't work with this app too.
Instead, Viper4Android works with stock musicplayer but I can't control the volume over HiFimeDIY Sabre USB DAC ES9023 96kHz/24bit
PS2: After I start the USB Audio Player PRO App, I get no sound in other applications. If I don't start that app, I get sound in stock Music Player, Youtube, PowerAmp, etc.
Excellent!
I have found that I can control the volume with the following command:
alsa_amixer -c N cset numid=X Y
Click to expand...
Click to collapse
Where:
N is the number of the card
X is the option corresponding to the volume
y is the value of the volume
In my case, maximum volume is 110 and minimum is 0
Example of command in my case:
alsa_amixer -c 2 cset numid = 2 100
Click to expand...
Click to collapse
Can someone please make a widget/app or integrate it somehow in Headunit so that I can control the volume?
I would be very grateful.
R4D3N said:
I have found that I can control the volume with the following command:
Where:
N is the number of the card
X is the option corresponding to the volume
y is the value of the volume
In my case, maximum volume is 110 and minimum is 0
Example of command in my case:
Can someone please make a widget/app or integrate it somehow in Headunit so that I can control the volume?
I would be very grateful.
Click to expand...
Click to collapse
Here is my edition of last version (2.15) of RK3066-Headunit-service
My edition is able to change the volume levels of DAC and HU together - in same percentage.
DAC volume is changing by command:
Code:
alsa_amixer -c2 sset 'PCM' X%
where 2 - is a card number of DAC (for our HU is always 2)
PCM is the name of alsa volume simple control of Sabre U2 (and many others DACs too)
X% - the value of volume, % - always equal to internal volume of HU, that calculating from 0...30 to 0...100 "exponentialy" by microntek service.
And by the way it also can switch folders/albums in Poweramp through API-commands NEXT_IN_CAT / PREVIOUS_IN_CAT (my wheel buttons codes for it - 61, 62; yours may be different).
I wrote to petrows (developer of this RK3066-Headunit-service) about this modification and asked him to include this functionality to next versions.
Thank you very much. It works but now I have another problem.
After 10-15 minutes, the volume control stops working. It remains or at maximum volume or at the last volume that was set up.
Any ideas how to fix this?
I gues sthe problem is that your volume knob does not control android's volume but send commands to MCU.
Could you try using "Volume+" App to control volume if that works?
Volume+ doesn't work over my DAC.
Headunit does, but after 15 minutes stops working, but if I clear data or restart the Headunit application it works again for 15 minutes.
Any ideas?
PS: SHould I give special permissions to Headunit app? Before it was 0777 and now I am trying with 0644 and I will get back with review.
R4D3N said:
Thank you very much. It works but now I have another problem.
After 10-15 minutes, the volume control stops working. It remains or at maximum volume or at the last volume that was set up.
Any ideas how to fix this?
Click to expand...
Click to collapse
I have had this problem, but only once. Not depends from time in my case. Fixed by reboot too. I think you need to check the direct capability of alsa_amixer to change the dac volume from terminal when it happened again.
Code:
su
alsa_amixer -c2 sset 'PCM' 50%
If it will work, i think the problem is your SU is only for 15 minutes for application. Check your root preferences.
---------- Post added at 07:51 PM ---------- Previous post was at 07:44 PM ----------
dark alex said:
I gues sthe problem is that your volume knob does not control android's volume but send commands to MCU.
Could you try using "Volume+" App to control volume if that works?
Click to expand...
Click to collapse
Our RK3066 HU doesn't have this functional - android volume change is blocked by ROM. Tried this some time earlier.
Alsa mixer was used on this reason. Service just catches microntek MCU volume changes and sends alsa_amixer commands with the same value of volume in %.
How do I check my root preferences?
aluver said:
Code:
su
alsa_amixer -c2 sset 'PCM' 50%
If it will work, i think the problem is your SU is only for 15 minutes for application. Check your root preferences.
.
Click to expand...
Click to collapse
This works so the problem is my root preferences.
then you have to change it in superuser (or SuperSU - depending) app.
I tried but It won't appear in Superuser because when I run it, it doesn't prompt for Root Privilleges, it just runs. How can I manually add it to Superuser?
PS: I am using Malaysk's latest firmware for RK3188.
I installed SuperSU, i granted permanent SuperUser for Headunit but I have the same problem. After a while, the volume control stops working. It works again only if I reboot or if I clear data of the Headunit program.
Ideas?
R4D3N said:
I installed SuperSU, i granted permanent SuperUser for Headunit but I have the same problem. After a while, the volume control stops working. It works again only if I reboot or if I clear data of the Headunit program.
Ideas?
Click to expand...
Click to collapse
When you clear data of the Headunit program, it restarts. So, you just give it 15 min of work with root-access again. Try to delete in SuperSU access rule for this service and reboot. When it will ask for root, give it permanent root. Or you can choose in SuperSU permanent root for all applications.
Thank you very much. I got that working too, I now I have only one problem.
Everytime I power one the unit or when it powers from sleep the volume is at 100% and after I press the volume button it changes at the value on the screen.
Is there a way the set set the default volume as MUTE or 10% ?
Any idea?
If this happens after cold start too, I have the one idea only. Your sevice is starting too early, before the DAC determined by system. Check your startup sequences scripts.
Insmod-commands must be at first positions of install-recovery.sh
mtcservice must be launched by install-recovery-2.sh
There is no problem for me with Malaysk fw #23.
default install-recovery-2.sh from there:
Code:
#dsa
lsd () {
to=$1
shift
for i in $*; do
if [ -d $i ]; then
i=${i%/}
j=${i##*/}
if [ "${j#com.tomtom.*}" != "$j" ]; then
k=$((k+1))
j=$to/$j
if [ -n "`ls $j`" ]; then continue; fi
mkdir -p $j
if mount | grep "$j "; then umount $j; fi
mount -o bind $i $j
else
lsd $to $i/*/
fi
fi
done
}
{
IFS=${IFS#??}
while ! mount | grep "/mnt/internal_sd "; do sleep 1; done
ck=0
while true; do
k=0
#########################################################################
### lsd syntax: ###
### First argument is the target (internal) folder. ###
### Further arguments make a list of source (external) storage paths. ###
### If any com.tomtom.* folder is found in any source path tree, ###
### it will be (bind) mounted under the target folder. ###
#########################################################################
lsd /mnt/internal_sd/tomtom /mnt/external_sd*/*/ /mnt/usb_storage*/*/
if [ $k -gt 0 ]; then
ck=0
sleep 20
continue
fi
if [ $ck -ge 90 ]; then
sleep 30
else
ck=$((ck+1))
sleep 1
fi
done
} >/dev/null 2>&1 &
getpid () {
ps | busybox sed -n "/busybox sed -n/! s/[^ ]* *\([0-9]*\).*$1.*/\1/p"
}
while true; do
pid=`getpid maxmpz`
if [ -z "$pid" -o "$pid" != "$pap" ]; then
om=0
st=0
while true; do
st=$((st+1))
nm=`mount | grep usb_storage | busybox wc -l`
if [ $nm -ne $om ]; then
om=$nm
st=0
else
if [ $st -gt 3 ]; then
if [ $nm -gt 0 ]; then
usb=1
break
fi
if [ -z "$usb" ]; then
break
fi
st=0
fi
fi
if [ $nm -gt 0 ]; then
sleep 1
else
sleep 3
fi
done
while ! am startservice -a com.maxmpz.audioplayer.API_COMMAND --ei cmd 3; do sleep 1; done
sleep 2
pap=`getpid maxmpz`
fi
pid=`getpid petrows`
if [ -z "$pid" ]; then
while ! am startservice com.petrows.mtcservice/.ServiceMain; do sleep 1; done
sleep 1
fi
sleep 10
done &
As you can see startservice com.petrows.mtcservice exists here by default.
I have just replaced old mtcservice apk by new own edition.
PS: Answer with quotes please, because it's the only way to get an E-mail notification for me. I visit this place very rarely.
Does anyone use any RCA mixer or other stuff with DAC to use the built in BT handsfree and FM radio? If I understand good need to connect the DAC and the head unit's RCA outputs to the amplifier in same time.
I found this: Rolls MX22A it is an active mixer, or a passive diy mixer good enough for us?
Or anybody tired the Behringer UCA202/UCA222? It has RCA input and monitor output.
I haven't got any DAC, so I can't try it, but thinking of buying one.
peti007 said:
Does anyone use any RCA mixer or other stuff with DAC to use the built in BT handsfree and FM radio? If I understand good need to connect the DAC and the head unit's RCA outputs to the amplifier in same time
Click to expand...
Click to collapse
If you want to built SQ system, don't do this. This way is wrong - you'll loose the sound quality your DAC gives. Just leave one pair of speakers (coax at rear?) plugged to front speaker outs of your HU and all dirt will live there with BT and radio. You'll CAN hear sound from them, when you need that, but the noise from line outs of HU shouldn't be mixed to your clear music stream
The real music must be at front only: 2-way, 3-way, with sub, etc.
aluver said:
If you want to built SQ system, don't do this. This way is wrong - you'll loose the sound quality your DAC gives. Just leave one pair of speakers (coax at rear?) plugged to front speaker outs of your HU and all dirt will live there with BT and radio. You'll CAN hear sound from them, when you need that, but the noise from line outs of HU shouldn't be mixed to your clear music stream
The real music must be at front only: 2-way, 3-way, with sub, etc.
Click to expand...
Click to collapse
If I listen to FM radio, the HU's RCA out sounds and the DAC is muted, if I listen to music over DAC the HU's RCA is muted.
Maybe I'm wrong, but if I connect the HU's front RCA out and the DAC's RCA out to the RCA mixer in the same time, it doesn't mean they both sound in the same time. There is noise on the HU's RCA too when no sound came out from it?

[ROOT][MOD] Amazing Sound Improvement (DAC Cirrus Logic CS43130)

Hello All,
prerequisites:-
SuperRoot / Magisk Root
Root explorer like solid, es explorer..etc
This mod actually removes the limitation in built-in amplifier in DAC.
Go to Root->System->Etc->mixer_gains.xml
Go and make changes as shown below
<patch name = "gain-media-headset">
<ctrl name = "HPOUT2L Impedance Volume" value = "123" />
<ctrl name = "HPOUT2L Input 1 Volume" value = "36" />
<ctrl name = "HPOUT2R Input 1 Volume" value = "36" />
Save & Reboot
This Mod actually disable powersaving mode
Go to Root->System->Etc->sapa_feature.xml
Go and make changes as shown below
<support name = "support_powersaving_mode" value = "false" />
Save & Reboot
Finally, Download & Install latest Poweramp Beta (with HD HI-Res output support)
Credit to JaguarSergio
What does disabling the power saving do, I mean I don't have it activated in the settings?
there isn't mixer_gains.xml in s8+. it has all the mixer_paths.....

Categories

Resources