FORUMS
Remove All Ads from XDA

[TESTING] New audio routing for Froyo

872 posts
Thanks Meter: 264
 
By highlandsun, Inactive Recognized Developer on 13th May 2011, 06:20 AM
Post Reply Email Thread
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/xda...7k_libacoustic
The kernel patches were taken from the htc-msm-2.6.27-libacoustic branch of this repo https://gitorious.org/~jbruneaux/lin...-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.
Attached Files
File Type: zip libaudio.zip - [Click for QR Code] (47.4 KB, 571 views)
File Type: zip kernel-01323.zip - [Click for QR Code] (2.12 MB, 369 views)
File Type: zip kernel-01324.zip - [Click for QR Code] (2.12 MB, 451 views)
File Type: zip kernel-01319.zip - [Click for QR Code] (2.12 MB, 351 views)
The Following 9 Users Say Thank You to highlandsun For This Useful Post: [ View ] Gift highlandsun Ad-Free
 
 
13th May 2011, 06:21 AM |#2  
OP Inactive Recognized Developer
Flag Los Angeles
Thanks Meter: 264
 
Donate to Me
More
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.
Attached Files
File Type: zip brcm_patch.zip - [Click for QR Code] (5.2 KB, 467 views)
The Following 6 Users Say Thank You to highlandsun For This Useful Post: [ View ] Gift highlandsun Ad-Free
13th May 2011, 06:48 AM |#3  
OP Inactive Recognized Developer
Flag Los Angeles
Thanks Meter: 264
 
Donate to Me
More
[reserved...]
13th May 2011, 06:57 AM |#4  
Senior Member
Thanks Meter: 15
 
More
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!
13th May 2011, 08:31 AM |#5  
OP Inactive Recognized Developer
Flag Los Angeles
Thanks Meter: 264
 
Donate to Me
More
Did you also copy the *.csv files?
13th May 2011, 10:12 AM |#6  
Senior Member
Flag St. Petersburg
Thanks Meter: 66
 
More
Thanks, highlandsun!
But, you can compile your test kernel with modules that supports tiwlan?
If it not so hard.
13th May 2011, 10:26 AM |#7  
OP Inactive Recognized Developer
Flag Los Angeles
Thanks Meter: 264
 
Donate to Me
More
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.
13th May 2011, 05:19 PM |#8  
Senior Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by highlandsun

Did you also copy the *.csv files?

Yes I did...not sure what else to do...don't see anything weird in the logcat...anyone else with a Rhod400 try this yet?
13th May 2011, 05:22 PM |#9  
Inactive Recognized Developer
Thanks Meter: 3,834
 
Donate to Me
More
Quote:
Originally Posted by pdawg17

Yes I did...not sure what else to do...don't see anything weird in the logcat...anyone else with a Rhod400 try this yet?

I have, still not working... Trying to retrace the steps, everything *looks* correct...
13th May 2011, 05:33 PM |#10  
Senior Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by arrrghhh

I have, still not working... Trying to retrace the steps, everything *looks* correct...

Same problem then? No audio other than in-call?
13th May 2011, 05:37 PM |#11  
Inactive Recognized Developer
Thanks Meter: 3,834
 
Donate to Me
More
Quote:
Originally Posted by pdawg17

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 .
Post Reply Subscribe to Thread

Tags
audio, bluetooth

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes