Movatterモバイル変換


[0]ホーム

URL:


XDA Forums
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use analternative browser.

[MOD][N5] Surround Sound

Search This thread
By:

7sen

Senior Member

chdloc

Senior Member
Jul 19, 2010
1,140
1,723
Great mod. Thanks for sharing!

Not sure whether it has been posted yet, but in its current form, it does not produce a truly spatial sound (left-right separation).
It does with the following "speaker" path in mixer_paths.xml

Code:
      <path name="speaker">        <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="RX7 MIX1 INP2" value="RX2" />        <ctl name="RX1 Digital Volume" value="90" />        <ctl name="RX7 Digital Volume" value="88" />        <ctl name="SPK DRV Volume" value="6" />        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />        <ctl name="HPHL Volume" value="20" />        <ctl name="HPHR Volume" value="20" />        <ctl name="HPHL DAC Switch" value="1" />        <ctl name="DAC1 Switch" value="1" />    </path>

In essence, delete the two cross-channel mixes between RX1 and RX7 and voila, we have "true" stereo.

I need to caution, though, that by default, the second speaker is also turned on in speakerphone mode.
This may mess with echo control during a cellular and possibly also VoIP based calls.
It may be a good idea to turn off the second speaker during a phone call in speakerphone mode. I can probably help with that...
 
Ben36

Ben36

Senior Member
Jun 8, 2012
8,250
2,867
If my N5 play's trought 1 speaker that means if i install this surround it will play from top earpeace and from bottom?
Yup

Sent from my Android 5.0 Nexus 5
 

picarito

Senior Member
Feb 10, 2012
516
144
Great mod. Thanks for sharing!

Not sure whether it has been posted yet, but in its current form, it does not produce a truly spatial sound (left-right separation).
It does with the following "speaker" path in mixer_paths.xml

Code:

In essence, delete the two cross-channel mixes between RX1 and RX7 and voila, we have "true" stereo.

I need to caution, though, that by default, the second speaker is also turned on in speakerphone mode.
This may mess with echo control during a cellular and possibly also VoIP based calls.
It may be a good idea to turn off the second speaker during a phone call in speakerphone mode. I can probably help with that...
It works fine and whoever wants the front earpiece to mach the sound level of the speaker after many reboots I got a match. Is good for me but someone can tweak it to make it better.
 

Attachments

  • uploadfromtaptalk1418508723617.JPG
    uploadfromtaptalk1418508723617.JPG
    65.3 KB · Views: 1,390
Last edited:

chdloc

Senior Member
Jul 19, 2010
1,140
1,723
I played with mixer_paths.xml some more and now I have a gain setup that seems to work for me, both in terms of keeping distortions at bay and in terms of left-right speaker balance.

My "speaker" device now looks like this:

<path name="speaker">
<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="RX7 MIX1 INP2" value="RX2" />
<ctl name="RX1 Digital Volume" value="89" />
<ctl name="RX7 Digital Volume" value="81" />
<ctl name="SPK DRV Volume" value="6" />
<ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
<ctl name="DAC1 Switch" value="1" />
</path>


Note that I deleted a few entries that are unnecessary along with the two cross-mixing entries mentioned earlier. Also, in my case, the gain difference between the main speaker (81) and the handset speaker (89) is eight ticks, which I believe corresponds to 8 dB. It is important to note that both the absolute and relative levels between the two loudspeakers are, in general, device-specific due to loudspeaker tolerances. You can certainly start with my values and optimize for your device.

In order to make optimization easier, I attached the command-line program "tinymix" which is part of AOSP, but is not installed by default.
Uncompress the binary, copy it somewhere to your binary search path such as /system/bin , and adjust the permissions to 744.
With this binary, you can use the shell to adjust the gain values on-the-fly while you are listening to audio, e.g. as root

# tinymix "RX1 Digital Volume" A
# tinymix "RX7 Digital Volume" B


