yashsingh1/xdaforums huggingface dataset:
[Galaxy Note 4 General] gekkehenkie11:
Thanks ! One thing I don't understand though: "Then you'd probably need to create a directory vendor/samsung/trltespr too, and, looking at the trltetmo folder as a reference, add in the blobs for your ril and make sure they get copied to the right place on the phone. (Before you do this, make sure that they actually work though...) But this is where you put those "blobs"." So you're saying that possibly I need other/more blobs than 910T ? And how do I find that out ? I mean how do I know what files are blobs ? Or should I just compare output directory from build to system directory from samsung ?
[Galaxy Note 4 General] fattire:
Well again, I literally have no idea what the "F" version of the Note 4 is, or who it's for. I haven't looked to see what "international" means exactly. But anyway, when you are booting up, it's possible your radio, if it is different, will need to load up some firmware.. you can check dmesg, which is the output from your kernel as well as logcat to look for errors where it can't find a file for example. You can also look for differences in the stock file list from tmo vs your device (use diff for this). If it's a GSM device like Tmobile and uses the exact same radio and firmware, then maybe it's a difference in one of the configuration files or something. You can use diff again to figure out what's different. Also, you mentioned that there was stuff missing in the kernel, right? look at the difference between the defconfig for tmo and the one for you. It should give you an idea of what was "turned on" for your device, and you can then know what to pay attention to in the dmesg to see if you have all the files you need....

Make sense?
[Galaxy Note 4 General] gekkehenkie11:
Thanks fattire !! About F, it's the EUR snapdragon version. Anyway thanks for your suggestions ! I already checked dmesg but it can only hold 128 kb at the moment, which reminds me to increase that to 1024. Also great suggestion to look for difference in stock TMO vs EUR, will certainly do that. And will indeed compare defconfigs EUR vs TMO. Thanks again for your help ! And yeah of course I can help you out with that tutorial/wiki, would gladly do something back. But at the moment I just need to get radio up first, it's so frustrating to have this great great firmware we can now boot but without working radio it's of no use :(
[Galaxy Note 4 General] gekkehenkie11:
Also would really love it to see some more devs jumping in on this. I'm leaving monday for a holiday, be back beginning of january, so I doubt I will have much time for development at all. Would be sad if we'd have to wait all this time. Furthermore although I like working on this, it's a damn lot of work all by my own.
[Galaxy Note 4 General] gekkehenkie11:
SM-N910F(Qualcomm Snapdragon 805)------[Europe]------{FDD-LTE+WCDMA+GSM} 【Firmware:N910FXXU1ANIE】

SM-N910T(Qualcomm Snapdragon 805)------[USA T-Mobile]------{FDD-LTE+WCDMA+GSM} 【Firmware:N910TUVU1ANIG】

From: http://www.androidiani.com/forum/sa...samsung-galaxy-note-4-reference-thread-3.html

So seems exact same radio capabilities.
[Galaxy Note 4 General] fattire:
I'm talking out of my ass, but I wonder if it's just a matter of a new defconfig and then swapping out the firmware for different frequency support or what-have-you. That's probably being a bit optimistic tho :D
[Galaxy Note 4 General] gekkehenkie11:
New kernel doesn't make a difference, still no go. But can you elaborate on that firmware thing ? I remember I had some problems compiling, regarding firmware, basically didnt know which file to use: http://xdaforums.com/note-4/general/rd-porting-cm12-t2951934/post57348687#post57348687

Those bcm* files is what you're talking about ? This seems like a good candidate if so :)

*EDIT* actually that post probably explains our cam problems too ;)

*EDIT2* and we used 'libmdmdetect.so' instead of libdetectmodem.so, not sure if that is causing problems ...
[Galaxy Note 4 General] fattire:
Do you have the things inside /sys/... that you were missiing before?

The firmware is stuff loaded into the hardware, such as programs for wifi modules or radios that exist in binary form only. They're usually loaded at startup, though in some cases they're loaded just before they are used... if they'r enot there, you'll often see a message in logcat (if it's loaded by userspace stuff) or dmesg (if it's loaded by the kernel)... usually it specifies where the file it's looking for is. Problems can be that the file is missing or that the permissions are not set right...
[Galaxy Note 4 General] gekkehenkie11:
You mean /dev/mhi_pipe_14 right ? That's the port that's missing and it's indeed still missing, so also on 910F kernel.

Hmm I thought modem was independent of ROM , but you're saying modem firmware is loaded from userspace too ? Anyway the problem during building was:

