# Build your own CyanogenMod10 for HP TouchPad



## andymw (Sep 11, 2011)

A few of us have been trying to build CM10 (Jelly Bean) on the HP TouchPad ever since JCSULLINS posted his early version without audio. RedFlea has posted a guide on how to do this at http://goo.gl/Zpht8. Several of us have managed to build our own CM10's using the instructions and we are now trying to work out how to fix audio etc.. Starting this thread to track our progress. I'm currently creating a build with the latest wolfson media wm8994-core commit files to the linux 2.6 distribution to see if we can make progress and will post results once built .... probably tomorrow.


----------



## Redflea (Jun 7, 2011)

andymw said:


> A few of us have been trying to build CM10 (Jelly Bean) on the HP TouchPad ever since JCSULLINS posted his early version without audio. RedFlea has posted a guide on how to do this at http://goo.gl/Zpht8. Several of us have managed to build our own CM10's using the instructions and we are now trying to work out how to fix audio etc.. Starting this thread to track our progress. I'm currently creating a build with the latest wolfson media wm8994-core commit files to the linux 2.6 distribution to see if we can make progress and will post results once built .... probably tomorrow.


Nice idea, Andy, to give this effort more publicity!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## lauterm (Sep 2, 2012)

I upgraded my CPU/motherboard/RAM this weekend and reinstalled Xubuntu 12.04. I'm back up and building (much more quickly) now. I copied libaudio and asound.conf from the android_device_samsung_aries-common and android_device_samsung_galaxysmtd trees, respectively. These trees are for galaxy s devices with the wm8994 audio that is supposed to be register compatible with our wm8958. My hope was that sound would work minus the "beats audio enhancements". I got a successful build using the TARGET_PROVIDES_LIBAUDIO directive in BoardConfig.mk. It does boot, but it behaves much the same as the alsa only builds I have tried. It acts like everything is fine, but no sound comes out. I'm not seeing any errors in logcat or dmesg. Something is obviously failing. I think I need to learn significantly more about debugging tools. Can anyone give me anyone pointers as to what debugging utilities to read up on?


----------



## NewbyJE (Jan 19, 2012)

lauterm said:


> Can anyone give me anyone pointers as to what debugging utilities to read up on?


If you are not already doing so, creating a boot logcat using adb can be very informative.
Power off the TouchPad
Connect a USB cable between TouchPad and computer
Open terminal to get a command prompt
Enter: export PATH=$PATH:/home/john/Downloads/android-sdk-linux/platform-tools (edit per your setup)
Enter: export PATH=$PATH:/home/john/Downloads/android-sdk-linux/tools (edit per your setup)
Enter: adb logcat 2>&1 | tee jb_boot.txt
Re-boot TouchPad
As Android starts up, a log will be written to the screen and to the file
When you have seen enough, type Ctrl-Z to quit
John


----------



## lauterm (Sep 2, 2012)

NewbyJE said:


> If you are not already doing so, creating a boot logcat using adb can be very informative.
> Power off the TouchPad
> Connect a USB cable between TouchPad and computer
> Open terminal to get a command prompt
> ...


Thanks, I'll check that out to see if it gives me any additional messages that aren't in dmesg or normal logcat.


----------



## drmarble (Jan 19, 2012)

