yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] 101matt101:
It's not true you should be very proud of your work, I know many people will appreciate it :)

Anyway, all ROMs have to start somewhere, I for one, thank you for your fantastic work :)
[Galaxy S II Original Android Development] RyanZA:
Haha thanks, hopefully we'll get this all working. :D

Audio is looking harder than just copying libs:

If you copy over the audio related libs, you end up with the following:

05-26 20:13:01.445: INFO/ServiceManager(2587): Waiting for service media.yamahaplayer...
05-26 20:13:01.615: INFO/ServiceManager(2682): Waiting for service media.audio_policy...
05-26 20:13:02.445: WARN/yamaha::media::CBase(2587): MediaYamaha Service not published, waiting...
05-26 20:13:02.615: INFO/ServiceManager(2682): Waiting for service media.audio_policy...
05-26 20:13:02.950: INFO/ServiceManager(2587): Waiting for service media.yamahaplayer...
05-26 20:13:03.620: INFO/ServiceManager(2682): Waiting for service media.audio_policy...
05-26 20:13:03.955: INFO/ServiceManager(2587): Waiting for service media.yamahaplayer...
05-26 20:13:04.625: WARN/AudioSystem(2682): AudioPolicyService not published, waiting...
05-26 20:13:04.960: INFO/ServiceManager(2587): Waiting for service media.yamahaplayer...
05-26 20:13:05.125: INFO/ServiceManager(2682): Waiting for service media.audio_policy...

Since the 'libmediayamahaserver.so' is there, it must just need a call from something to start it. Probably some code inside 'libmediaplayerservice.so', which we can't easily replace since it's part of the system. (Unless someone knows how?)

So the two options are: modify the source of the AOSP mediaplayerservice to start the yamaha service,

or better: find another device which has AOSP/CM already ported to it using the same sound chipset as the SGS2, and borrowing the code.

Anybody know of such a device? :)
[Galaxy S II Original Android Development] 101matt101:
Not as far as I am aware, this is the first phone to use most of the hardware parts that it does...which is unfortunate in this case...
[Galaxy S II Original Android Development] Gilg@mesh:
about the sound "problem", maybe Supercurio can make it work? :D
[Galaxy S II Original Android Development] Moody:
On the x10 mini pro, the rild binary had to do with sensors. Analyzing the init scripts will teach you a lot about what files are used for which functions.

Sent from my Milestone 2
[Galaxy S II Original Android Development] jay_993:
I dont know why i find this funny lol
[Galaxy S II Original Android Development] JJEgan:
Not if switched off. Drain zero new feature for cutting edge users

jje
[Galaxy S II Original Android Development] Nitroz:
RyanZA, you deserve every penny you get. I have just flashed this ROM and I must say, as soon as you boot, its just PURE stock android, none of this Samsung bulls***.

Granted, it is laggy but obviously its currently in development.

Just because you are dedicated and this ROM so far is fantastic, I donated £5 GBP. I know it isn't much, but I'm stuck for cash. Please don't give up on this ROM because I for one will be using this permanently when it's a finished build. RyanZA is back ladies and gentlemen!
[Galaxy S II Original Android Development] RyanZA:
AFAIK supercurio has investigated the kernel side of the audio, and not so much the Android->Kernel bridge which is the new issue. ;) He can probably help out a lot since he knows a lot about the hardware and that, though!

It looks like Samsung has done a lot of modding to Android for the sound and that though, such as adding extra DRM stuff. No source unfortunately, so will be some detective work involved.

Analysis I did of the samsung open source stuff they have released awhile back:

The open source files samsung has provided appear to be fairly random:
"DTUN" - some type of device connection library (bluetooth? usb?)
"oscl_snprintf.cpp" - a source file for opencore, opencore being the standard library used for audio codecs and that.. but why only one random file? Only part of opencore they changed?
"iptables", "iproute2" - Linux firewall - no idea
"alsa-lib" - creates libasound, relies on libdl
"ppp" - looks like standard linux ppp
"bluetooth" - self explanatory, should make getting bluetooth to work easy enough
"libexifa", "libjpega" - no clue why samsung would change these?

So we hopefully have a nice place to start with the alsa-lib.

Got it to work after all, it was the build.prop with a bad path. Was looking for complicated reasons, but it was nice and simple!

The lag is whenever it would play a sound - it freezes up for a second or so. Should go away as soon as we have sound.

Thanks for the donation, much appreciated! :D
[Galaxy S II Original Android Development] tready:
v2 works loads better than v1 my phone dodnt get hot this time kept it on for an hour pushed some apps to it via adb they all opened without fc. didnt get any freeze ups ither awsome keep it going ill donate some cash payday
[Galaxy S II Original Android Development] t0ph0id:
Look forward to this becoming usable enough to run daily.

Keep up the good work.
[Galaxy S II Original Android Development] akgrown:
Don't have my SGS2 yet, but already excited about your work on this. Beer money coming your way!
[Galaxy S II Original Android Development] sackynuts:
You are my new hero! :-)
[Galaxy S II Original Android Development] Nitroz:
Does the Market work? If so, could you include it in the next update? I want to start using this ROM a little more but with no access to the Market I wanted to access some apps etc.
[Galaxy S II Original Android Development] bilboa1:
No sources ? XD
[Galaxy S II Original Android Development] pulser_g2:
I think a user had that in a test unreleased rom I made, where I pulled out dozens of system apks...

not sure, error looks similar
[Galaxy S II Original Android Development] Major_Sarcasm:
@Ryan: Would you be kind enough to pop a date or version number in the thread title when you update? It would make it easier for people to know when you've released another version.

Very much appreciate your efforts thus far :)
[Galaxy S II Original Android Development] jazzor:
I tried to get the rom to use the Mali graphics libraries as opposed to the generic 'android' graphics driver (see egl.cfg).

I copied over the lib/egl section from stock as well as libMali.so from/lib.

When booting with this setup, it will give a blank screen after kernel (not even the 'android' animation). Any ideas?
[Galaxy S II Original Android Development] cTrox:
That was me, and yeah it's pretty much the same.
[Galaxy S II Original Android Development] jazzor:
For sound, did also copy over com.yamaha.android.media.jar/odex over into framework?
[Galaxy S II Original Android Development] RyanZA:
It's all stock AOSP, and my build scripts are a bit wonky. Plan to fix up the build scripts soon though, and make a nice guide.

Samsung has put part of the audio code into a system APK? That's pretty unconventional, haha! Will give it a test, thanks. Might not be the best way to go though, will have to see.

Will do.

It's probably a linker error, will check it out, not sure how fixable it will be without sources though. I'm not 100% up on how Android uses OpenGL though, since it should have everything it needs for Mali OpenGL in the kernel? Guess it will take some reading. :D
[Galaxy S II Original Android Development] pulser_g2:
Damn I wish I had 2 SGS2s... Then I could use one as a phone, the other as a toy... :(

I was gonna take a look at the ROM and see what I could binary hack... :)
[Galaxy S II Original Android Development] cTrox:
Me too, couldn't resist to test this yesterday, so I had to restore everything from titanium. Nandroid Backup would be nice for something like this.

Sorry for OT but does anyone know why there isn't a custom recovery yet? Other devices get this just after getting root.
[Galaxy S II Original Android Development] RyanZA:
I'm guessing everyone just expects someone else to do it, and nobody has got around to doing it yet? There isn't much use for just a custom recovery since we already have kernels with init scripts, which is just as good. There is probably someone porting clockworkmod already, too.

Progress update on sound:

The yamahaservice doesn't seem to be that easy to get working:

05-27 19:22:36.335: ERROR/yamaha::media::ParamFile(2586): readVolume(/data/system/volume.dat) Error.
05-27 19:22:36.340: ERROR/yamaha::media::AlsaHwdepCtrl(2586): Error: snd_hwdep_open(mc1n2, 2) : No such file or directory
05-27 19:22:36.340: ERROR/yamaha::media::AlsaMixerCtrl(2586): snd_mixer_attach("mc1n2") err = -2
05-27 19:22:36.340: ERROR/yamaha::media::AlsaMixerCtrl(2586): snd_mixer_attach("mc1n2") err = -2
05-27 19:22:36.340: ERROR/yamaha::media::AlsaHwdepCtrl(2586): Error: snd_hwdep_open(mc1n2, 2) : No such file or directory
05-27 19:22:36.340: ERROR/ServiceManager(2578): add_service('media.yamahaplayer',0x1) uid=1013 - PERMISSION DENIED

05-27 19:22:42.795: WARN/PackageManager(2681): Library not found: /system/framework/sechardware.jar
05-27 19:22:42.800: DEBUG/installd(2588): DexInv: --- BEGIN '/system/framework/com.yamaha.android.media.jar' ---
05-27 19:22:42.820: DEBUG/dalvikvm(2718): creating instr width table
05-27 19:22:42.835: DEBUG/dalvikvm(2718): DexOpt: load 1ms, verify+opt 3ms
05-27 19:22:42.845: INFO/ServiceManager(2586): Waiting for service media.yamahaplayer...
05-27 19:22:42.875: DEBUG/installd(2588): DexInv: --- END '/system/framework/com.yamaha.android.media.jar' (success) ---
05-27 19:22:42.880: WARN/PackageManager(2681): Library not found: /system/framework/secmediarecorder.jar
05-27 19:22:42.880: WARN/PackageManager(2681): Library not found: /system/framework/twframework.jar
05-27 19:22:42.880: WARN/PackageManager(2681): Library not found: /system/framework/seccamera.jar
05-27 19:22:42.880: WARN/PackageManager(2681): Library not found: /system/framework/com.google.android.maps.jar
05-27 19:22:42.885: WARN/PackageManager(2681): Library not found: /system/framework/com.samsung.device.jar
05-27 19:22:42.885: WARN/PackageManager(2681): Library not found: /system/framework/sec_feature.jar
05-27 19:22:42.885: WARN/PackageManager(2681): Library not found: /system/framework/libvtmanagerjar.jar

Looks like it might rely directly on touchwizz. Since it should just work off alsa, I'll try go the other route and get AOSP to talk to it without the Samsung extras directly through alsa. Probably just comes down to getting the channels correct, etc?
[Galaxy S II Original Android Development] Tricky103:
Did cm7 guys have a big tw problem for a while on the old SGS..

Great project RyanZA. I will follow your progress. Phone is only 6 hours old. I dont fancy taking my chances on anything quite yet :)
[Galaxy S II Original Android Development] Ramalama:
Thank you very much for your time, for porting aosp!!!

It brings us a step closer to cm7 and Miui! :-)

Thank You!!!

I Love the Galaxy, but i hate the Samsung ****firmware....

Have Galaxy S with Miui and i want Galaxy S2 with Miui^^ xD

Cheers :-)
[Galaxy S II Original Android Development] Thijs96:
Porting CWM is so damn hard because it doesn't have a recovery partition. The SGS2 uses a recovery binary in /sbin, which it runs when rebooting in recovery (correct me if I'm wrong) I haven't found the sources for that binary yet.
[Galaxy S II Original Android Development] B3311:
Good to see you here tricky - expecting a full kitchen within 24 hours;)
[Galaxy S II Original Android Development] RyanZA:
Nah, that doesn't make it hard. It's the same as the SGS1 anyway. It's just a matter of using 'cp' :)
[Galaxy S II Original Android Development] ragiut1:
@RyanZA thnx for your great effort

is there a way to backup my current ROM before testing this one?
[Galaxy S II Original Android Development] godutch:
I am on my phone and it's a bit hard to give you the link but google the second warning about the second warning about media policy....

Edit positioning the cursor is next to impossible on this phone.
[Galaxy S II Original Android Development] nightranger73:
That's why I can't live without smart keyboard or the new swift X Beta which have arrows buttons on bottom line

Inviato dal mio GT-I9100 usando Tapatalk
[Galaxy S II Original Android Development] Gilg@mesh:
with Smart Keyboard Pro you can move the cursor with volume buttons
[Galaxy S II Original Android Development] drakaz:
When you speak about scripts, is it a vendor or something else ?
[Galaxy S II Original Android Development] nightranger73:
Or better enable arrows on kb ;) like 2nd pic of my previous post

Btw we're going OT... Any other news about the porting?

Can't wait for an almost working for daily usage... And sound should be enough for me
[Galaxy S II Original Android Development] MaTiCeK-:
Does this rom recognize m4a tag data correctly? If so, would it be hard to use the media scan from this ROM in a stock samsung ROM?
[Galaxy S II Original Android Development] rumsey:
I'll be watching this thread closely, thinking of picking up a s2 but not until there's an aosp build working with all the features. TouchWiz is like a nightmare to me.
[Galaxy S II Original Android Development] havbob:
This is probably the most interesting ROM to date for GS2. I barely know anything about ROM cooking but as an IT major I'll gladly try to help you out any way I can if you need any help (I'm also free for the summer). Just say if you need/want help :)
[Galaxy S II Original Android Development] RyanZA:
It should recognize it, yeah. Porting it would be hard - media scanner (I think) is part of the core system, so just yanking it across is gonna cause link errors...

Still haven't been able to get sound working yet - it's trickier than I thought it would be, mostly because no open source device has used this sound hardware before - and for some reason just using stock android alsa + kernel driver doesn't seem to be working?

I'm not the most clued up on Linux sound though, so I'm reading stuff and hopefully it'll sink in. ;)
[Galaxy S II Original Android Development] godutch:
have you tried to play a sound as root?
[Galaxy S II Original Android Development] MaTiCeK-:
This is driving me insane really. As for your ROM, once we have CMW, I'll be all over it. I don't really like Odin, as I have to boot into Windows each time I want to flash something.
[Galaxy S II Original Android Development] elban:
I do as well, but I've been able to flash a kernel with heimdall, see this thread:

http://xdaforums.com/showthread.php?t=1078924

I don't think anybody has ever tried with a pda file, but it might work just fine...
[Galaxy S II Original Android Development] godutch:
did you also already have a look at the sources samsung posted? the make a remark about ALSA and BT"

4. Add the following lines at the end of build/target/board/generic/BoardConfig.mk

BOARD_USES_ALSA_AUDIO := true

BOARD_HAVE_BLUETOOTH := true

BOARD_HAVE_BLUETOOTH_BCM := true

BT_ALT_STACK := true

BRCM_BT_USE_BTL_IF := true

BRCM_BTL_INCLUDE_A2DP := true

BOARD_USES_ALSA_AUDIO := true
[Galaxy S II Original Android Development] RyanZA:
Should be possible to use heimdall to flash the new CFRoot+CWM kernel, and then install AOSP using a CWM image off an SD card. Just need to get the image in a CWM compatible format, which is pretty easy. (command to clear the /system and /data dirs, then just copy out the new /system dir and reboot)
[Galaxy S II Original Android Development] elban:
I guess most future roms will come in cwm format too, so we need to try that cfroot with heimdall thing :-)

Only thing stopping me is that it's a pda flash, not a kernel flash which is documented to work.

EDIT: did it! it worked! now we can flash without pc and without odin!
[Galaxy S II Original Android Development] kawa636r:
YESSSSSSSSSSSS..... for audio related have we got any news?
[Galaxy S II Original Android Development] RyanZA:
None yet - can't seem to work out how to get the alsa settings working. I gotta admit I've never touched alsa before or anything like that, so this is all pretty new to me. Does anybody know how android/alsa ties together? I always thought that the linux kernel handled all of that, and userspace/android just asked also to play some sounds. Not the case here, we end up with the audio channel being 'open', but whenever Android tries to write to it, it just locks. I'm guessing it's settings somewhere, but I can't really work out how to change that stuff - it should all be kernel side after all!

Trying to use the stock samsung audio yamaha stuff ends up with the following:

06-01 22:41:46.510: ERROR/yamaha::media::ParamFile(2587): readVolume(/data/system/volume.dat) Error.
06-01 22:41:46.515: ERROR/yamaha::media::AlsaHwdepCtrl(2587): Error: snd_hwdep_open(mc1n2, 2) : No such file or directory
06-01 22:41:46.515: ERROR/yamaha::media::AlsaMixerCtrl(2587): snd_mixer_attach("mc1n2") err = -2
06-01 22:41:46.515: ERROR/yamaha::media::AlsaMixerCtrl(2587): snd_mixer_attach("mc1n2") err = -2
06-01 22:41:46.515: ERROR/yamaha::media::AlsaHwdepCtrl(2587): Error: snd_hwdep_open(mc1n2, 2) : No such file or directory
06-01 22:41:46.515: ERROR/ServiceManager(2579): add_service('media.yamahaplayer',0x1) uid=1013 - PERMISSION DENIED
[Galaxy S II Original Android Development] kawa636r:
the service is running? seems to be that can't read volume because doesn't find service "writings"
[Galaxy S II Original Android Development] jazzor:
What about including the alsa stuff from init.rc? I can see that it sets permissions and ownerships for the devices at boot.
[Galaxy S II Original Android Development] RyanZA:
That was the first thing I tried... I merged all of the extra samsung stuff into the init.rc.
[Galaxy S II Original Android Development] godutch:
LIke I suggest, did you already try running a sound as root or alternatively check the permissions on those files above?
[Galaxy S II Original Android Development] godutch:
in your rom I see aplay and amix, you can use these to check if channels are muted and to test a known good sound file (aplay xxxx.wav), I would also try running as root.

On the stock samsung rom there is a directory /system/usr/share/alsa it contains the setup files for different speaker configurations and output, I think you need these too, I couldn't find them in your rom.

(i can't flash your atm because I am a bit too busy)
[Galaxy S II Original Android Development] RyanZA:
Playing sounds directly works fine, of course, since it's using the open source SGS2 kernel that is used for everything. The problem is Android has a layer between itself and Linux which needs to be configured properly to use the sound hardware. I have no idea how to set this up to work correctly with this yamaha sound chip in the SGS2.

The /system/usr/share/alsa looks helpful though, thanks! Maybe that's part of what I'm missing. I'm fairly sure it's just some kind of settings somewhere/somehow - since Android should have full support for the ALSA used by the SGS2 right out of the box.
[Galaxy S II Original Android Development] godutch:
Well I didn't know playing sounds directly worked, there are many things which could be broken or settings that needed to be tweaked with the alsa setup, it's very complex. I think it's easier to get x up and running from scratch than alsa :D
[Galaxy S II Original Android Development] godutch:
Btw Ryan do you know how you can just checkout a single revision (eg 2.3.3, the best revision to start imho because we don't have to worry so much about incompatible libs)?

I tried : repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread but the download is still over 8GB
[Galaxy S II Original Android Development] RyanZA:
Wow, that's exactly what I didn't want to hear! But it does feel that way... Best bet might be to find someone who has ported ALSA for a different device and get some kind of a list of things we need to find out and do. I really have no idea how it all ties together myself, even with a lot of reading - other than it's layers on layers on layers.

Android is enormous. Don't think there is any way around this, you just have to grab it. I left it running overnight. I'm using Crespo (Nexus S) as the base, with Samsung binaries for things like the radio copied directly from the SGS2 device. The incompatible libs only comes if we want to use the closed Samsung .so modules. AFAIK for things like the radio, there is no choice here - the radio is far too complex to reverse engineer from scratch. Luckily we don't have to - the radio libs work just fine when we copy em.

The best route for sound will be to compile stock AOSP with ALSA support (easily done), and then configure it to work with the new Yamaha card in the SGS2 (how??), and ignore all of the Samsung sound extras if possible.
[Galaxy S II Original Android Development] godutch:
Nah, it's just that every commit of every file is downloaded, it compiles to 80MB the source is 10x the binary size max.
[Galaxy S II Original Android Development] RyanZA:
Well... my compiled android dir comes to 11GB, with only 1 target compiled. So there's no way it's that small! Android really is pretty big. It's got the emulators in there; the different SDK platforms; all of the stock apps; source code for all kinds of libraries; looks like it even has some XCode stuff in there.

So it's big! ;)
[Galaxy S II Original Android Development] kerberos7:
Hi!

Whats the status? :confused:
[Galaxy S II Original Android Development] oleost:
My phone is currently dead. So I cant test it myself.

I was wondering if someone could make and video of the phone running this rom?
[Galaxy S II Original Android Development] LarcusMywood:
I take it as this has no Samsung code it doesn't run in 16bit colour with the gradient banding issue?
[Galaxy S II Original Android Development] kickassdave:
Good point. I'd say yeah... but I'm just guessing :)

I don't know if I'll ever switch to this ... the battery life was awful on these type of roms on the SGS1.
[Galaxy S II Original Android Development] godutch:
Yeah I was wondering this too but unfortunately I don´t have the time to test. I read that the sgs1 had banding to which was supposedly caused by a sharpening filter (inside the kerne) and was fixed by supercurio...
[Galaxy S II Original Android Development] marvinhemstock:
wow u guys work fast :)

good luck with this project, i will keep an eye on this very interesting thread.

keep up the development on sg2 please :D

android for life , marv
[Galaxy S II Original Android Development] awesome-member:
Any progress? Hope you've not abandoned this project.let's see if you or CM team(1 man V a team) get the working built out first. I m as excited as if not more about asop than CM.
[Galaxy S II Original Android Development] cobhc:
I would say if the OP can get AOSP out, then he could share his work with the CM team, as CM is based off of AOSP.

As soon as you get sound and WiFi working, I'll be moving over to this. Sensors, Bluetooth and Cameras I can cope without. I loved AOSP Android on my HD2.
[Galaxy S II Original Android Development] cobhc:
Actually just WiFi would do for now lol.
[Galaxy S II Original Android Development] kroat999:
Sound status ?
[Galaxy S II Original Android Development] kroat999:
Is this thread dead ?
[Galaxy S II Original Android Development] Thijs96:
'At least this is a proof of concept that AOSP can work on our devices'

It's in the OP
[Galaxy S II Original Android Development] cobhc:
I don't get your point? He's already updated the rom once, so it's not like he just uploaded an original rom and abandoned the project.
[Galaxy S II Original Android Development] Motzemann:
Maybe he does not have time to update... People are working or may have family ;-)
[Galaxy S II Original Android Development] cobhc:
I was never questioning whether he had the time to update or not, I was simply trying to figure out why Thijs96 was reiterating part of the OP.
[Galaxy S II Original Android Development] naddie:
I think what Thijs96 meant was that the OP said that this is "at least" a "proof of concept", so do not expect a full working ROM. Just something the OP was toying with, and anyone can pick up where he left off.
[Galaxy S II Original Android Development] awesome-member:
bump.....update please.:confused: