Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 17 Oct 2017, 18:46
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to edit audio_policy.conf in Android Lollipop
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Author Message
amigo

Joined: 02 Apr 2007
Posts: 2593

PostPosted: Fri 08 Jan 2016, 14:32    Post subject:  

Still, there very well may be a way to make it do what you want through configuration files. Yeah, you'll need root to do that, if going around the official UI's, but you can also unroot it after making changes. That about Marshmallow and the sdcard can probably also be changed by editing one of the fstab files. Although I prefer my older versions of android as they are more malleable.
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Sat 16 Jan 2016, 18:08    Post subject:  

Android audio architecture
https://source.android.com/devices/audio/
Android audio architecture.png
 Description   
 Filesize   75.31 KB
 Viewed   337 Time(s)

Android audio architecture.png

Back to top
View user's profile Send private message 
Semme


Joined: 07 Aug 2011
Posts: 7775
Location: World_Hub

PostPosted: Sat 16 Jan 2016, 18:38    Post subject:  

So Nubc, gonna "root" or not?
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Sat 16 Jan 2016, 23:39    Post subject:  

If rooting was just a trick to get into the Admin account, I would likely do this. But rooting is actually installing another ROM, all of which, by the way, do not implement Mono Audio Output. As stated on the preceding page, Android devs have the unavoidable task of providing mono audio to a single earbud because of the new traffic law in California applying to 38.5 million residents. That sounds like the implementation of Mono Audio is forthcoming, in which case the fix would be distributed in legitimate updates or upgrades to Android. I investigated what I can do with admin privileges, and frankly it ain't much, since there is very little demand for Mono Audio in the geek community.
Last edited by nubc on Tue 29 Mar 2016, 14:36; edited 2 times in total
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2593

PostPosted: Sun 17 Jan 2016, 05:13    Post subject:  

"rooting is actually installing another ROM" This not true at all. Most modified ROM's are pre-rooted. But rooting simply means having the 'su' program installed and there are several ways to accomplish that without any further changes to your ROM.

su can be installed by using any one of several one-click root apps, like framaroot, kingoroot or towelroot. These apps try to take advantage of known kernel vulnerabilities in order to escalate privileges and then use the privilege to install su.

Another way is to install a root app by applying an update while booted into the recovery system. I prefer this method as it is less intrusive(potentially). It is alos safer because if something is wrong with the package, recovery will abort the process.

You can also boot to recovery and then adb to sideload the update from your computer.

In order to install any ROM, your device must already be rooted. Installing one of the alternate ROM's like CWM or TWRP makes future mods much easier as they contain extra functionality, like letting you install unsigned updates and more.

The update-from-recovery method can be very useful -you can even have an update which doesn't really install anything, but the update-binary includes extra functionality -like a file manager -in the case of the AROMA installer.

The recovery system is like a small initrd which can contain anything you want. The recovery images use only C programs, so there is no java or dalvik present.

Be brave, be root!
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Sun 27 Mar 2016, 21:02    Post subject:  

The upcoming version Android N, due out this Summer 2016, will implement Mono Audio under the Sound heading in Settings.

Android Headlines
http://www.androidheadlines.com/2016/03/android-n-will-allow-playback-of-audio-in-mono.html

image: Mono Audio in Settings under Sound (Android N)
http://imgur.com/VM1vM3m

@ amigo
Thanks for sharing the rooting methodology. Very interesting, and will keep it for future reference.
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Mon 28 Mar 2016, 12:38    Post subject:  

I have a hypothesis about acoustics and perception, specifically as relates to stereo and the illusion of two dimensions. My contention is that physical space away from the ears is required to achieve this illusion. When earbuds are inserted close to 1 cm away from the eardrum, that is not sufficient space for the brain to perceive spatial effects. In particular, the brain cannot perceive spatial sound effects between the eardrums, inside the head. On the other hand, stereo headphones provide about an inch of space away from the eardrum, and this is sufficient space for the brain to perceive varying sound as having a spatial quality, including the illusion that sound is located in the center of the head. It might be interesting to test this out with a music track that emphasizes back and forth. left-right sound effects, to see the difference between earbuds and headphones.
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Sun 12 Jun 2016, 12:10    Post subject:  

@ amigo
I might still root this phone, but I don't see any point to it at present since there is no software solution for the mono audio switch in the wild. However, once Android N rolls out, there will be a solution to mono audio available to devs, and I might have a reason to root the phone at that point. I have to say this phone is really a great device because of the front-firing loudspeaker, which really makes a difference. Battery life has been somewhat reduced since I upgraded from Lollipop to Marshmallow, but other than that, I can't complain, except for the lack of mono audio. I think that Android users are going to have a similar struggle getting Google coders to include a Left-Right Channel Balance, a standard feature on iPhone, LG, and Samsung smartphones. After all, it took an act of the California legislature to get Google to finally include the mono switch, but only after a year-long wait. I mean, what's the rush, it's only a usability feature. Speaking of knuckleheads, the CTO at Motorola who, as a matter of policy, refused to make any mod to stock Android on Motorola phones, has jumped ship and now is in executive position at Google. As I recall from my reading, the Google exec [not the former Motorola CTO] who was standing in the way of Mono Audio on stock Android has moved on up, in accordance with the Peter Principle, replaced by a younger exec with some field experience.