where A,B ={0,124} is the desired gain level. Keep in mind that the values will always reset to the ones sitting in mixer_paths.xml as soon as you play with the playback controls of your media player, i.e. pause/resume, start/stop, and skip. For the values to "stick" you will have to modify mixer_paths.xml directly followed by a reboot. I would advise against cranking up the earpiece loudspeaker gain value to something higher than the lower 90s as distortions will be very audible at high playback volumes. Even though the audio codec used (WCD9320) seems to be having a current limiter in the earpiece path, damage to the loudspeaker cannot be ruled out if the loudspeaker is heavily distorting for a long period of time.


In order to shut the handset speaker off during a (cellularand maybe VoIP) handsfree call, I modified another device in mixer_paths.xml, i.e.

<path name="voice-speaker">
<path name="speaker" />
<ctl name="SPK DRV Volume" value="8" />
<ctl name="RX7 Digital Volume" value="94" />
<ctl name="RX1 Digital Volume" value="0" />
</path>


which simply sets the handset speaker gain to zero. Keeping the handset speaker on during a cellular speakerphone call may cause the phone's echo control to "work harder" than necessary and maybe even fail in some instances.

Caveat: The earpiece loudspeaker does not seem to be turning off when using the speakerphone on voice-capable apps other than cellular telephony, such as Google Hangouts (via Dialer), Skype, Bria, etc, as these apps seem to be calling the "speaker" device directly (which of course now turns both loudspeakers on by default). This may wreck havoc on echo control. As I'm not really using any of these services on speakerphone on a regular basis, this is not a real problem for me. The only way around this issue that I can see right now is (other than lowering the playback volume as much as possible or seriously messing with the audio HAL) to use a service like Tasker to execute
Code:
tinymix "RX1 Digital Volume" 0
whenever speakerphone mode is detected, which is non-trivial but possible.


Edit (12/16/2014): I made some "frequency response" measurements of the two loudspeakers. I held my sound level meter at about 30 cm distance from the phone, approximately centered between the two loudspeakers. As can be seen from the attached plot, the two loudspeakers match pretty well in the perceptually important frequency range of 1 kHz and 4 kHz. The discrepancy between the two loudspeakers at frequencies higher than around 4.5 kHz can be explained by the fact that the main loudspeaker is not front-facing and high frequencies get attenuated more as a result of its placement with respect to the listener.
 

Attachments

  • tinymix.gz
    2.8 KB · Views: 729
  • hammerhead_stereo_playback_responses.jpg
    hammerhead_stereo_playback_responses.jpg
    74.1 KB · Views: 2,858
Last edited:

dakore

Senior Member
Jun 26, 2010
672
220
Upernavik
@chdloc thanks man, this mod combined with your camcoder audio mod is must have! Your additional fix for in-call loudspeaker works fine, and balance between L and R chanel (90 and 82) is well tuned.
 

chdloc

Senior Member
Jul 19, 2010
1,140
1,723
Do you have a flashable zip for your version?

No, sorry.
It should be straightforward to update the existing zip with my version, though.
 
garynych

garynych

Senior Member
Dec 28, 2012
333
291
Moscow
Ben36

Ben36

Senior Member
Jun 8, 2012
8,250
2,867
So this makes actual stereo? But screws up the echo?
 

chdloc

Senior Member
Jul 19, 2010
1,140
1,723

Thanks!
I took a quick glance at the archive you created and it appears to me that the mixer_paths.xml file
is present but not actually installed during the flash process (cf. updater-script). Am I missing something?

A warning may be in order as the attached mixer_paths.xml may not work with any non-AOSP based ROMs,
in particular CM and CM derivatives. Also flashing this may nullify other audio mods a user may have installed.

This is precisely the reason I personally stay away from flashable zips as the "normal" user has no idea what's going on
and unintended breakage is bound to happen.
 

Does the "Revert to stock" zip work with you mod too?

