opencardev / crankshaft

Crankshaft: A turnkey GNU/Linux solution that transforms a Raspberry Pi to an Android Auto head unit.
http://getcrankshaft.com
GNU General Public License v3.0
2.16k stars 262 forks source link

Touch Screen stopped working after Google Play Service updated #352

Closed Stargazzer closed 5 years ago

Stargazzer commented 5 years ago

If you need support: Please post on https://www.reddit.com/r/crankshaft/ as this is a bug tracker, not a support forum.

Note: Reporting issues not based on official published builds will be closed without any comment.

borconi commented 5 years ago

@roffe probably some of the functions needs slight adjustment as well, but I really cannot help there. I know I needed to make some small adjustment in my Java code when I've changed it, but trust me the reason of touch not working is the usage of proto3 instead of proto2.

hawkeyexp commented 5 years ago

proto2 build is in progress - stay tuned... @borconi thx for your hint and help

tompeel commented 5 years ago

@hawkeyexp hanging on the end of a thread here! On the plus side i did in this period of broken decided to try Open Auto Pro and have been pretty underwhelmed. Its just not working...

borconi commented 5 years ago

@tompeel you should have tried HUR instead 😄 you would been pretty overwhelmed 😁

tompeel commented 5 years ago

@borconi whats HUR?

borconi commented 5 years ago

HUR = Headunit Reloaded, the app before Crankshaft, basically the same thing but for Android instead of Raspberry. Hence knowing exactly what's the problem as I've faced it in my app as well, about 3 weeks ago, I've just was lucky enough to be on Google Play Service beta so I caught the problem before it became general issue and managed to push out an update for my app before the majority of users got affected. Also that's when I've posted about this on the AASDK warning that this will happen and that it needs addressing, again sorry I haven't warned this community as well.

CodeFoodPixels commented 5 years ago

@borconi If they hadn't have hidden the issues on AASDK then it would have been easier for the crankshaft team to see, no blame on you!

scylla-xi commented 5 years ago

proto2 build is in progress - stay tuned... @borconi thx for your hint and help

any update?

tompeel commented 5 years ago

@borconi im on GPS BETA too, weirdly i had it all working fine with the same GPS version, then i downloaded the new CS on my test pi logged in and it must have flicked a switch because then it wouldn't work with either alpha 4 or 5... i confirmed it with the release date. very odd.

abraha2d commented 5 years ago

So before this, I was able to run openauto: the screen/video output worked, but there was no touch input. I merged @borconi's AAProto files into aasdk (great work btw), and made a small change to openauto to get it to compile. Now touch works, but there's no video output (i.e. I can touch the place where the music play button should be, and music starts playing, but I can't actually see anything other than the "Waiting for device" screen).

Anyone have any ideas on what's causing this? These are the changes I made: https://github.com/f1xpl/aasdk/compare/development...abraha2d:development https://github.com/f1xpl/openauto/compare/development...abraha2d:development

EDIT: Video output with QtVideoOutput works (laggy and tearing, but it works). It's only OMXVideoOutput that's not working.

EDIT2: Issue solved by using crankshaft-ng, and compiling openauto with fixes there :D

sjdean commented 5 years ago

Just as a curiosity, if I take the OpenAuto Pro libaasdk_proto.so and view in a text editor, there's no reference to proto2, only proto3. It makes me wonder if they have fixed the code to call proto3 correctly???

Is this 100% a case that we need to go back to proto2 files, or do we need to fix the code?

borconi commented 5 years ago

You cannot really "fix" the code, one of the main diff between 3 and 2 is how 0 are treated. For 3 https://developers.google.com/protocol-buffers/docs/proto3#default it will filter 0 values out (like unset) while proto2 will expect them. Since AA is based on proto2, AFAIK (also proto 3 was only released in 2016, but AA was launched in 2015) we should have never used proto3 in the first place.

Also I've had trouble with proto3 in my obd2aa project as well where on some cars I've got strange errors and values missing, there I was using protobuffer on the opposite side (on the phone speaking with the car) and data coming from cars was defenetly using proto2 not 3.

Richard6360 commented 5 years ago

So can we have a build no. 6 with a fix? For those who canot compile it them selfs?

Op vr 5 jul. 2019 21:51 schreef Emil Borconi-Szedressy < notifications@github.com>:

You cannot really "fix" the code, one of the main diff between 3 and 2 is how 0 are treated. For 3 https://developers.google.com/protocol-buffers/docs/proto3#default it will filter 0 values out (like unset) while proto2 will expect them. Since AA is based on proto2, AFAIK (also proto 3 was only released in 2016, but AA was launched in 2015) we should have never used proto3 in the first place.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/opencardev/crankshaft/issues/352?email_source=notifications&email_token=AB3IBWASAW6MZ24UDHNTKETP56Q4ZA5CNFSM4H2JVZ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZKGYVY#issuecomment-508849239, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3IBWBMVTBFNYUO2IBKQH3P56Q4ZANCNFSM4H2JVZ6Q .

CodeFoodPixels commented 5 years ago

People need to stop being so rude and impatient. We don't pay the maintainers or contributers of this, and we have no right to demand their time.

sjdean commented 5 years ago

Hi Guys, it looks like to get touch working, you only need to swap the tree for InputEventNotificationMessagr from proto3 to proto2. The action_index on TouchEvrnt also needs to be optional. I'm putting together my own fork and will share the changes in one place.

borconi commented 5 years ago

@sjdean it's up to you, but I wouldn't mix 3 and 2 and also as AA is based on 2 you never know when and where will be broken because of this... But that's totally your call.

sjdean commented 5 years ago

You are totally correct borconi, however for those wishing to take a shortcut and may be faced with other issues or needing to get an older version of protoc, then merely changing this sub set is adequate to get the touch screen working. But yes, the whole lot should be migrated to proto2

sli00 commented 5 years ago

ok, completely agree that its rude to just ask for a new fixed build a couple days after a fix is discovered, but could someone point me to a tutorial or some information on how to change from proto3 to proto2? I'd love to do it myself I just dont know how

gcharlie commented 5 years ago

@sli00 I don't think it's worth anyone's effort to make a tutorial on the matter. Hawkeyexp and others are clearly working to fix the issue, and I'm sure once they have a proper solution in place they will update the code base. Those that are well versed in Android development are putting years of coding experience into fixing this, it's not something that can be learned in a quick how to guide. The rest us can only wait for an update to the app, and maybe add links or suggestions that might help enlighten those doing the heavy lifting. I'm sure this will be fixed, just give it a few days, maybe even week or two or there and all will be right as rain.

sli00 commented 5 years ago

Alright, thank you, that makes a lot of sense, can't just fix everything with a Youtube video

borconi commented 5 years ago

@sli00 It depends how badly you want it. And I'm going to speak from my own experience, in 2016 I had no clue about Java, what's a class, now to compile an APK, etc. I did had some knowledge about PHP and Javascript and HTML but even that is/was limited. That's when I discovered Android Auto, but sadly the Android port I was using which was developer by a great developer, stopped working due to an update in Google Play Service, and the original developer have passed away and nobody was able to fix the issue, so I tried to fix it, and it took me almost 1 month, I was able to come up with able to fix the project, although it did mean I needed to extract the SSL key from a kenwood firmware. So in one month I've learned how to extract a firmware, how to build and app with NDK, how to binwalk an image, and so on, and all this with StackOverflow and Google, so it is doable but it does need a lot of ambitions and you have to take it step by step and understand what you are doing at each step.

abraha2d commented 5 years ago

@sli00 If you're impatient like me, and comfortable compiling openauto from scratch, then I've made the changes necessary on my fork(s): https://github.com/abraha2d/aasdk and https://github.com/abraha2d/openauto. There's build instructions on the f1xpl wiki here. Replacing /usr/local/bin/autoapp with your compiled version and rebooting should do the trick.

sli00 commented 5 years ago

Alright I will try that, thank you

reganface commented 5 years ago

@abraha2d Compiling from your forks got my setup working again! Thanks!

Ojassy commented 5 years ago

Same here, thanks @abraha2d

t00fatt commented 5 years ago

It's not possible to compile this on a rpi2, then boot that sd card with an rpi3B+ is it? I only have a rpi2 available to mess with, and can't take my rpi3B+ in my car out or get my car within wifi range.

abraha2d commented 5 years ago

@t00fatt I don't have an RPi3B+ to try it with, but from what I've seen it should work.

eduardofilo commented 5 years ago

Here it is a step by step guide for compiling abraha2d forks:

Thanks @abraha2d

sli00 commented 5 years ago

@eduardofilo @abraha2d thank you guys so much, touchscreen working now!

xxxjajoxxx commented 5 years ago

Cannot write to ‘development.zip’ (Read-only file system).

someone can help with this?

edit: ok done with this command mount -o remount,rw /

edit2: new error

cmake -DCMAKE_BUILD_TYPE=Release ../aasdk -- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aasdk_proto/CMakeLists.txt:2 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/pi/aasdk_build/CMakeFiles/CMakeOutput.log". See also "/home/pi/aasdk_build/CMakeFiles/CMakeError.log".

modemlamer commented 5 years ago

Cannot write to ‘development.zip’ (Read-only file system).

someone can help with this?

edit: ok done with this command mount -o remount,rw /

edit2: new error

cmake -DCMAKE_BUILD_TYPE=Release ../aasdk -- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aasdk_proto/CMakeLists.txt:2 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/pi/aasdk_build/CMakeFiles/CMakeOutput.log". See also "/home/pi/aasdk_build/CMakeFiles/CMakeError.log".

you have to unlock the filesystem via

crankshaft unlock system

xxxjajoxxx commented 5 years ago

Cannot write to ‘development.zip’ (Read-only file system). someone can help with this? edit: ok done with this command mount -o remount,rw / edit2: new error cmake -DCMAKE_BUILD_TYPE=Release ../aasdk -- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aasdk_proto/CMakeLists.txt:2 (find_package) -- Configuring incomplete, errors occurred! See also "/home/pi/aasdk_build/CMakeFiles/CMakeOutput.log". See also "/home/pi/aasdk_build/CMakeFiles/CMakeError.log".

you have to unlock the filesystem via

crankshaft unlock system

still the same error

tompeel commented 5 years ago

i just followed the instructions by @eduardofilo and it worked perfectly. I had no FS locking issues, i did remove my card from the pi and edit the config on my pc to avoid messing about with this. This is dangerous now i can build! got to get a pi4 up and running

eduardofilo commented 5 years ago

Cannot write to ‘development.zip’ (Read-only file system). someone can help with this? edit: ok done with this command mount -o remount,rw / edit2: new error cmake -DCMAKE_BUILD_TYPE=Release ../aasdk -- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aasdk_proto/CMakeLists.txt:2 (find_package) -- Configuring incomplete, errors occurred! See also "/home/pi/aasdk_build/CMakeFiles/CMakeOutput.log". See also "/home/pi/aasdk_build/CMakeFiles/CMakeError.log".

you have to unlock the filesystem via crankshaft unlock system

still the same error

It seems as if there is lack of dependences.

Are you working on last Crankshaft release? Are you installed the packages listed in step 3 of procedure? Notice that the lines showed in that step are cropped in the gist view.

xxxjajoxxx commented 5 years ago

Cannot write to ‘development.zip’ (Read-only file system). someone can help with this? edit: ok done with this command mount -o remount,rw / edit2: new error cmake -DCMAKE_BUILD_TYPE=Release ../aasdk -- Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) aasdk_proto/CMakeLists.txt:2 (find_package) -- Configuring incomplete, errors occurred! See also "/home/pi/aasdk_build/CMakeFiles/CMakeOutput.log". See also "/home/pi/aasdk_build/CMakeFiles/CMakeError.log".

you have to unlock the filesystem via crankshaft unlock system

still the same error

It seems as if there is lack of dependences.

Are you working on last Crankshaft release? Are you installed the packages listed in step 3 of procedure? Notice that the lines showed in that step are cropped in the gist view.

ok i solved previous problems now i got this

cp: cannot create regular file '/usr/local/bin/autoapp': Text file busy

abraha2d commented 5 years ago

@xxxjajoxxx is OpenAuto still running? You may have to quit OpenAuto before you can replace the file. (In dev mode, press the power button on screen, press it again, and run sudo shutdown -c in an terminal / SSH connection within 60 seconds to cancel the impending shutdown.)

xxxjajoxxx commented 5 years ago

@xxxjajoxxx is OpenAuto still running? You may have to quit OpenAuto before you can replace the file. (In dev mode, press the power button on screen, press it again, and run sudo shutdown -c in an terminal / SSH connection within 60 seconds to cancel the impending shutdown.)

ok done it touch working it was open auto just typed ls -la + kill openauto PID and error disappeared

abraha2d commented 5 years ago

@lukeb-uk @hawkeyexp I've got PRs open for both opencardev/aasdk and opencardev/openauto.

CodeFoodPixels commented 5 years ago

Yeah, I realised and deleted my comment. Great work @abraha2d!

tompeel commented 5 years ago

This has been forced eye opener for me, I'm interested in getting a bit deeper. Can anyone advise a place to start looking at this in a Dev environment? All the Cpp stuff I do is in visual studio, can I open up and compile on there or is it best to build and environment on a pi?

JmanNZ commented 5 years ago

Hi I get the following error after the last make

In file included from /home/pi/openauto/src/autoapp/UI/MainWindow.cpp:23:0: /home/pi/openauto_build/ui_mainwindow.h: In member function ‘void Ui_MainWindow::setupUi(QMainWindow*)’: /home/pi/openauto_build/ui_mainwindow.h:2107:29: error: ‘class QListView’ has no member named ‘setItemAlignment’; did you mean ‘setItemDelegate’? AlbumCoverListView->setItemAlignment(Qt::AlignCenter); ^~~~~~~~~~~~~~~~ /home/pi/openauto_build/ui_mainwindow.h:2161:18: error: ‘class QListWidget’ has no member named ‘setItemAlignment’; did you mean ‘setItemWidget’? mp3List->setItemAlignment(Qt::AlignCenter); ^~~~~~~~~~~~~~~~ /home/pi/openauto/src/autoapp/UI/MainWindow.cpp: In member function ‘void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderVolume_valueChanged(int)’: /home/pi/openauto/src/autoapp/UI/MainWindow.cpp:767:9: warning: unused variable ‘n’ [-Wunused-variable] int n = snprintf(this->volume_str, 5, "%d", value); ^ CMakeFiles/autoapp.dir/build.make:734: recipe for target 'CMakeFiles/autoapp.dir/src/autoapp/UI/MainWindow.cpp.o' failed make[2]: *** [CMakeFiles/autoapp.dir/src/autoapp/UI/MainWindow.cpp.o] Error 1 CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/autoapp.dir/all' failed make[1]: *** [CMakeFiles/autoapp.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

Any help greatly appreciated Maybe somebody could post the compiled binary

Regards Jman

JoelBrenstrum commented 5 years ago

@JmanNZ Here you go

Raspberry Pi 3 Model B - autoapp.zip

JmanNZ commented 5 years ago

@JoelBrenstrum Thank you very much

Regards Jman

kooopah commented 5 years ago

After the apparent abandonment of openauto by the developers I have arrived here for the reason of my touchscreen, everything works correctly after recompiling using the proto3 to proto2 reconversion of @borconi (really thanks) System: Ubuntu 18 @ Atomic Pi, protobuf 3.0 , boost 1.65.1, openauto latest version in GIT

gcharlie commented 5 years ago

Hey guys, big thanks for the hot fix and all the instruction, but has anybody experienced a dip in audio quality after applying the proto2 fix? This may totally just be my speakers, but I figured I'd ask anyway..

GavinAshford commented 5 years ago

After the apparent abandonment of openauto by the developers I have arrived here for the reason of my touchscreen, everything works correctly after recompiling using the proto3 to proto2 reconversion of @borconi (really thanks) System: Ubuntu 18 @ Atomic Pi, protobuf 3.0 , boost 1.65.1, openauto latest version in GIT

@kooopah did you re-compile openauto after compiling aasdk from @borconi? If so, which branch and/or who's specifically? I've taken borconi's aasdk development branch and openauto from @abraha2d and after compiling both openauto app closes whenever the touchscreen it tapped.

N.B. I don't use crankshaft (but it doesn't sound like you do either)

kwiky commented 5 years ago

Same result : it open but it crashes right after i plugged my phone.

My setup is a Raspberry Pi 3+ with official 7" Touch Screen

Novocaine85 commented 5 years ago

Followed instructions from @eduardofilo and it worked perfectly. Thanks

kooopah commented 5 years ago

@GavinAshford Yes, I have always compiled from source adapted to my needs, I do not use crankshaft and I have even built using buildroot through cross compilation, but that's another story ...

use the git of f1xpl for aasdk and openauto, replace the .proto of aasdk proto folder with the broconi version and build it as usual, remember flag of cmake RPI3 = FALSE and everything should go well

GavinAshford commented 5 years ago

@kooopah awesome, thanks I'll give that a go this evening! Thinking about it now my issue might be the flag - the Pi in my car is Pi3 but the one I'm using to compile on is 2B+ because I don't really want to dismantle my car to get the 3 out...