[TESTING] New audio routing for Froyo

Search This thread

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Alex asked me to put a test together for Jerome's new audio routing code. This is a prerequisite to Bluetooth audio, so we'd like to get it into the mainline as soon as possible. This test is for Froyo only.

Update: See post #2 for info on testing Bluetooth with this code.

This includes a new kernel and modules, plus a set of new libraries. You will also need to add a couple commands to your /init.rc to make it work. You also need to copy all of the *.csv files from your \Windows directory to the root of your SDcard.

With this installed your in-call audio should be more reliable, with fewer glitches (e.g. suddenly turning on speakerphone at random) etc. Also, for me, this fixed the audio track in video recording. (Before, I got no audio from the camcorder, now it's there.)

In your /init.rc you'll need to add
Code:
chmod 666 /dev/htc-acoustic_wince
chmod 666 /dev/tpa2016d2

Search through the init.rc for "XDAndroid" and you'll see a block of chmod commands. Just add this to those others. Remember that normally the rootfs copies /init.cfg/init.froyo.rc to /init.rc on bootup, so you need to edit the init.cfg file if you want your change to take effect. And you must reboot for it to take effect. (If you're using my rootfs, you just edit /init.rc directly.)

The libraries need to be installed in /system/lib. The easiest thing will probably be to bind mount them in your user.conf. If you've been testing other features here you should already know how to do that so I won't explain in this thread.

Note:
In addition to all of the 20110510_201546 autobuild kernel code, this kernel also has WisTilt2's power manager and framebuffer fixes, as well as button lights. Also, it has my sleep LEDs - solid green means a wakelock is present, blinking green means the phone is asleep. Don't confuse this with WisTilt2's previous testing kernels.

The libraries were built from the froyo branch of this repo https://gitorious.org/~jbruneaux/xdandroid/hardware_msm7k_libacoustic
The kernel patches were taken from the htc-msm-2.6.27-libacoustic branch of this repo https://gitorious.org/~jbruneaux/linux-on-qualcomm-s-msm/linux-msm-home-work, commit ID 0fe09c9cb680ebff94bbd9bf30f787a2d5da6e9b and cleaned up to apply against the mainline kernel source.

Update: I've been getting a lot of failed wakes/SoDs with the 01323 kernel. We have a suspicion that it's due to the latest framebuffer patch from the mailing list, so I've reverted that specific patch and uploaded the resulting 01324 kernel. It's kind of sloppy of me to mix two different experiments together like this, but if you experience hangs with 01323, post a response here and try 01324 instead.

And what I should have done from the beginning... The 01319 kernel here is just the autobuild kernel plus the audio patches, nothing else.
 

Attachments

  • libaudio.zip
    47.4 KB · Views: 574
  • kernel-01323.zip
    2.1 MB · Views: 371
  • kernel-01324.zip
    2.1 MB · Views: 455
  • kernel-01319.zip
    2.1 MB · Views: 356
Last edited:

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Bluetooth! - already included in FRX07

All of this has already been integrated in FRX07. Ignore this.


OK. I was curious; supposedly the kernel has had complete support for Bluetooth for a while now but we're still missing some stuff in userland. Well, I chased down the missing pieces, tried it, and it works!

I only know how to set this up for Rhodiums, using the Broadcom radio chip. If you're on some other phone, with TI chip, I don't know how to help you.

You need to copy the BCM4325*.hcd files from your \Windows directory onto the root of your SDcard. On my phone there were two files, BCM4325D0..(bunch of crap).hcd and BCM4325D1..(bunch of crap).hcd. The BCM4325D1 file is the one that worked for me. You may have to try them both out.

You will have to edit your /init.rc and replace the current hciattach info with this instead:

Code:
service hciattach /system/bin/brcm_patchram_plus -r --enable_hci \
    --enable_lpm --baudrate 4000000 \
    --patchram /system/etc/BCM4325.hcd /dev/ttyHS1