BTW: I won't use the revert for a while: great mod!:D
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 66
    A mod originally made for the Note edge by @ sshafranko and now ported to the nexus 5 head on over to the original thread here , and Im merely helping him out here at the N5 forums
    http://xdaforums.com/note-edge/development/mod-sm-915t-surround-sound-t2955648


    This mod will activate you front earpiece speaker in conjunction with the rear main speaker any time Speaker mode is used for example playing music, watching movies, shows, you tube and so on, creating an almost surround sound type of effect.​

    Please keep in mind that this mod is for the T Mobile Note Edge variant. This modifies the mixer_path.xml file in you system/etc folder. This .xml file varies device to device and even carrier to carrier.I have not tested this on International or any other carrier Note Edge, and i used the T Mobile .xml file as my base. Therefore i don't know if it will work on any other carrier although i will say that there is a better chance of it working on another U.S. carrier than there is on International. If you decide to try it please have your rom backed up in case of a boot loop, and before you flash the zip or extract and push the .xml file to your system, rename your original mixer_paths.xml to mixer_paths.xml.bak so that you have your original easily accessible. There is a slight chance that if you pm me your mixer file i can mod it for your variant, and maybe add it to the thread assuming it doesn't work for you and i have some spare time.​

    PREREQUISITES

    A RootedGalaxy Note Edge Nexus 5
    Custom Recovery Installed. I tested on TWRP 2.8.1.1
    A set of human or alien ears (animal may also work but have not been tested by me)


    DISCLAIMER
    I am not responsible in any way, shape, or form, directly or indirectly for anything good or bad that happens to your device do to your modifications using my surround sound zips. Please do not inject, ingest or insert these zips anywhere on or in your body, they are meant to be flashed in a custom recovery on yourNote Edge Beast. HAMMERHEAD BEAST

    INSTALLATION
    STEP 1: Download the sound mod zip

    STEP 2: Boot to recovery by using modded shut down menu, Power Toggles type Widget, or simply turn your phone off. Once completely off hold Home, Volume up and Power buttons simultaneously which will then boot your recovery.

    STEP 3: Navigate to the Sound Mod Zip of your choice and flash it. I don't believe it is necessary to wipe caches with this type of mod, but i would suggest it. Any time i am in recovery i take the opportunity to wipe caches and fix permissions, almost as a maintenance type of habit.
    If you used CF root to root your phone you may be having some issues mounting the cache partition. There are 2 ways to fix this, both worked for me, the first of which may or may not work for you and is very simple to try and the second more involved.
    1) Wipe Dalvik Cache ONLY. Now wipe Cache ONLY. Now wipe both Dalvik Cache and Cache. If this worked for you, you will now be able to wipe caches without mounting errors.
    2) Begin from scratch and re-root your phone except this time DO NOT use Chainfire's CF Root. Odin TWRP recovery, make sure you have a zip of SuperSU 2.16 i believe it is on your sd. Once TWRP is odined, boot to recovery and inject (flash) SuperSU. When booted you will most likely be prompted to update SuperSU as i believe there was an update today, assuming you are injecting 2.16. These steps are only for those having troubles flashing do to CF Root braking TWRP. If this has been fixed, i apologize and please ignore, as i have not checked today.

    Post your experience with this mod here, any issues, requests and so on, and i will try to get back to you as soon as time allows. Happy flashing and i hope you all like it. It took me 5 hrs to figure out the correct code for the device and play scenarios in mixer_paths to get this working correctly, and a bunch of testing to get it bug free but well worth it. Hope you guys share my enthusiasm with this mod.

    Known Bugs: Sound plays from earpiece speaker while headphones are connected. FIXED
    Please let me know if you find something i missed. Thank You.

    CREDITS

    DWITHERELL-You are the best. Thank you for zipping it all up, and listening to all my dumb comments and questions...
    Chainfire
    Deeznuts
    Jdidtht
    Bacardilimon

    Contributors
    SShafranko

    Version Information
    Status: Stable

    Created
    November 25, 2014

    Downloads

    Dual mono SURROUND SOUND MOD-http://d-h.st/LgZ -
    REVERT TO STOCK -http://d-h.st/fCpS

    ---------------------------------------------------------------------------------------------------------
    Stero SURROUND SOUND MOD-http://xdaforums.com/showpost.php?p=57514832&postcount=75 -- thanks to@garynych

    All this is thanks to @ sshafranko so please do thank him on his thread, This has been shared here with permission from the owner
    29
    Do you have a flashable zip for your version?
    flashable zip
    25
    I played with mixer_paths.xml some more and now I have a gain setup that seems to work for me, both in terms of keeping distortions at bay and in terms of left-right speaker balance.

    My "speaker" device now looks like this:

    <path name="speaker">
    <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="RX7 MIX1 INP2" value="RX2" />
    <ctl name="RX1 Digital Volume" value="89" />
    <ctl name="RX7 Digital Volume" value="81" />
    <ctl name="SPK DRV Volume" value="6" />
    <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
    <ctl name="DAC1 Switch" value="1" />
    </path>


    Note that I deleted a few entries that are unnecessary along with the two cross-mixing entries mentioned earlier. Also, in my case, the gain difference between the main speaker (81) and the handset speaker (89) is eight ticks, which I believe corresponds to 8 dB. It is important to note that both the absolute and relative levels between the two loudspeakers are, in general, device-specific due to loudspeaker tolerances. You can certainly start with my values and optimize for your device.

    In order to make optimization easier, I attached the command-line program "tinymix" which is part of AOSP, but is not installed by default.
    Uncompress the binary, copy it somewhere to your binary search path such as /system/bin , and adjust the permissions to 744.
    With this binary, you can use the shell to adjust the gain values on-the-fly while you are listening to audio, e.g. as root

    # tinymix "RX1 Digital Volume" A
    # tinymix "RX7 Digital Volume" B


    where A,B ={0,124} is the desired gain level. Keep in mind that the values will always reset to the ones sitting in mixer_paths.xml as soon as you play with the playback controls of your media player, i.e. pause/resume, start/stop, and skip. For the values to "stick" you will have to modify mixer_paths.xml directly followed by a reboot. I would advise against cranking up the earpiece loudspeaker gain value to something higher than the lower 90s as distortions will be very audible at high playback volumes. Even though the audio codec used (WCD9320) seems to be having a current limiter in the earpiece path, damage to the loudspeaker cannot be ruled out if the loudspeaker is heavily distorting for a long period of time.


    In order to shut the handset speaker off during a (cellularand maybe VoIP) handsfree call, I modified another device in mixer_paths.xml, i.e.

    <path name="voice-speaker">
    <path name="speaker" />
    <ctl name="SPK DRV Volume" value="8" />
    <ctl name="RX7 Digital Volume" value="94" />
    <ctl name="RX1 Digital Volume" value="0" />
    </path>


    which simply sets the handset speaker gain to zero. Keeping the handset speaker on during a cellular speakerphone call may cause the phone's echo control to "work harder" than necessary and maybe even fail in some instances.

    Caveat: The earpiece loudspeaker does not seem to be turning off when using the speakerphone on voice-capable apps other than cellular telephony, such as Google Hangouts (via Dialer), Skype, Bria, etc, as these apps seem to be calling the "speaker" device directly (which of course now turns both loudspeakers on by default). This may wreck havoc on echo control. As I'm not really using any of these services on speakerphone on a regular basis, this is not a real problem for me. The only way around this issue that I can see right now is (other than lowering the playback volume as much as possible or seriously messing with the audio HAL) to use a service like Tasker to execute
    Code:
    tinymix "RX1 Digital Volume" 0
    whenever speakerphone mode is detected, which is non-trivial but possible.


    Edit (12/16/2014): I made some "frequency response" measurements of the two loudspeakers. I held my sound level meter at about 30 cm distance from the phone, approximately centered between the two loudspeakers. As can be seen from the attached plot, the two loudspeakers match pretty well in the perceptually important frequency range of 1 kHz and 4 kHz. The discrepancy between the two loudspeakers at frequencies higher than around 4.5 kHz can be explained by the fact that the main loudspeaker is not front-facing and high frequencies get attenuated more as a result of its placement with respect to the listener.
    11
    Can I use camcorder mod with this?

    Yes, but as of now you will have to edit your mixer_paths.xml file manually as outlinedhere after having installed the camcorder mod.
    An Aroma installer that combines the two mods is currently being worked on.

    Edit: Now you can, with a very flexible Aroma installer availablehere
    8
    So today i decided to try this mod out so i had a look at theSurround Sound(fixed).zip and noticed its only changed themixer_paths.xml insystem/etc

    not wanting to change my holemixer_paths.xml file i worked out that the part that makes this mod work is:
    Code:
        <path name="speaker">        <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="RX1 MIX1 INP2" value="RX2" />        <ctl name="RX7 MIX1 INP1" value="RX1" />        <ctl name="RX7 MIX1 INP2" value="RX2" />        <ctl name="RX1 Digital Volume" value="90" />        <ctl name="RX7 Digital Volume" value="88" />        <ctl name="SPK DRV Volume" value="6" />        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />        <ctl name="HPHL Volume" value="20" />        <ctl name="HPHR Volume" value="20" />        <ctl name="HPHL DAC Switch" value="1" />        <ctl name="DAC1 Switch" value="1" />    </path>

    so i manually edited mymixer_paths.xml and used the code above

    after a reboot my earpiece speaker was very distorted onCM13 CAF so i played around with mymixer_paths.xml and worked out that it was theHPHL DAC so here is the new code without theHPHL DAC

    Code:
        <path name="speaker">        <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="RX1 MIX1 INP2" value="RX2" />        <ctl name="RX7 MIX1 INP1" value="RX1" />        <ctl name="RX7 MIX1 INP2" value="RX2" />        <ctl name="RX1 Digital Volume" value="90" />        <ctl name="RX7 Digital Volume" value="88" />        <ctl name="SPK DRV Volume" value="6" />        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />        <ctl name="DAC1 Switch" value="1" />    </path>

    i also was not happy with the volume on the small speaker felt i was putting to much strain on the small speaker so i lowered the volume
    <ctl name="RX1 Digital Volume" value="76" /> = small earpiece speaker
    <ctl name="RX7 Digital Volume" value="88" /> = normal loud speaker

    i first turned RX7 to 0 then i tested RX1 at different levels and felt 76 was just right

    Code:
        <path name="speaker">        <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="RX1 MIX1 INP2" value="RX2" />        <ctl name="RX7 MIX1 INP1" value="RX1" />        <ctl name="RX7 MIX1 INP2" value="RX2" />        <ctl name="RX1 Digital Volume" value="76" />        <ctl name="RX7 Digital Volume" value="88" />        <ctl name="SPK DRV Volume" value="6" />        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />        <ctl name="DAC1 Switch" value="1" />    </path>

    if you want to push your speakers a bit more these values would be my max
    <ctl name="RX1 Digital Volume" value="84" />
    <ctl name="RX7 Digital Volume" value="92" />

    Edit*
    Turns out we don't need two channels this is how you can have just one channel
    and this is my final code

    Code:
        <path name="speaker">        <ctl name="SLIM RX1 MUX" value="AIF1_PB" />        <ctl name="SLIM_0_RX Channels" value="One" />        <ctl name="RX1 MIX1 INP1" value="RX1" />        <ctl name="RX7 MIX1 INP1" value="RX1" />        <ctl name="RX1 Digital Volume" value="80" />        <ctl name="RX7 Digital Volume" value="90" />        <ctl name="SPK DRV Volume" value="6" />        <ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />        <ctl name="DAC1 Switch" value="1" />    </path>

[8]ページ先頭

©2009-2025 Movatter.jp