I didn't know IF I had to use those and if so, which ... Anyway rebuilding kernel as we speak with 1024 kb for dmesg buffer, so I can see the first 7 seconds of boot too :)
[Galaxy Note 4 General] gekkehenkie11:
Actually your comments make me think that most probably I just need the filenames unchanged from original samsung firmware (I renamed them to match the missing filenames) and put those in the firmware dir ... Going to try that now ...

*EDIT* I copied the firmware files from original rom, unchanged, to firmware dir, still nog go ... Rebuilding everything now with bigger dmesg buffer so I can finally catch what happens at boot (need to rebuild, I was buliding but my system crashed, damn)
[Galaxy Note 4 General] gekkehenkie11:
So [MENTION=3041959]fattire[/MENTION], I'm a bit confused, what exactly is supposed to load those firmware files ? You said userspace ? What exactly in userspace is supposed to take care of this ? I wonder which filenames I should use, the ones like on stock 910F firmware or do I need to rename to 910T cause the CM12 kernel wants those filenames ?
[Galaxy Note 4 General] fattire:
Sorry-- userspace refers to anything that's running outside of the kernel. Sometimes the init.qcom.rc will start up a loader program on first boot to load the firmware... since it's loading from the file system it has to be after the /system partition is mounting. That's not to say that this HAS to happen...

Here's the thing-- I would THINK that the file names would be consistent with what the kernel thinks it is because it's samsung's kernel and samsung's binaries.. but because the userland/userspace stuff may not be from samsung, you can match it up (symlink) or something and see if it happens to work... it's really ahrd to say because RIL isn't my thing really and also because I'm not acquainted iwth your device per se. The fact that it's GSM also makes me think things should be very very close to Tmobile tho, which is also GSM.
[Galaxy Note 4 General] gekkehenkie11:
Ok I will experiment a bit. I've just loaded up a kernel with bigger dmesg buffer and now have all dmesg output since boot. I will investigate tomorrow
[Galaxy Note 4 General] slayher:
[MENTION=3296134]gekkehenkie11[/MENTION] I think what you are missing is that from the little I poked around in the 910F rom, it builds and loads the mhi.ko kernel module. You may want to unpack the 910F boot.img, and look through the ramdisk to see where it loads that stuff. I would also consider compiling the modules straight into the kernel vice a module.
[Galaxy Note 4 General] albireox:
[MENTION=2457777]slayher[/MENTION], any chance for you to get involved in the 910f cm12 port?
[Galaxy Note 4 General] gekkehenkie11:
Hey Slayher !! It's funny, I went to bed yesterday thinking "Hmmm .... wait a minute, the 'mhi' in 'mhi_pipe_14' (the culprit that I found: http://xdaforums.com/showpost.php?p=57426528&postcount=522) stands for 'Modem Host Interface' and there's a driver for it in the platform package (outside the kernel package) from Samsung like I had seen before: http://xdaforums.com/showpost.php?p=56803391&postcount=32. I thought, first thing I need to check tomorrow is how that's for the 910T and now I read your post about it. Great minds ... ;) Ok going to dig into this today !

*EDIT* just saw that the 910T package contains the exact same driver so that's slightly disappointing, however I also saw this:

mhi_uci_ctxt.client_handle_list[i].dev =
device_create(mhi_uci_ctxt.mhi_uci_class, NULL,
mhi_uci_ctxt.start_ctrl_nr + i,
NULL, DEVICE_NAME "_pipe_%d", i * 2);

Where DEVICE_NAME = mhi according to the header, so here you go, the creation of the missing culprit mhi_pipe_14 right there !! ;) But then I wonder don't you need this for 910T ? Anyway the above code makes me confident this is it, going to dig into it some more ...

*EDIT2* I just verified, this is loaded on original sam and not on CM12 ;) Going to see what happens if I do ;)
[Galaxy Note 4 General] Beukhof1:
Hey! Just wanted to thank you and the other guys for all the hard work you have been putting in! Thanks!!
[Galaxy Note 4 General] jazzypit:
Good luck I hope you can do it
[Galaxy Note 4 General] gekkehenkie11:
This is it man, I'm 99% confident, the code is creating the pipe I found to be missing. Anyway I just tried using the module from samsung, that indeed doesn't work (as Slayher suspected), it has problems with the CM12 kernel, so I need to bake it into the kernel as expected. Going to try that now, will take a bit ...
[Galaxy Note 4 General] Beukhof1:
So this will fix the RIL problem? That would be so cool dude!
[Galaxy Note 4 General] jazzypit:
Very strange they are so difference between t mobile version and international version. Both work on snapdragon
[Galaxy Note 4 General] gekkehenkie11:
It will at least solve the specific RIL problem I pinpointed: http://xdaforums.com/showpost.php?p=57426528&postcount=522 I'm not sure if there are other roadblocks down the road but this needs to be fixed first, then we'll know about that. But there's a good chance it's going to work right away :)
[Galaxy Note 4 General] gekkehenkie11:
[MENTION=2457777]slayher[/MENTION]: how do I compile that samsung mhi kernel module ? I've been trying tons of stuff, all to no avail ... not sure what makefile to use, how to configure, should I build it directly from that directory or should I try to change CM12 boardconfig etc ... The sourcecode in the 910T for that mhi module is exactly the same, maybe you can try to compile it and explain how you did it so I can repeat for 910F ? Really been pulling my hairs out on this one all morning ...

*EDIT* hmm actually I might have it, I'm currently building the kernel as standalone (just the samsung method) and hopefully after that I can build the module ... (it was complaining before about missing setup files but they should be generated now)
[Galaxy Note 4 General] Preaper:
[MENTION=3296134]gekkehenkie11[/MENTION]

I want to create my own build this weekend and aid in getting CM12 for the N910F up and running. Can you give me some pointers how to get up to speed as quick as possible? I hope to benefit from your experience and to skip already resolved issues.
[Galaxy Note 4 General] gekkehenkie11:
Build complete !! Going to try it ...
[Galaxy Note 4 General] gekkehenkie11:
Damn ... doesn't seem to work... I still dont see the mhi pipes in /dev

From the dmesg file: mhi: no symbol version for module_layout

And why I try to load manually with insmod mhi.ko it says:

insmod: init_module 'mhi.ko' failed (Exec format error)

So the ko files doesnt seem to be correct ... Anyway gotta run and take care of some personal things first now
[Galaxy Note 4 General] slayher:
[MENTION=3296134]gekkehenkie11[/MENTION] In the config file, apq8084_sec_eur_trlte_blah_blah or in the main defconfig, apq8084_sec_config look for the CONFIG_MHI=m and change it to =y . You have to find the right entry cause I dont know the actual config off the top of my head. That will buildit directly into the kernel.
[Galaxy Note 4 General] fattire:
Usually if you want to build something as a module instead of built into the kernel, you can say:

CONFIG_THE_FEATURE_IN_QUESTION=m

instead of

CONFIG_THE_FEATURE_IN_QUESTION=y

I think that slayher was saying (maybe i misread though) that there was a module built in the defconfig.. the modules usually end in .ko and you'll see where they are (I forget now) when the kernel is built, it'll tell you.. (Or you can find it by going to the kernel source and doing find . | grep .ko.

There is a directory that the kernel modules go in.. something like /system/lib/modules -- this is an easy thing to google to make sure tho.
[Galaxy Note 4 General] Preaper:
I'm creating a CM build environment right now using docker. I'm using the scripts found @ https://github.com/stucki/docker-cyanogenmod - which are awesome!
[Galaxy Note 4 General] Beukhof1:
Nice to see more people working on this!
[Galaxy Note 4 General] gekkehenkie11:
Slayher, unfortunately I don't see any option anything like that. Besides the mhi sources are supplied by samsung outside the kernel (they come as part of the 'platform' package), so it seems it cant be simply configured as a kernel option or am I missing something ?
[Galaxy Note 4 General] gekkehenkie11:
Read back the last 20 or so pages of this thread, you will find the explanations on how to build off the 910T work by Slayher and Fattire. Basically you should just get their repo, change a xml file in the repo, replace kernel with the 910F kernel, then sync and brunch trltetmo. Of course it's even much better to set everything up as trlte from the start, read Fattire's explantions on how to do that. Good luck, would be nice to have more people working on this !
[Galaxy Note 4 General] Preaper:
Ok thanks. Ultimately the goal is to set up a dedicated device config for the trlte, but the short term goal is to start playing around with a frankenbuild :) - just to get a feel for it all. Syncing the repos right now, very time consuming. And it's time to go to bed.
[Galaxy Note 4 General] spleef:
You asked for an OpenJDK 7 build but your version is

java version "1.7.0_60" Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode).

any ideas cant seem to correct it no matter what i do
[Galaxy Note 4 General] gekkehenkie11:
I didn't have any problems with JAVA at all, but then again, I'm not using adb etc under linux (I'm running linux as a virtual environment in virtualbox under windows, so I'm using windows for adb etc)
[Galaxy Note 4 General] gekkehenkie11:
Anyway I think I've gotten a little further. The problem before was that I was using the CM12 kernel sources directory as a reference to build the KO, it obviously needed the CM12 kernel *OUT* directory, after a succesful build ;) So what I did is I changed the makefile inside the mhi directory to look like this:

mhidir	= $(prefix)/mhi
KERNEL_FLAGS ?= ARCH=arm CROSS_COMPILE=~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-
KERNEL_DIR := ~/android/system/out/target/product/trltetmo/obj/KERNEL_OBJ
module = mhi.ko
kmake = $(MAKE) $(KERNEL_FLAGS) -C $(KERNEL_DIR) M=$(CURDIR)

$(module):
$(kmake) modules

all-local: $(module)

install-exec-local: $(module)
$(kmake) INSTALL_MOD_PATH=$(DESTDIR)$(prefix)/modules modules_install

# "make distclean" will always run clean-local in this directory,
# regardless of the KERNELMODULES conditional. Therefore, ensure
# KERNEL_DIR exists before running clean. Further, don't fail even
# if there is a problem.
clean-local:
-test ! -d "$(KERNEL_DIR)" || $(kmake) clean

If I got everything correctly from the Cm12 setup, it's using that same toolchain so it should be compatible. The build is succesful and no more complaints about missing symbols. However now I'm getting the error when I try to insmod:

mhi: Unknown symbol _GLOBAL_OFFSET_TABLE_

Not sure what's going on now, going to investigate ...

*EDIT first thing I see is that the vermagic is now correct, it's using:

3.10.0-g64aeac1-dirty SMP preempt mod_unload modversions ARMv7

which is the exact same as in atl1c.ko, which loads correctly. So at least that part went well now :)

*EDIT2* after googling it seems it needs flag: -fno-pic: http://stackoverflow.com/questions/...for-android-unknown-relocation-27-when-insmod

Going to try that :)
[Galaxy Note 4 General] gekkehenkie11:
Ok no more errors with insmod ! I modified the init.qcom.rc file to insmod at boot, just like stock:

on property:sys.qseecomd.enable=true

insmod /system/lib/modules/mhi.ko

write /dev/kmsg "insmod mhi.ko"

And when I now check dmesg log, no more errors. Also when I run 'lsmod' it shows:

mhi 165597 0 - Live 0x00000000 (O)

Indiciating it's running I guess. However there are still no mhi_pipes present under /dev and needless to say, still no functioning RIL... Going to investigate again. Maybe it's because of those missing services that I need to add again ....
[Galaxy Note 4 General] spleef:
Am using Linux mint 14 ... Granted us outdated and has been a good while since building... Guessing I'm going to have to update my is and rebuild my environment..... Cause no matter how I try to fix the issue or update I'm getting bad errors.. Is a major bummer.. But I'll live..... Was just going for a quick fix.... Have already downloaded the most recent mint and will burn it to disc and install in the morning.. ...I dual boot windows and mint.... Is very important I keep a working windows os so is the route I must go.....:(
[Galaxy Note 4 General] gekkehenkie11:
Ok at least I can print kernel messages from within the mhi ko ! I see that it's initializing for example now in the dmesg log. From hereon it's just a matter of researching as why it's not reaching the creation of the pipes ! But it's a really looooong day and I had enough. Happy with the progress so far, seems we're really close now ...

Tomorrow more ...
[Galaxy Note 4 General] gekkehenkie11:
Did a little more digging. The mhi.ko init routine calls:

return platform_driver_register(&mhi_uci_driver);

and

return platform_driver_register(&mhi_rmnet_driver);

So it registers those 2 drivers. However, the 'probe' function never gets called for neither of these drivers and it's this probe function inside the mhi_uci driver that's supposed to create those pipes. I was googling a bit and the probe function in a driver normally gets called after the driver is registered and a match between device and driver was found: https://www.kernel.org/doc/Documentation/driver-model/platform.txt So why doesn't it do that ? I have no idea but that's the million dollar question here. Here another guy struggling with this: http://stackoverflow.com/questions/...unction-for-a-linux-kernel-driver-gets-called

Maybe it has to do something with the device tree ? Maybe mhi isn't present there and thus the kernel doesn't even see the device ?

Anyway now really shutting down for the day :)
[Galaxy Note 4 General] albertoa97:
What happen if i flash this rom? http://xdaforums.com/note-4-tmobile/development/unoffcial-cm-12-0-t-mobile-note-4-t2964887 The T-Mobile version of the Note 4 is the same i think, it's GSM. Anyone here tested it?
[Galaxy Note 4 General] gekkehenkie11:
Hehe no that doesn't work. What I still don't get though how [MENTION=2457777]slayher[/MENTION] got T-mobile working without the mhi, makes no sense to me ...