That is the normal logcat. It's just run through tee so you can see it as well as put it into a file. I think the only debug tool you aren't using is kmesg. Unfortunately, I don't remember how to get them. They contain the kernel messages from the last couple of boots and are stored in memory so you need to get them quickly after booting.
Good work on trying the samsung libraries. I'm planning to do the same. I hadn't thought about TARGET_PROVIDES_LIBAUDIO. I'm going to try running extract_files.sh on the samsung zip file to get the proprietary files. Those aren't on Gerrit for copyright reasons.
We need to keep at this. jcsullins has even disappeared from irc (#cyanogenmod-touchpad Freenode). We are the only ones working on this. The future or jellybean for the touchpad is in your hands. 
Best of luck. Lets all keep eachother posted.


----------



## lauterm (Sep 2, 2012)

drmarble said:


> I think the only debug tool you aren't using is kmesg.


I think that command is:
adb shell cat /proc/kmsg

adb logcat was helpful too. I immediately saw stuff that I just hadn't scrolled far enough back for yet. So, thank you both.

I did notice that I forgot to add a line to device_tenderloin.mk to copy the audio_policy.conf that I stole from samsung/aries-common to /system/etc. It was trying to fall back to some default audio policy. I'm not holding out much hope that this actually fixes anything.

I'm also assuming that TARGET_PROVIDES_LIBAUDIO means I don't really need any prebuilts for audio. I assume I am building it in the target instead. So, I commented out all the tenderloin prebuilt stuff in device_tenderloin.mk. I don't want to chance any of them overwriting libraries I am building.


----------



## lauterm (Sep 2, 2012)

oh and cat in android behaves like tail -f.


----------



## drmarble (Jan 19, 2012)

One additional debugging tool is klog:
novacom get file://klog > klog.txt
I think you do this just after booting even if the boot failed. Lots of information about kernel startup in there. Many files have optional extra debugging information that can be enabled with global DEBUG set. Lots of subprograms have their own DEBUG_* variables also. I know there's lots in the touchscreen code.
To summarize our tools:
adb shell cat /proc/kmsg > kmsg.txt
adb shell dmesg > dmesg.txt
adb logcat 2>&1 | tee jb_boot.txt
novacom get file://klog > klog.txt
These four logs should give us the information we need for debugging our various problems as they develop. Or at least something to put on pastebin and ask about here.


----------



## Lafayette (Sep 12, 2011)

I'am with you, but I'cannot help you.​I'm too noob.​


----------



## lauterm (Sep 2, 2012)

We're missing something for USB audio support:


```
<br />
E/AudioFlinger(  157): int [URL=android::load_audio_interface(char]android::load_audio_interface(char[/URL] const*, audio_hw_device_t**) couldn&#39;t load audio hw module audio.usb (No such file or directory)<br />
I/AudioFlinger(  157): loadHwModule() error -2 loading module usb<br />
W/AudioPolicyManagerBase(  157): could not open HW module usb
```
I just commented it out in audio_policy.conf for now. We can worry about USB audio once regular audio works. 

EDIT: Nevermind. It was an easy fix. I added audio.usb.default right under audio.primary.tenderloin in device_tenderloin.mk.


----------



## drgci (Jan 20, 2012)

lauterm said:


> We're missing something for USB audio support:
> 
> 
> ```
> ...


finaly you fix the sound on jelly bean?!


----------



## lauterm (Sep 2, 2012)

drgci said:


> finaly you fix the sound on jelly bean?!


No, sorry, not yet. I just fixed that error message.


----------



## andymw (Sep 11, 2011)

OK .. gave up on the latest audio driver and have decided to go back to alsa lib. Currently compiling version 1.0.25 which is much more recent, so will let you know if that makes any difference.


----------



## andymw (Sep 11, 2011)

andymw said:


> OK .. gave up on the latest audio driver and have decided to go back to alsa lib. Currently compiling version 1.0.25 which is much more recent, so will let you know if that makes any difference.


OK .. the newer alsa-lib compiled fine. Now need to start looking at the drivers. If Dalingrin or JCSullin read this, I'd welcome any pointers at this point. I will continue to try and get the full Alsa stack working, but if I'm wasting my time, it would be good to know.


----------



## lauterm (Sep 2, 2012)

I know what you mean. I've tried so many things. None of them have worked. I wish I knew more. I built with jcsullins' 3.0 kernel. It booted, but touch didn't even work. I've made alsa builds. I've made legacy builds. I've made generic audio build. None of them worked. Maybe next I'll try a 3.4 kernel. ;-P


----------



## kicker22004 (Jun 12, 2011)

Please don't give up on this. My touchpad is still better than most because of out great devs here and on xda ( ya I know...but true). Please cm team help him out if only to pass on info.

Sent from my Galaxy Nexus using RootzWiki


----------



## Redflea (Jun 7, 2011)

Maybe very dumb question...what about the dev who works on audio hacking (a lot for Samsung devices I believe),...Supercurio is his twitter handle.

Could he be someone worth bouncing a couple questions off?


----------



## drmarble (Jan 19, 2012)

Why was this tread moved out of development? It is very clearly a development thread. It's the only place on the web that people are discussing getting cm10 working on the Touchpad. 
Back to development. There are no problems building with alsa. It happily starts up the WM8994 chip. No errors in any logs. Just no sound. I'm going to compare the logs to output from cm9 logs and look for differences. I installed AlsaMixer from the market. It installs some files and lets me make settings. They also have no effect. Some logs make it look like bluetooth is trying to output sound but I don't have any bluetooth devices to listen on.
I'm going to work with the samsung scripts and libs. I also want to try the Meizu ics libraries for our sound chip. Samsung defines USE_ICS_BLOBS or some such thing. Maybe defining that and putting in the Meizu libs will work. I am full of ideas; I'm just too lazy to try them.

I have also noticed that I can't play videos. They are mp4 files that play fine on cm9. No video on cm10. MX player looks like it's working but it isn't. Nothing else plays them either.
JellyBean is still far from working right.


----------



## mthous01 (Dec 22, 2011)

Any chance someone contacted Supercurio regarding the wolfson audio drivers. He's the man regarding these?

tapping from a [email protected] Charge


----------



## fredplex (Sep 16, 2011)

Hey guys,

just about to build my own CM10 following the instructions here and I am not 100% clear on what to put into the local_manifest.xml in step:

*3. ADD THE TENDERLOIN (HP TOUCHPAD) DEVICE FOLDER IN ICS*

It says to copy the file from the link above but there is no link in that step and I only see:

[background=rgb(247, 247, 247)]

```
<?xml version="1.0" encoding="UTF-8"?>
```
[/background]

which does not look complete to me.

Can someone pls clarify what needs to go into local_manifest.xml for the tenderloin CM10 build ?

Thanks, FredPlex


----------



## jsnweitzel (Feb 20, 2012)

This is what I have in mine:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_hp_tenderloin" path="device/hp/tenderloin" remote="github" revision="jellybean" />
<project name="CyanogenMod/hp-kernel-tenderloin" path="kernel/hp/tenderloin" remote="github" revision="ics" />
<project name="CyanogenMod/android_hardware_atheros_wlan" path="hardware/atheros/wlan" remote="github" revision="jellybean" />
</manifest>


----------



## ften (Aug 26, 2011)

jsnweitzel said:


> This is what I have in mine:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <manifest>
> ...


Thanks, was wondering about that part of the guide.


----------



## modd (Oct 16, 2011)

andymw said:


> OK .. the newer alsa-lib compiled fine. Now need to start looking at the drivers. If Dalingrin or JCSullin read this, I'd welcome any pointers at this point. I will continue to try and get the full Alsa stack working, but if I'm wasting my time, it would be good to know.


I am a complete newbie. Can you explain why the legacy audio is not working in jellybean while it is working in ICS. I searched this and the CM9 build thread for any information and couldn't find the reason. I am looking for some pointers to look at. It would be a great help if you can educate others on the progress you have made so far.
TIA.


----------



## modd (Oct 16, 2011)

Does any one have access to source for prebuilt audio libs or are they propreitary files.


----------



## modd (Oct 16, 2011)

JC seems to have audio working in CM10.

http://goo.im/devs/jcsullins/cmtouchpad/preview/cm-10-20121105-EXPERIMENTAL-tenderloin-FOR_LIMITED_TESTING_ONLY.zip

http://www.reverendkyle.com/index.php/articles/174-cm10-for-the-hp-touchpad-now-with-sound


----------



## Imacellist (Dec 17, 2011)

I am very excited about this. Glad JC is back in the game


----------



## Dorregaray (Jan 26, 2012)

I have ported the camera stuff to CM10: https://github.com/Dorregaray/cm10-tenderloin-camera-build if anyone is interested. I'm not planning to switch to CM10 soon so don't know how it actually work (but at least compiles) ;-)


----------



## jwhood (Sep 5, 2011)

Dorregaray said:


> I have ported the camera stuff to CM10: https://github.com/Dorregaray/cm10-tenderloin-camera-build if anyone is interested. I'm not planning to switch to CM10 soon so don't know how it actually work (but at least compiles) ;-)


"D" bro u are amazing,you are just knocking them down left and right!!!
Sent from thee unknown!!!


----------



## DevinGn (Oct 28, 2012)

Dorregaray said:


> I have ported the camera stuff to CM10: https://github.com/D...in-camera-build if anyone is interested. I'm not planning to switch to CM10 soon so don't know how it actually work (but at least compiles) ;-)


This is good news! I really appreciate your work, if it wasn't for your work I'd probably be running stock WebOS.

Can anyone confirm working camera when built?


----------



## Lothinator (Jun 30, 2011)

If nobody else tries this out, I might attempt it... but it could take me a few days to get a build environment set up again...

Anyone tried and failed?


----------



## drmarble (Jan 19, 2012)

I built cm10 for the touchpad many times. I never figured out how to get sound or drop sleeping drain below 100mA. jcsullins has done both. He modified the nexus7 audio hal for sound and found a permission problem in liblight.c that dropped power consumption. He hasn't provided more details because he feels his work isn't good enough for public consumption. The finished roms he has produced are nice. Once he uploads his changes somewhere the rest of us can build as nice roms as he does. Until then, building and flashing a somewhat crummy but still personally built rom is satisfying and is good preparation for future commits on gerrit that will let us build our own good working roms. I recommend going ahead and setting up your build environment (64 bit only for jb). It's cheap, educational, harmless and fun.


----------



## Lothinator (Jun 30, 2011)

In that case I'll just wait for a more stable release. Not like I would use the camera anyway lol. I never use the FFC on my phone and that works just fine.

Sent from my HP TouchPad using Tapatalk 2


----------



## modd (Oct 16, 2011)

Has any one tried repo sync recently. I am getting errors saying the remote repository is not available. I see Cyanogenmod/hp-kernel-tenderloin removed from github.


----------



## Imacellist (Dec 17, 2011)

Just did one today and didnt have a problem. I'm working on getting an up to date cm10 right now.


----------



## drmarble (Jan 19, 2012)

The repository is there. It is oddly named compared to other kernel repositories:
https://github.com/CyanogenMod/hp-kernel-tenderloin
You have to add it to your local_manifest.xml, eg:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_hp_tenderloin" path="device/hp/tenderloin" remote="github" revision="jellybean" />
<project name="CyanogenMod/hp-kernel-tenderloin" path="kernel/hp/tenderloin" remote="github" revision="ics" />
</manifest>

Still no jellybean kernel. jcsullins has made lots of progress. I hear he'll release to github in two weeks!


----------



## muz (Oct 16, 2011)

the instructions for this built me a whole (non-working) rom.

Im very new to this, but just want the kernel so i can try cross-compiling modules for additional devices i want to use with the TP. where did i go wrong?


----------

