Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

NEW!! pureXbmc V2 - New firmware for CX-921a / EXOON Power Pro 2013

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    Originally posted by rebootix View Post
    Cool

    Do you have a list with all the Key Names ? (eg. KEY_HOME etc.)
    I want to include every possible Key so that everything can be mapped
    Here is a little very useful apk for testing remote mappings:
    KeyTest.zip

    Walter77
    Donations are welcome and will be shared with other devs:

    DONATIONS

    CX-921 TV-Box without Bluetooth (RK3188 / RTL8188 Wifi), CX-921b TV-Box (RK3188T / AP6210 Wifi), T428 TV Stick (RK3188 / AP6330 Wifi), CX919 TV Stick (RK3188 / AP6210 Wifi)

    Comment


      #92
      Here's the program : rk_control.zip

      I made it for the users so that they put in their remote information and
      paste their output into this thread. When this is done you can copy their output
      and paste it into your code

      Guide :

      1. You have to add an entry for every button on your
      remote you want to be added. Click on "Add button" and
      type in your information.

      2. After every button has been set you simply click on "Output"
      and type in your usercode and remotename. After that the program
      will copy your output to the clipboard so you can post in inside this thread.

      It is a runnable .jar, so java is required for it.
      You can test it and report any errors

      // EDIT : I did not include all keys yet. You can tell me which should be included

      Comment


        #93
        Originally posted by rebootix View Post
        Here's the program : [ATTACH]7249[/ATTACH]

        I made it for the users so that they put in their remote information and
        paste their output into this thread. When this is done you can copy their output
        and paste it into your code

        Guide :

        1. You have to add an entry for every button on your
        remote you want to be added. Click on "Add button" and
        type in your information.

        2. After every button has been set you simply click on "Output"
        and type in your usercode and remotename. After that the program
        will copy your output to the clipboard so you can post in inside this thread.

        It is a runnable .jar, so java is required for it.
        You can test it and report any errors

        // EDIT : I did not include all keys yet. You can tell me which should be included
        Sounds perfect. So this little nice program will run under android?
        Do we need a special kernel to get the usercode for a new remote?

        I think most used keys are:

        key 28 ENTER
        key 116 POWER WAKE
        key 158 BACK
        key 139 MENU
        key 217 SEARCH
        key 232 DPAD_CENTER
        key 108 DPAD_DOWN
        key 103 DPAD_UP
        key 102 HOME
        key 105 DPAD_LEFT
        key 106 DPAD_RIGHT
        key 115 VOLUME_UP
        key 114 VOLUME_DOWN
        key 143 NOTIFICATION WAKE
        key 113 VOLUME_MUTE
        key 388 TV_KEYMOUSE_MODE_SWITCH
        key 412 TV_MEDIA_MULT_BACKWARD
        key 407 TV_MEDIA_MULT_FORWARD
        key 58 TV_MEDIA_PLAY_PAUSE
        key 64 TV_MEDIA_PLAY
        key 65 TV_MEDIA_PAUSE
        key 66 TV_MEDIA_STOP
        key 67 TV_MEDIA_REWIND
        key 68 TV_MEDIA_FAST_FORWARD
        key 87 TV_MEDIA_PREVIOUS
        key 88 TV_MEDIA_NEXT
        key 2 1
        key 3 2
        key 4 3
        key 5 4
        key 6 5
        key 7 6
        key 8 7
        key 9 8
        key 10 9
        key 11 0
        key 14 DEL
        key 57 SPACE
        key 111 DEL
        key 400 F10 # web browser
        key 435 F11 # app menu
        key 401 F12 # appall
        key 399 TV # rkplayer
        key 398 F8 # settings
        key 434 F9 # display settings
        key 358 INFO # status dialog
        Donations are welcome and will be shared with other devs:

        DONATIONS

        CX-921 TV-Box without Bluetooth (RK3188 / RTL8188 Wifi), CX-921b TV-Box (RK3188T / AP6210 Wifi), T428 TV Stick (RK3188 / AP6330 Wifi), CX919 TV Stick (RK3188 / AP6210 Wifi)

        Comment


          #94
          No, it is only for desktop and you need Java to run it.

          It does not compile the kernel or modify it, it does only create
          the lines you have to put in your source. People who want their
          remotes to work can use this program and post their output in here
          so that you can copy it into your source and don't have to type in everything.

          It does run on every desktop pc with java installed.

          EDIT : yes, the test kernels for getting usercode and button codes are still needed :/

          EDIT2: The output which is copied into clipboard looks like this :

          Table :

          Code:
          static struct rkxx_remote_key_table remote_key_table_testremote[] = {
              {0xf0 , KEY_PLAYPAUSE},
              {0xfa , KEY_HOME},
              {0xc1 , KEY_YELLOW},
              {0xa3 , KEY_RED},
              {0xb5 , KEY_VIDEO_NEXT},
          };
          Remote entry :

          Code:
          {
          .usercode = 0xe32,
          .nbuttons = 5,
          .key_table = &remote_key_table_testremote[0],
          },

          EDIT 3 :

          I think I found a way how to add remotes without compiling test kernels.
          Code:
          static int  remotectl_init(void)   {     printk(KERN_INFO "++++++++remotectl_init\n");
                 // Read in file from root here and populate
                 // struct with data from file<----
              return platform_driver_register(&remotectl_device_driver);   }
          Code:
                  case RMC_USERCODE:         {             ddata->scanData <<= 1;             ddata->count ++;              if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){                 ddata->scanData |= 0x01;             }              if (ddata->count == 0x10){//16 bit user code
                            // Only print user code if value in local file
                            // is set to 1 (eg. if(read_usercode)... )               
           // printk("u=0x%x\n",((ddata->scanData)&0xFFFF));                 if (remotectl_keybdNum_lookup(ddata)){                     ddata->state = RMC_GETDATA;                     ddata->scanData = 0;                     ddata->count = 0;                 }else{                //user code error                     ddata->state = RMC_PRELOAD;                 }             }         }
          Code:
                  case RMC_GETDATA:         {             ddata->count ++;             ddata->scanData <<= 1;                         if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){                 ddata->scanData |= 0x01;             }                        if (ddata->count == 0x10){
                            // The same here : only print button codes if value
                            // in local file is set to 1 (eg. if(read_buttoncode) ...)              
            // printk(KERN_ERR "d=%x\n",(ddata->scanData&0xFFFF));
                        ...

          Local file could look like this :

          Code:
          read_usercode=1
          read_buttoncode=1
          File for reading in Buttons could look like this :

          Code:
          num_buttons = 3
          {0xf0,KEY_POWER}
          {0xb2,KEY_HOME}
          {0xa9,KEY_MUTE}
          I don't think I could do that, but it is an idea
          Last edited by rebootix; 24 July 2014, 17:53.

          Comment


            #95
            Ok i tried something...

            Code:
            static void read_custom_remote(){
            
                // Open rk_custom.remote from sdcard root
                FILE *rk_remote = fopen("/sdcard/rk_custom.remote","r");
                // If file could not be opened
                if(rk_remote != NULL){
            
                    // Every line from file will be stored in this buffer
                    char buffer[32];
            
                    // Debug variables
                    if(fgets(buffer,32,rk_remote) != NULL){
                        if(buffer[15] == '1') print_usercode = 1;
                    }
            
                    if(fgets(buffer,32,rk_remote) != NULL){
                        if(buffer[17] == '1') print_buttoncode = 1;
                    }
            
                    // Read usercode from file
                    if(fgets(buffer,32,rk_remote) != NULL){
                        char usercode_string[] = { buffer[9] , buffer[10], buffer[11], buffer[12] };
                        int usercode = atoi(usercode_string);
                        remotectl_button[2].usercode = usercode;
                    }
            
                    // Check if read_table is = 1
                    int read_table = 0;
                    if(fgets(buffer,32,rk_remote) != NULL){
                        if(buffer[11] == '1') read_table = 1;
                    }
            
                    // Read in button mapping from file
                    // only if file says so
                    if(read_table){
            
                        int table_index = 0;
                        int button_count = 0;
            
                        //While the next line is present
                        while(fgets(buffer,32,rk_remote) != NULL){
            
                            // Get scancode from file
                            char scancode_string[] = {buffer[1] , buffer[2], buffer[3]};
                            int scancode = atoi(scancode_string);
            
                            // Get keycode from file
                            char keycode_string[] = {buffer[5] , buffer[6] , buffer[7]};
                            int keycode = atoi(keycode_string);
            
                            // Store scan- and keycode in custom remotes array
                            remote_key_table_custom[table_index].scanCode = scancode;
                            remote_key_table_custom[table_index].keyCode = keycode;
                            table_index++;
                            button_count++;
            
                        }
                        // Set the remotes number of buttons
                        remotectl_button[2].nbuttons = button_count;
                    }
            
                } else {
                    printk("ERROR : /sdcard/rk_custom.remote does not exist !");
                }
                
                fclose(rk_remote);
            }
            i call this method here :

            Code:
            static int  remotectl_init(void)
            {
                printk(KERN_INFO "++++++++remotectl_init\n");
                read_custom_remote();
                return platform_driver_register(&remotectl_device_driver);
            }
            and created a new entry inside remotectl_button[] :

            Code:
                {
                   .usercode = 0,
                   .nbuttons =  0,
                   .key_table = &remote_key_table_custom[0],
                },
            and added these to the file :

            Code:
            int print_usercode = 0;
            int print_buttoncode = 0;
            static struct rkxx_remote_key_table remote_key_table_custom[64] = { };
            The rk_custom.remote hast to be placed in root of sdcard and MUST!!! look like this :

            Code:
            print_usercode=1
            print_buttoncode=1
            usercode=0000
            read_table=0
            {255,136}
            {033,001}
            {123,029}
            Scan and Keycodes have to be converted to integers and MUST be 3 digits long.
            Usercode has to be converted to integer, too, and MUST be 4 digits long.

            I can't try it myself because i don't want do download the whole source (3.4 GB) and I
            can't flash my tv box because I accidentaly deleted Windows during upgrade to Ubuntu 14.04.

            Would be nice if you could try it Walter

            Small Guide :

            1. Set : print_usercode=1 , print_buttoncode=0 , usercode=0000, read_table=0
            2. Place rk_custom.remote inside root of sdcard
            3. Reboot TV-Box
            4. Go to terminal, press any button and execute dmesg
            5. Change usercode inside rk_custom.remote to the one the terminal gave you
            6. Set : print_usercode=0, print_buttoncode=1, usercode=yourusercode, readtable=0
            7. Reboot TV-Box
            8. Go to terminal, press any button and execute dmesg
            9. Write down which button you pressed and the buttoncode you got from terminal
            10. Tricky part : Convert all hex values to integers and put them inside rk_custom.remote
            11. USE THE EXACT SAME LAYOUT I PROVIDED OR IT WON'T WORK
            12. Set : print_usercode=0, print_buttoncode=0, usercode=yourusercode, readtable=1
            13. Reboot TV-Box
            14. Your Remote should be working now according to your mapping


            //EDIT

            forgot to mention this :

            Code:
                            // Only print usercode if local file says so
                           if(print_usercode) printk("u=0x%x\n",((ddata->scanData)&0xFFFF));
            and

            Code:
                            // Only print buttoncode if local file says so
                           if(print_buttoncode) printk(KERN_ERR "d=%x\n",(ddata->scanData&0xFFFF))
            Last edited by rebootix; 25 July 2014, 22:54.

            Comment


              #96
              The last kernel works perfect for my box expect the ethernet port

              Thank you for your great work! The last kernel works perfect for my box expect the ethernet port.
              It can't get ip address from my router. Even I set up the static ip it still doesn't work.
              Wireless connection works well.
              I am not sure my box's edition. It should be CX-921.
              Can you take a look this issue if you have time.
              Or I just wait for your 4.4 rom.

              Comment


                #97
                Originally posted by WaTiger View Post
                Thank you for your great work! The last kernel works perfect for my box expect the ethernet port.
                It can't get ip address from my router. Even I set up the static ip it still doesn't work.
                Wireless connection works well.
                I am not sure my box's edition. It should be CX-921.
                Can you take a look this issue if you have time.
                Or I just wait for your 4.4 rom.
                Thanks for your feedback. Can you please send me dmesg with lan on and off?
                There is a lot of different hardware on the market, so it's very difficult. Have you installed any custom rom that works on your box? UT1, K-R42, T-R42 roms should sometimes work.

                Do you would like to have pureXbmc KK Edition ;-)

                Walter77
                Donations are welcome and will be shared with other devs:

                DONATIONS

                CX-921 TV-Box without Bluetooth (RK3188 / RTL8188 Wifi), CX-921b TV-Box (RK3188T / AP6210 Wifi), T428 TV Stick (RK3188 / AP6330 Wifi), CX919 TV Stick (RK3188 / AP6210 Wifi)

                Comment


                  #98
                  dmesg infomation

                  Hi:
                  I will try different roms later. Also I am definitely looking forward to test the KK edition.

                  Here is the dmesg:
                  Ethernet off -> on -> off
                  Code:
                  <6>[  626.073371] qtaguid: ctrl_counterset(s 1 10049): insufficient priv from pid=424 tgid=363 uid=1000
                  <6>[  626.862503] qtaguid: ctrl_counterset(s 0 10052): insufficient priv from pid=424 tgid=363 uid=1000
                  <6>[  632.196747] qtaguid: ctrl_counterset(s 1 10058): insufficient priv from pid=424 tgid=363 uid=1000
                  <6>[  632.981211] qtaguid: ctrl_counterset(s 0 10049): insufficient priv from pid=424 tgid=363 uid=1000
                  <6>[  749.568440] qtaguid: ctrl_counterset(s 1 10052): insufficient priv from pid=424 tgid=363 uid=1000
                  <6>[  750.007843] qtaguid: ctrl_counterset(s 0 10058): insufficient priv from pid=424 tgid=363 uid=1000
                  <4>[ 1177.529646] RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:2
                  <4>[ 1177.529822] RTL871X: send eapol packet
                  <6>[ 1660.761962] qtaguid: ctrl_counterset(s 0 10052): insufficient priv from pid=424 tgid=363 uid=1000
                  <4>[ 1662.612117] enter func vmac_open...
                  <4>[ 1663.615875] power on phy
                  <6>[ 1664.674877] vmac_mii_bus: probed
                  <6>[ 1664.676299] rk29 vmac rk29 vmac.0: PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
                  <6>[ 1664.678641] ADDRCONF(NETDEV_UP): eth0: link is not ready
                  <6>[ 1666.668371] PHY: 0:00 - Link is Down
                  <4>[ 1669.440800] enter func vmac_close...
                  <6>[ 1672.773446] qtaguid: ctrl_counterset(s 1 10052): insufficient priv from pid=424 tgid=363 uid=1000
                  Below is from original kernel/rom
                  Ethernet off -> on -> off
                  Code:
                  <6>[  171.977923] qtaguid: ctrl_counterset(s 1 10010): insufficient priv from pid=422 tgid=364 uid=1000
                  <6>[  173.321278] qtaguid: ctrl_counterset(s 0 10008): insufficient priv from pid=422 tgid=364 uid=1000
                  <6>[  254.512217] qtaguid: ctrl_counterset(s 0 10010): insufficient priv from pid=422 tgid=364 uid=1000
                  <4>[  256.329251] enter func vmac_open...
                  <4>[  256.329340] !!!!!!!!!!11111111111111!!!!
                  <4>[  256.329428] power on phy
                  <4>[  257.368955] !!!!!!!!!!222222222222222!!!!
                  <4>[  257.369117] Read the Ethernet MAC address from IDB:00:00:00:00:00:00
                  <4>[  257.369227] eth_mac_from_RANDOM***********:EE:E9:E0:B3:C7:0
                  <4>[  257.369296] !!!!!!!!!!33333333333333!!!!
                  <4>[  257.379899] !!!!!!!!!!44444444444444444!!!!
                  <4>[  257.379959] !!!!!!!!!!55555555555555!!!!
                  <6>[  257.402318] vmac_mii_bus: probed
                  <4>[  257.402445] !!!!!!!!!!777777777777777777!!!!
                  <6>[  257.402483] rk29 vmac rk29 vmac.0: PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
                  <4>[  257.402540] !!!!!!!!!!8888888888888888888!!!!
                  <6>[  257.403572] ADDRCONF(NETDEV_UP): eth0: link is not ready
                  <6>[  259.399296] PHY: 0:00 - Link is Down
                  <4>[  263.345298] enter func vmac_close...
                  <6>[  266.613032] qtaguid: ctrl_counterset(s 1 10010): insufficie

                  Comment


                    #99
                    Hey Walter,

                    Did you already try my approach on adding remotes through local file ?
                    I run the code using Eclipse and get no errors on Ubuntu 14.04, but i am not sure if
                    fopen() will work on android, because of permissions.

                    If it works i would make another small programm, which creates a rk_custom.remote.
                    It would read the users hex values, convert them to integers and put them into the file.

                    Comment


                      Again Me...

                      So I tried nearly everything getting the kernel to read from a file at boot (which is, as i have learned,
                      not a good idea). fopen is not availabe at kernel level, so I had to search for an altenative.
                      Found filp_open() http://dislab.hufs.ac.kr/lab/Kernel%...ose_version%29


                      Everytime i try to read from sdcard or from root filesystem the box won't start up.
                      Only 4 penguins in a bootloop... Maybe the filesystem isn't mounted at the moment I try to acces it.

                      Anyway I read my remotes user and buttoncodes and wanted to ask if you could put it inside your
                      kernel and compile a version for my remote.

                      Here's the code ready for copy&paste

                      Code:
                      static struct rkxx_remote_key_table remote_key_table_mele[] = {
                          {0xEA, KEY_POWER},
                      };
                      Code:
                          { 
                             .usercode = 0xf9, 
                             .nbuttons =  1, 
                             .key_table = &remote_key_table_mele[0], 
                          },
                      Thank you

                      Comment


                        Originally posted by rebootix View Post
                        Again Me...

                        So I tried nearly everything getting the kernel to read from a file at boot (which is, as i have learned,
                        not a good idea). fopen is not availabe at kernel level, so I had to search for an altenative.
                        Found filp_open() http://dislab.hufs.ac.kr/lab/Kernel%...ose_version%29


                        Everytime i try to read from sdcard or from root filesystem the box won't start up.
                        Only 4 penguins in a bootloop... Maybe the filesystem isn't mounted at the moment I try to acces it.

                        Anyway I read my remotes user and buttoncodes and wanted to ask if you could put it inside your
                        kernel and compile a version for my remote.

                        Here's the code ready for copy&paste

                        Code:
                        static struct rkxx_remote_key_table remote_key_table_mele[] = {
                            {0xEA, KEY_POWER},
                        };
                        Code:
                            { 
                               .usercode = 0xf9, 
                               .nbuttons =  1, 
                               .key_table = &remote_key_table_mele[0], 
                            },
                        Thank you
                        Please test kernel here:
                        kernel_walter77_cx921a_1080p_v25c_LCD1_cpu1608_gpu 600h_ddr720_vsync.zip

                        Perhaps we can binary patch a kernel with new remote driver like the overclocking perl scripts do?

                        Walter77
                        Donations are welcome and will be shared with other devs:

                        DONATIONS

                        CX-921 TV-Box without Bluetooth (RK3188 / RTL8188 Wifi), CX-921b TV-Box (RK3188T / AP6210 Wifi), T428 TV Stick (RK3188 / AP6330 Wifi), CX919 TV Stick (RK3188 / AP6210 Wifi)

                        Comment


                          Remote debug kernel

                          It's me again with some good news

                          I added a proc interface to the remotes driver so that any user can find out his user- and buttoncode
                          without flashing 2 seperate kernels.

                          Here it is : remote_debug_kernel.img.zip

                          Guide :
                          1. Flash the kernel and restart your device
                          2. Open Terminal and type in
                            Code:
                            su
                          3. Type in
                            Code:
                            echo 1 > /proc/print_usercode
                          4. Press any button on your remote and type in
                            Code:
                            dmesg
                          5. The last line should show your usercode
                            Code:
                            u=yourusercode
                          6. Type in
                            Code:
                            echo 0 > /proc/print_usercode
                          7. Type in
                            Code:
                            echo yourusercode > /proc/remote_id
                          8. Type in
                            Code:
                            echo 1 > /proc/print_buttoncode
                          9. Press any button on your remote and type in
                            Code:
                            dmesg
                          10. The last line should show your buttoncode
                            Code:
                            d=yourbuttoncode
                          11. Repeat step 9 as many times as you have to

                          Please test and report
                          Last edited by rebootix; 01 August 2014, 01:21.

                          Comment


                            Originally posted by walter77 View Post
                            Please test kernel here:
                            kernel_walter77_cx921a_1080p_v25c_LCD1_cpu1608_gpu 600h_ddr720_vsync.zip

                            Perhaps we can binary patch a kernel with new remote driver like the overclocking perl scripts do?

                            Walter77
                            Tried it but the button doesn't work :/
                            When i compile it with stock kernel it does... maybe there are 2 entrys with usercode 0xf9 ?

                            //EDIT

                            Tried it again with stock kernel and now it doesn't work suddenly...
                            my output was u=0xf9 and d=ea15. It worked yesterday

                            //EDIT 2

                            Flashed the whole system and now it works
                            Thank you for your work
                            Last edited by rebootix; 30 July 2014, 22:47.

                            Comment


                              Originally posted by rebootix View Post
                              Tried it but the button doesn't work :/
                              When i compile it with stock kernel it does... maybe there are 2 entrys with usercode 0xf9 ?

                              //EDIT

                              Tried it again with stock kernel and now it doesn't work suddenly...
                              my output was u=0xf9 and d=ea15. It worked yesterday

                              //EDIT 2

                              Flashed the whole system and now it works
                              Thank you for your work
                              Cool, thanks for the info.
                              I will try your kernel in the next days but it sounds very cool!
                              Can anyone else here test rebootix kernel please?

                              Walter77
                              Donations are welcome and will be shared with other devs:

                              DONATIONS

                              CX-921 TV-Box without Bluetooth (RK3188 / RTL8188 Wifi), CX-921b TV-Box (RK3188T / AP6210 Wifi), T428 TV Stick (RK3188 / AP6330 Wifi), CX919 TV Stick (RK3188 / AP6210 Wifi)

                              Comment


                                One more question

                                When i put the box to sleep while using xbmc the clock speed stays at 1,2 Ghz (Performance Statistics show 72 % 1.2 Ghz over night). Without XBMC or any other app running, the box clocks down to 300 Mhz and stays there as long it is in sleep mode. Is this normal behaviour or do we need to search for a fix ?

                                Comment

                                Working...
                                X