I copied my hcd file to /system/etc/BCM4325.hcd but you may just want to create a symlink to the file on your SDcard. Whatever you do, you have to make sure that this is pointing to a valid hcd file.

Remember that normally the rootfs copies /init.cfg/init.froyo.rc to /init.rc on bootup, so you need to edit the init.cfg file if you want your change to take effect. And you must reboot for it to take effect. (If you're using my rootfs, you just edit /init.rc directly.)

You must use the brcm_patchram_plus binary that I've attached here. The source for it is in JB's repo https://gitorious.org/system_bluetooth/system_bluetooth . Remember to chmod it 755 after you extract it and install it.

Once the files are installed, reboot and it should all be working. I've tested an audio headset and OBEX file transfers, both worked without any trouble. I believe the OBEX stuff will work in the autobuild kernel too, but you need the audio routing support in this kernel to get Bluetooth audio.
 

Attachments

  • brcm_patch.zip
    5.2 KB · Views: 470
Last edited:

pdawg17

Senior Member
Apr 3, 2008
407
15
Hmmm...on my Rhod400 (Sprint) I have added the zimage/modules, added the chmod line to the conf file and bind mounted the files and now I do not have any "non-call" audio...phone calls sound great and I do not hear any static when in speakerphone (although the volume control does not seem to raise/lower speakerphone volume)...it is getting late though so I think I will get some sleep and see if I screwed something up in the morning...

I am very excited about this though!
 
Last edited:

highlandsun

Inactive Recognized Developer
Sep 15, 2009
949
272
Los Angeles
highlandsun.com
Uh... This is the TouchPro2/Tilt2 *RHODIUM* section. I thought it would be obvious that this test is only for Rhodium. Rhodium only uses Broadcom.

Sorry guys, the first kernel I uploaded was from an incomplete revision of the audio patches. I've uploaded another one kernel-01323.zip that has everything. This corresponds to the autobuild plus all of the audio code in JB's tree as of April 12.
 
Last edited:

arrrghhh

Inactive Recognized Developer
Feb 10, 2007
11,906
3,851
Same problem then? No audio other than in-call?

I'm just trying out BT, haven't really even tested audio...

After trying a phone call, I get no audio on incoming or outgoing calls. I surely messed something up here... I don't even hear the ringing sound on the outbound call :p.
 
Last edited:

pdawg17

Senior Member
Apr 3, 2008
407
15
I'm just trying out BT, haven't really even tested audio...

After trying a phone call, I get no audio on incoming or outgoing calls. I surely messed something up here...

Maybe BT isn't working for you because the underlying audio part in post #1 is not working right for Rhod400...I haven't even tried to get BT going...
 

arrrghhh

Inactive Recognized Developer
Feb 10, 2007
11,906
3,851
Maybe BT isn't working for you because the underlying audio part in post #1 is not working right for Rhod400...I haven't even tried to get BT going...

I'm gonna start over. I don't know what I messed up, but I obviously messed something up. In trying to verify everything, it all *looks* ok... but it most certainly is not ok! I'll start with a fresh build, no messin around ;).
 

manekineko

Senior Member
Jul 26, 2009
1,005
229
I realize GRX is not the focus of this, but figured the feedback may be useful nonetheless.

Audio: Almost completely broken by the patches. Made 4 phone calls, 3 had no sound whatsoever (including ringing), 4th had sound for a split second and then cut out with no sound. Toggling speakerphone made no difference. Audio played by the Music app has no sound, ringtones have no sound.

Bluetooth: No surprises here given how unfinished Bluetooth is on GRX, but doesn't work. Attempting to turn it on displays turning on for a few seconds, and then it reverts to the unturned on state.
 

arrrghhh

Inactive Recognized Developer
Feb 10, 2007
11,906
3,851
I realize GRX is not the focus of this, but figured the feedback may be useful nonetheless.

Audio: Almost completely broken by the patches. Made 4 phone calls, 3 had no sound whatsoever (including ringing), 4th had sound for a split second and then cut out with no sound. Toggling speakerphone made no difference. Audio played by the Music app has no sound, ringtones have no sound.

Bluetooth: No surprises here given how unfinished Bluetooth is on GRX, but doesn't work. Attempting to turn it on displays turning on for a few seconds, and then it reverts to the unturned on state.

Same for Froyo? I'd use Froyo as a baseline, and then see what works in GB... if it doesn't work in Froyo, it certainly won't in GB (at least that seems like a fairly safe assumption :p).
 

Serren

Senior Member
Aug 19, 2008
186
31
I'm having the sound issues as well, but fully blame my coding errors. If someone gets a complete working build for us Rhod400 users and would like to share, that would be awesome.

In the meantime, I'll keep plugging away at my very limited ability to modify system files... :)
 

arrrghhh

Inactive Recognized Developer
Feb 10, 2007
11,906
3,851
Hrm, fresh build of FRX06 with just the first post audio changes - not even touching BT until I get that first post solid... no audio. It's completely muted, incoming calls, outgoing calls, anything in the UI... no audio from the system whatsoever.
 

Serren

Senior Member
Aug 19, 2008
186
31
Hmmmm.... I can't seem to find any .csv files in my /windows folder. Anyone seen these guys yet? How many are there? Maybe an actual file name?

Thanks!
 

vinceweis

Senior Member
Jan 10, 2008
306
54
70
Fontana, CA
OnePlus 7T
Hmmmm.... I can't seem to find any .csv files in my /windows folder. Anyone seen these guys yet? How many are there? Maybe an actual file name?

Thanks!

AudioFilterTable.csv
AudioPara.csv
AudioPara3.csv
AudioPara3_ATT.csv
AudioPara3_Boot.csv
AudioPara3_TMO.csv
AudioPreProcessTable.csv
DualMic.csv
DualMic_ATT.csv
DualMic_TMO.csv
TIAGC.csv

If you use Total Commander and touch the header for filename/ext it will sort by extension.
 
  • Like
Reactions: bndtdog and Serren

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Alex asked me to put a test together for Jerome's new audio routing code. This is a prerequisite to Bluetooth audio, so we'd like to get it into the mainline as soon as possible. This test is for Froyo only.

    Update: See post #2 for info on testing Bluetooth with this code.

    This includes a new kernel and modules, plus a set of new libraries. You will also need to add a couple commands to your /init.rc to make it work. You also need to copy all of the *.csv files from your \Windows directory to the root of your SDcard.

    With this installed your in-call audio should be more reliable, with fewer glitches (e.g. suddenly turning on speakerphone at random) etc. Also, for me, this fixed the audio track in video recording. (Before, I got no audio from the camcorder, now it's there.)

    In your /init.rc you'll need to add
    Code:
    chmod 666 /dev/htc-acoustic_wince
    chmod 666 /dev/tpa2016d2

    Search through the init.rc for "XDAndroid" and you'll see a block of chmod commands. Just add this to those others. Remember that normally the rootfs copies /init.cfg/init.froyo.rc to /init.rc on bootup, so you need to edit the init.cfg file if you want your change to take effect. And you must reboot for it to take effect. (If you're using my rootfs, you just edit /init.rc directly.)

    The libraries need to be installed in /system/lib. The easiest thing will probably be to bind mount them in your user.conf. If you've been testing other features here you should already know how to do that so I won't explain in this thread.

    Note:
    In addition to all of the 20110510_201546 autobuild kernel code, this kernel also has WisTilt2's power manager and framebuffer fixes, as well as button lights. Also, it has my sleep LEDs - solid green means a wakelock is present, blinking green means the phone is asleep. Don't confuse this with WisTilt2's previous testing kernels.

    The libraries were built from the froyo branch of this repo https://gitorious.org/~jbruneaux/xdandroid/hardware_msm7k_libacoustic
    The kernel patches were taken from the htc-msm-2.6.27-libacoustic branch of this repo https://gitorious.org/~jbruneaux/linux-on-qualcomm-s-msm/linux-msm-home-work, commit ID 0fe09c9cb680ebff94bbd9bf30f787a2d5da6e9b and cleaned up to apply against the mainline kernel source.

    Update: I've been getting a lot of failed wakes/SoDs with the 01323 kernel. We have a suspicion that it's due to the latest framebuffer patch from the mailing list, so I've reverted that specific patch and uploaded the resulting 01324 kernel. It's kind of sloppy of me to mix two different experiments together like this, but if you experience hangs with 01323, post a response here and try 01324 instead.

    And what I should have done from the beginning... The 01319 kernel here is just the autobuild kernel plus the audio patches, nothing else.
    6
    Bluetooth! - already included in FRX07

    All of this has already been integrated in FRX07. Ignore this.


    OK. I was curious; supposedly the kernel has had complete support for Bluetooth for a while now but we're still missing some stuff in userland. Well, I chased down the missing pieces, tried it, and it works!

    I only know how to set this up for Rhodiums, using the Broadcom radio chip. If you're on some other phone, with TI chip, I don't know how to help you.

    You need to copy the BCM4325*.hcd files from your \Windows directory onto the root of your SDcard. On my phone there were two files, BCM4325D0..(bunch of crap).hcd and BCM4325D1..(bunch of crap).hcd. The BCM4325D1 file is the one that worked for me. You may have to try them both out.

    You will have to edit your /init.rc and replace the current hciattach info with this instead:

    Code:
    service hciattach /system/bin/brcm_patchram_plus -r --enable_hci \
        --enable_lpm --baudrate 4000000 \
        --patchram /system/etc/BCM4325.hcd /dev/ttyHS1

    I copied my hcd file to /system/etc/BCM4325.hcd but you may just want to create a symlink to the file on your SDcard. Whatever you do, you have to make sure that this is pointing to a valid hcd file.

    Remember that normally the rootfs copies /init.cfg/init.froyo.rc to /init.rc on bootup, so you need to edit the init.cfg file if you want your change to take effect. And you must reboot for it to take effect. (If you're using my rootfs, you just edit /init.rc directly.)

    You must use the brcm_patchram_plus binary that I've attached here. The source for it is in JB's repo https://gitorious.org/system_bluetooth/system_bluetooth . Remember to chmod it 755 after you extract it and install it.

    Once the files are installed, reboot and it should all be working. I've tested an audio headset and OBEX file transfers, both worked without any trouble. I believe the OBEX stuff will work in the autobuild kernel too, but you need the audio routing support in this kernel to get Bluetooth audio.
    6
    This is a modified version of daknap's original instructions from post 68 of this thread. Thanks daknap! (My modifications are in parentheses.)

    (0. Before you start, see my previous post about turning off bluetooth in WinMo. I recommend doing this first before you boot up Android so that you don't have to reboot twice at the end.)

    1. Download Droid Explorer and Notepad++ and install. Might also need a copy of android sdk for drivers. Fresh install of FRX06 is good too.

    (1.5 You'll need some files from the WinMo /windows directory of your Rhodium. Connect through ActiveSync or some other way that you can access the Rhodium's internal drive AND the SD drive from your PC. Also recommend setting your folder options to show hidden files, and not to hide known file extensions.)

    2. Copy all .csv files from the /windows directory to the SD card root. (A previous post lists 12 .csv files, but for my Sprint Rhod400 I only needed these
    10:

    AudioFilterTable.csv
    AudioPara.csv
    AudioPara3.csv
    AudioPara3_ATT.csv
    AudioPara3_Boot.csv
    AudioPara3_TMO.csv
    AudioPreProcessTable.csv
    DualMic.csv
    TIAGC.csv

    The other two were DualMic files that ATT and TMobile which weren't on my Sprint phone.)

    (2.5 At the same time, copy the BCM4325D0...hcd and the BCM4325D1...hcd files from /windows into the SD card root, per post 2 of this thread.)

    3. Download and copy any of the kernel and module packs from the first post and replace in your haret folder (where your haret.exe file is found. I'm using the 1319 kernel from post 1.)

    4. Run android, plug in to PC and run Droid Explorer. (I found that the first time I had to have Droid Explorer running before I plugged my Rhodium in for it to be recognized, but after that it worked either way.)

    5. Connect to your device from Droid Explorer and open console.

    6. Enter "mount -o remount,rw /" without quotes and enter.

    7. Go to /init.cfg/ and copy init.froyo.rc to your PC. (I was using Highlandsun's rootfs.img file, so per his instructions I copied and modified the init.rc file from the Android's root directory instead.)

    8. Open in Notepad++ and add the lines below to the other chmod lines below the first xdandroid set.

    chmod 666 /dev/htc-acoustic_wince
    chmod 666 /dev/tpa2016d2

    should look similar to this:

    # XDAndroid permissions
    chmod 666 /dev/htc-acoustic_wince
    chmod 666 /dev/tpa2016d2
    chmod 0777 /dev/smd0
    chmod 0777 /dev/smd1

    (8.5 Also in Notepad++ scroll down towards the end and replace the current hciattach info with the Code in the box in HighlandSun's post 2 of this thread "service hciattach...". I strongly recommend cutting and pasting, so the code is entered exactly right. No l's instead of 1's, and no extra spaces.)

    9. When done save and paste over the original in droid explorer.

    10. Copy and paste the contents of libaudio.zip to the /system/lib

    End daknap's instructions...the rest are mine...

    11. Copy and rename one of the BCM4325D...hcd files to BCM4325.hcd and add it to the /system/etc (Per post 2, you may have to try both the D0 and D1 versions of this file to get it to work. I was able to use the D1 just like HighlandSun so I suggest you try that one first.)

    12. Download and unzip the brcm_patchram_plus file from post 2, and add it to /system/bin

    13. Re-open the console (if you closed it) and type chmod 755 /system/bin/brcm_patchram_plus then hit enter.

    14. Reboot.
    4
    Hence the f&^% warning
    btw my wifi is working better than it did before, and don't tell people what they can and can't do, the warning is clearly stated
    DO IT AT YOUR OWN RISK

    Your post is pure nonsense. The kernel and modules are tied together. The fact that your current setup works indicates only that you still have the .19 modules installed.
    3
    Audio Guide

    For anyone who can't get it working easily, here's a step-by-step to test or how I managed to get it working. Not the best way but simple enough.

    1. Download Droid Explorer and Notepad++ and install. Might also need a copy of android sdk for drivers. Fresh install of FRX06 is good too.
    2. Copy all .csv files from the /windows directory to the SD card root.
    3. Download and copy any of the kernel and module packs from the first post and replace in your haret folder.
    4. Run android, plug in to PC and run Droid Explorer.
    5. Connect to your device from Droid Explorer and open console.
    6. Enter "mount -o remount,rw /" without quotes and enter.
    7. Go to /init.cfg/ and copy init.froyo.rc to your PC.
    8. Open in Notepad++ and add the lines below to the other chmod lines below the first xdandroid set.

    chmod 666 /dev/htc-acoustic_wince
    chmod 666 /dev/tpa2016d2

    should look similar to this:

    # XDAndroid permissions
    chmod 666 /dev/htc-acoustic_wince
    chmod 666 /dev/tpa2016d2
    chmod 0777 /dev/smd0
    chmod 0777 /dev/smd1

    9. When done save and paste over the original in droid explorer.
    9. Copy and paste the contents of libaudio.zip to the /system/lib
    10. Restart and that worked for me on rhod100_uk.

    I'm still trying bluetooth but thanks to devs anyway.