Last edited by nubc on Fri 17 Jun 2016, 01:02; edited 5 times in total
Back to top
View user's profile Send private message 
Pete


Joined: 02 Mar 2014
Posts: 675

PostPosted: Sun 12 Jun 2016, 13:36    Post subject:  

Hi nubc

I assume what you are trying to achieve, due to local laws, is you want your phone
to play mono but your source material is in stereo.
Also when you answer calls, you want to be sure that you can indeed hear the other person.

You are indeed a brave person trying to mess around with Android.
I would go the hardware route.
Had a quick google around and most phones seem to use the same connections
for headphones which includes a small in-line control housing with some buttons (to play music and answer calls) and a microphone.
These are normally stereo (see first attached diagram).

Since it is stereo, we could use two series resistors of 10 ohms each (couple of cents) and combine the left and right channels to form mono.
The resistors not only do the combining, but also act as a "load" to both channels so that they are not simply shorted together.

Speakers/earbuds normally used on phones, have an impedance of around 32 ohms so the 10 ohm resistors would only reduce the volume a tad, plus you can always turn up the volume a bit higher than normal.

The mod is outlined in the second attached diagram.
HeadsetWiringOriginalStereo.jpg
 Description   
 Filesize   27.27 KB
 Viewed   149 Time(s)

HeadsetWiringOriginalStereo.jpg

HeadsetWiringMonoMod.jpg
 Description   
 Filesize   27.41 KB
 Viewed   148 Time(s)

HeadsetWiringMonoMod.jpg

Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Tue 18 Oct 2016, 08:58    Post subject:  

For the immediate future, the Moto G 3rd gen smartphone will not be getting the update to Android Nougat 7.0. There may have been a hardware issue causing freezing, some apps did not work, and some handsets even crashed, according to rumors. By not providing a second version upgrade for the Moto G3, Motorola is breaking with a tradition of extended support (currently 18 months and 2 Android version upgrades) for its mobile devices. Moto G3 owners have started a petition to get Motorola/Lenovo to provide the update to Nougat 7.0. So far the petition has gathered almost 10,000 signatures.
Back to top
View user's profile Send private message 
nubc


Joined: 23 Jan 2007
Posts: 1830
Location: USA

PostPosted: Thu 16 Mar 2017, 03:47    Post subject:  

Nexus 5 mod to change stereo to mono. Make the following substitution of the "headphones" section of mixer_paths.xml file located at /system/etc

stereo
Code:
          <path name="headphones">
        <ctl name="SLIM RX1 MUX" value="AIF1_PB" />
        <ctl name="SLIM RX2 MUX" value="AIF1_PB" />
        <ctl name="SLIM_0_RX Channels" value="Two" />
        <ctl name="RX1 MIX1 INP1" value="RX1" />
        <ctl name="RX2 MIX1 INP1" value="RX2" />
        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
        <ctl name="HPHL DAC Switch" value="1" />
        <ctl name="RX1 Digital Volume" value="83" />
        <ctl name="RX2 Digital Volume" value="83" />
        <ctl name="HPHL Volume" value="15" />
        <ctl name="HPHR Volume" value="15" />
    </path>


mono
Code:
   <path name="headphones">
        <ctl name="SLIM RX1 MUX" value="AIF1_PB" />
        <ctl name="SLIM RX2 MUX" value="AIF1_PB" />
        <ctl name="SLIM_0_RX Channels" value="Two" />
        <ctl name="RX1 MIX1 INP1" value="RX1" />
        <!-- the following line adds the cross mix from the second channel to the first one -->
        <ctl name="RX1 MIX1 INP2" value="RX2" />
        <ctl name="RX2 MIX1 INP1" value="RX2" />
        <!-- the following line adds the cross mix from the first channel to the second one -->
        <ctl name="RX2 MIX1 INP2" value="RX1" />
        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
        <ctl name="HPHL DAC Switch" value="1" />
        <ctl name="RX1 Digital Volume" value="83" />
        <ctl name="RX2 Digital Volume" value="83" />
        <ctl name="HPHL Volume" value="15" />
        <ctl name="HPHR Volume" value="15" />
    </path>

https://forum.xda-developers.com/google-nexus-5/help/stereo-to-mono-app-t3038469

Moto G3 code (stereo)
Code:
<path name="headphones">
            <ctl name="MI2S_RX Channels" value="Two" />
            <ctl name="RX1 MIX1 INP1" value="RX1" />
            <ctl name="RX2 MIX1 INP1" value="RX2" />
            <ctl name="RDAC2 MUX" value="RX2" />
            <ctl name="HPHL" value="Switch" />
            <ctl name="HPHR" value="Switch" />
         <path>
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0624s ][ Queries: 14 (0.0099s) ][ GZIP on ]