Anyway I was just comparing dtb files from stock to cm12, they're pretty much the same only difference are some leading 0's... So that isn't it ...
[Galaxy Note 4 General] Preaper:
So progress is slow, but it is progress non the less. Today has primarily been a researching day. My goal was to build Slayer his rom for the trltetmo. If this works I know I have a sane building environment and I can start making the required changes for the trlte. CM is building right now, that will takes hours for sure.

For anyone who wants to fire up his own build, here are my steps so far(on a Ubuntu 14.04 machine):

# install docker
sudo apt-get install docker.io
sudo useradd -G YOUR-LINUX-USERNAME docker
# You might have to log out to apply the above command

# Install the docker CM-build image + run container
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./run.sh

# You're now in the container. All steps from here on are to be executed from within said container.
# Start by collecting sources
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0
repo sync
vendor/cm/get-prebuilts
source build/envsetup.sh

# Put [URL="http://xdaforums.com/showpost.php?p=57312278&postcount=2"]fattire his roomservice.xml[/URL] in .repo/local_manifests/roomservice.xml then run the next command
repo sync
breakfast trltetmo

# At this point it became obvious java needed to be upgraded
sudo apt-get remove openjdk-6*
sudo apt-get install openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib
sudo apt-get autoremove

# I ingored this message since I assumed colord would not be used.
#Errors were encountered while processing:
# colord
#E: Sub-process /usr/bin/dpkg returned an error code (1)

# The docker image is missing the bc command.
sudo apt-get install bc

# Now the fun part - build!
# The output of the build is redirected into /home/cmbuild/brunchoutput.txt
export USE_CCACHE=1
brunch trltetmo > /home/cmbuild/brunchoutput.txt &

# Watch the build taking place
tail -f /home/cmbuild/brunchoutput.txt

Edit: Just had an error building - so don't follow the above steps just yet.

Edit2: was missing the bc command. "sudo apt-get install bc" should solve this. Added this to the list above.
[Galaxy Note 4 General] gekkehenkie11:
Good job !! Very nice to see others jumping in. And why are it always the Dutch ? Is it our entrepreneurial spirit to get things done ? ;) Anyway let met know if you need anything mate !
[Galaxy Note 4 General] gekkehenkie11:
btw, just found a bash command that I never knew existed, I've been looking for something like this:

getprop

Showing all system properties.
[Galaxy Note 4 General] gekkehenkie11:
I was just comparing this to stock, it shows:

mhi 171376 1 - Live 0x00000000 (O)

Regarding that 0-1 difference, supposedly a 0 means that it's not loaded !?! http://stackoverflow.com/questions/16203040/android-lsmod-output

*EDIT according to this doc it's the 'use count': https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-kernel-module-utils.html I guess it makes sense, no device is using the driver ...
[Galaxy Note 4 General] Preaper:
Lesson 1: Redirect the build output to a file or you might be out of luck finding out what the error was.

Have to restart the build just to get it to fail again.
[Galaxy Note 4 General] Mortify1:
I hope this helps.
[Galaxy Note 4 General] gekkehenkie11:
Hi,

This guide shows how to do it correctly: http://xdaforums.com/showthread.php?t=2450045 under 'way 1' and 'way 2'.

First connect to adb with "adb shell" and then type "cat /proc/partitions" and copy paste the output here.

Secondly from adb try "ls -al /dev/block/platform/dw_mmc/by-name" like his 'way 2' in that link. I just tested it on my S4, it doesn't work, since in my case it should be "ls -al /dev/block/platform/dw_mmc.0/by-name"

if nor dw_mmc nor dw_mmc.0 works, then do:

cd /dev/block/platform/

and then do "ls" to see which one you should have and use that.

And needless to say, only on the Snapdragon please !

Thanks !
[Galaxy Note 4 General] gekkehenkie11:
And also would need the output from:

cat /proc/mtd

or if that doesnt work:

cat/proc/emmc

Thanks !
[Galaxy Note 4 General] gekkehenkie11:
Actually, the output you gave me is quite useful already but it lacks the size in bytes, it only shows MB:

boot mmcblk0p17 => 17 MB

recovery mmcblk0p18 => 19 MB

system mmcblk0p24 => 3740 MB

userdata mmcblk0p26 => 24802 MB

That's what shows in your pic but we need exact sizes in bytes. I guess there's no option in that tool to show you ?
[Galaxy Note 4 General] gekkehenkie11:
Good news is that my shipper just confirmed I'm going to either have my note 4 on friday or monday ;) So will soon be able to do everything myself.
[Galaxy Note 4 General] pbedard:
Which note
[Galaxy Note 4 General] gekkehenkie11:
The one in the topic title, 910F.