matt2005 / csng_yocto

0 stars 1 forks source link

Openauto recipe #1

Open matt2005 opened 3 years ago

matt2005 commented 3 years ago

Link issue

matt2005 commented 3 years ago

@sharavan-lab suggest we use this for the yocto work

sharavan-lab commented 3 years ago

sure

matt2005 commented 3 years ago

@sharavan-lab Can you share your openauto recipe?

sharavan-lab commented 3 years ago

Right now I am using your recipe for openauto. I see libaasdk_protobuf linking issues. Do you face similar issue,tooo? ninja: error: '/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/image/usr/bin/libaasdk_proto.so', needed by '/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/git/bin/btservice', missing and no known rule to make it

Its trying to finf aasdk lib in openauto bin folder

sharavan-lab commented 3 years ago

Your build command expansion for opeauto.bb

cmake -G Ninja -DCMAKE_MAKE_PROGRAM=ninja /home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/openauto -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_BINDIR:PATH=bin -DCMAKE_INSTALL_SBINDIR:PATH=sbin -DCMAKE_INSTALL_LIBEXECDIR:PATH=libexec -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=../com -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_INSTALL_INCLUDEDIR:PATH=include -DCMAKE_INSTALL_DATAROOTDIR:PATH=share -DCMAKE_INSTALL_SO_NO_EXE=0 -DCMAKE_TOOLCHAIN_FILE=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/toolchain.cmake -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 -DOE_QMAKE_PATH_PREFIX=/usr -DOE_QMAKE_PATH_HEADERS=/usr/include -DOE_QMAKE_PATH_LIBS=/usr/lib -DOE_QMAKE_PATH_ARCHDATA=/usr/lib -DOE_QMAKE_PATH_DATA=/usr/share -DOE_QMAKE_PATH_BINS=/usr/bin -DOE_QMAKE_PATH_LIBEXECS=/usr/lib/libexec -DOE_QMAKE_PATH_PLUGINS=/usr/lib/plugins -DOE_QMAKE_PATH_QML=/usr/lib/qml -DOE_QMAKE_PATH_TRANSLATIONS=/usr/share/translations -DOE_QMAKE_PATH_DOCS=/usr/share/doc -DOE_QMAKE_PATH_SETTINGS=/etc -DOE_QMAKE_PATH_EXAMPLES=/usr/share/examples -DOE_QMAKE_PATH_TESTS=/usr/share/tests -DOE_QMAKE_PATH_HOST_PREFIX=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/recipe-sysroot-native -DOE_QMAKE_PATH_HOST_BINS=/usr/bin -DOE_QMAKE_PATH_HOST_DATA=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/recipe-sysroot/usr/lib -DOE_QMAKE_PATH_HOST_LIBS=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/recipe-sysroot/usr/lib -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/recipe-sysroot-native/usr/bin -DOE_QMAKE_PATH_QT_HEADERS=/usr/include -DOE_QMAKE_PATH_QT_ARCHDATA=/usr/lib -DOE_QMAKE_PATH_QT_DATA=/usr/share -DOE_QMAKE_PATH_QT_BINS=/usr/bin -DOE_QMAKE_PATH_QT_TRANSLATIONS=/usr/share/translations -DOE_QMAKE_PATH_QT_DOCS=/usr/share/doc -DOE_QMAKE_PATH_QT_SETTINGS=/etc -DOE_QMAKE_PATH_QT_EXAMPLES=/usr/share/examples -DOE_QMAKE_PATH_QT_TESTS=/usr/share/tests -DCMAKE_BUILD_TYPE=Release -DRPI3_BUILD=TRUE -DAASDK_INCLUDE_DIRS=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/../aasdk/include -DAASDK_LIBRARIES=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/image/usr/bin/libaasdk.so -DAASDK_PROTO_INCLUDE_DIRS=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/../aasdk -DAASDK_PROTO_LIBRARIES=/home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/image/usr/bin/libaasdk_proto.so ../git -Wno-dev

matt2005 commented 3 years ago

yeah, i hit that error too. I'm working on fix with aasdk detection.

matt2005 commented 3 years ago

try the latewst one, I removed the paths and rely on the autodetection

sharavan-lab commented 3 years ago

Hello Matt, I have made the links to the aasdk /aasdk_proto libraries in CMakelists, and able to move forward a little. For libbcm_host.so I tried to use userland package from yocto, and linked it. Now I am stuck with this one... /home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/aasdk/0.1-r0/build/aasdk_proto/WifiInfoResponseMessage.pb.h:407: undefined reference to `f1x::aasdk::proto::messages::WifiInfoResponse_Status_IsValid(int)'. PLease let me know any updates from your side. Best Regards

On Sat, Jan 30, 2021 at 5:39 AM Matthew Hilton notifications@github.com wrote:

try the latewst one, I removed the paths and rely on the autodetection

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matt2005/csng_yocto/issues/1#issuecomment-770114301, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHDOMIUGZU2L44X4GKOSVTS4NE2BANCNFSM4WVKXI7Q .

adrianalin commented 3 years ago

The problem with userland may be that it is still not 64bit compatible. I just changed -DRPI3_BUILD=FALSE in openauto.bb recipe. And it works ok now. I could event test the autoapp by running:

root@raspberrypi4-64:~# autoapp -platform vnc And on my development laptop, i used a VNC client so i can get the UI.

The problem i encountered now, is after i connect my android device via USB to Raspberry, i get:

...
[2018-03-09 13:46:56.236246] [0x0000007f89ffb130] [debug]   [AaSdk] Message from channel 4
[2018-03-09 13:46:56.236684] [0x0000007f89ffb130] [info]    [OpenAuto] [AudioService] setup request, channel: MEDIA_AUDIO, config index: 1
[2018-03-09 13:46:56.236804] [0x0000007f89ffb130] [info]    [OpenAuto] [AudioService] setup status: 2, channel: MEDIA_AUDIO
[2018-03-09 13:46:56.236990] [0x0000007f89ffb130] [debug]   [AaSdk] f1x.aasdk.proto.messages.AVChannelSetupResponse - media_status: OK
max_unacked: 1
configs: 0

[2018-03-09 13:46:56.238799] [0x0000007f8affd130] [debug]   [AaSdk] Message from channel 6
[2018-03-09 13:46:56.239219] [0x0000007f8affd130] [info]    [OpenAuto] [AudioService] setup request, channel: SYSTEM_AUDIO, config index: 1
[2018-03-09 13:46:56.239343] [0x0000007f8affd130] [info]    [OpenAuto] [AudioService] setup status: 2, channel: SYSTEM_AUDIO
[2018-03-09 13:46:56.239525] [0x0000007f8affd130] [debug]   [AaSdk] f1x.aasdk.proto.messages.AVChannelSetupResponse - media_status: OK
max_unacked: 1
configs: 0

Warning: "Failed to connect: Connection refused"
Error: "Internal data stream error."
appsrc: push buffer wrong state
appsrc: push buffer wrong state
...
[2018-03-09 13:47:05.377241] [0x0000007f8a7fc130] [error]   [OpenAuto] [AudioService] channel error: AaSdk error code: 10, native code: 1, channel: SYSTEM_AUDIO
[2018-03-09 13:47:05.377333] [0x0000007f8a7fc130] [error]   [OpenAuto] [SensorService] channel error: AaSdk error code: 10, native code: 1
[2018-03-09 13:47:05.377391] [0x0000007f8a7fc130] [error]   [OpenAuto] [SensorService] channel error: AaSdk error code: 10, native code: 1
[2018-03-09 13:47:05.377446] [0x0000007f8a7fc130] [error]   [OpenAuto] [AudioInputService] channel error: AaSdk error code: 10, native code: 1
[2018-03-09 13:47:05.377509] [0x0000007f8a7fc130] [error]   [OpenAuto] [AndroidAutoEntity] channel error: AaSdk error code: 10, native code: 1
[2018-03-09 13:47:05.377562] [0x0000007f8a7fc130] [info]    [OpenAuto] [App] onAndroidAutoQuit.
[2018-03-09 13:47:05.377617] [0x0000007f8a7fc130] [info]    [OpenAuto] [AndroidAutoEntity] stop.
[2018-03-09 13:47:05.377665] [0x0000007f8a7fc130] [info]    [OpenAuto] [AudioInputService] stop.
[2018-03-09 13:47:05.377754] [0x0000007f8a7fc130] [info]    [OpenAuto] [AudioService] stop, channel: SYSTEM_AUDIO
[2018-03-09 13:47:05.377823] [0x0000007f8a7fc130] [info]    [OpenAuto] [SensorService] stop.
[2018-03-09 13:47:05.377882] [0x0000007f8a7fc130] [info]    [OpenAuto] [InputService] stop.
[2018-03-09 13:47:05.377930] [0x0000007f8a7fc130] [info]    [OpenAuto] [InputDevice] stop.
[2018-03-09 13:47:05.378223] [0x0000007f8a7fc130] [info]    [OpenAuto] [App] Waiting for device...
[2018-03-09 13:47:05.378290] [0x0000007f8a7fc130] [info]    [OpenAuto] Listening for WIFI clients on port 5000
[2018-03-09 13:47:05.378349] [0x0000007f8a7fc130] [debug]   [OpenAuto] [AndroidAutoEntity] destroy.
...

I guess audio is not correctly configured yet, still need to debug.

sharavan-lab commented 3 years ago

hello adrianalin, is there a change in gps_read () , funciton. It's spitting error of definition mismatch.

autoapp/Service/SensorService.cpp:233:50: error: too many arguments to function 'int gps_read(gps_data_t)' (gpsread(&this->gpsData, msg, 10) > 0) && ^ In file included from /home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/git/include/f1x/openauto/autoapp/Service/SensorService.hpp:21, from /home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/git/src/autoapp/Service/SensorService.cpp:21: /home/sharavan/sara_raspi/raspi_build/tmp/work/aarch64-poky-linux/openauto/0.1-r0/recipe-sysroot/usr/include/gps.h:2078:12: note: declared here extern int gps_read(struct gps_data_t ); ^~~~

regards

matt2005 commented 3 years ago

i've got it build and running on a pi zero, now i'm going to try it on pi4 in x64. I'm just working out the steps i did to make a recipe for it. This is it running in qemu. image

adrianalin commented 3 years ago

@sharavan-lab see this patch https://github.com/matt2005/csng_yocto/blob/main/meta-crankshaft/recipes-openauto/openauto/openauto/0001-Fix-compile-errors.patch

matt2005 commented 3 years ago

i'll add a steps to readme so @sharavan-lab can test the same steps to build image.

but here are what i did to run in qemu

git clone git@github.com:dhruvvyas90/qemu-rpi-kernel.git
& "c:\Program Files\qemu\qemu-system-arm.exe" -M versatilepb -cpu arm1176 -m 256 -drive "file=raspberrypi0-wifi_Crankshaft-Image-Yocto-raspberrypi0-wifi-20210214111210.rootfs.rpi-sdimg,if=none,index=0,media=disk,format=raw,id=disk0" -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" -net "user,hostfwd=tcp::5022-:22" -net nic -dtb qemu-rpi-kernel/versatile-pb-buster-5.4.51.dtb -kernel qemu-rpi-kernel/kernel-qemu-5.4.51-buster -append 'root=/dev/vda2 panic=1' -no-reboot
sharavan-lab commented 3 years ago

Matt, I have this patch included, I am working on pi3B, core-image-x11 , build, with yocto warrior. I looked at the patch and the below is the root cause , where the declaration seems to be missing for gps_read()

Regards

On Sun, Feb 14, 2021 at 7:05 PM adrianalin notifications@github.com wrote:

@sharavan-lab https://github.com/sharavan-lab see this patch https://github.com/matt2005/csng_yocto/blob/main/meta-crankshaft/recipes-openauto/openauto/openauto/0001-Fix-compile-errors.patch

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matt2005/csng_yocto/issues/1#issuecomment-778778880, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHDOMM2EJPIFIKQIY2R7ITS67GTXANCNFSM4WVKXI7Q .

matt2005 commented 3 years ago

i have it working already. i just need to write steps. give me a couple of days. but here are the rough steps

Raspberry Pi Zero

This took about 36 hours

mkdir -p ~/yocto
cd ~/yocto
sudo chmod 777 ~/yocto
repo init -u https://github.com/matt2005/yocto_manifests.git -b main
repo sync
mkdir -p ~/yocto/rpi/build/conf
cp ~/yocto/rpi/meta-rpi/conf/local.conf.sample ~/yocto/rpi/build/conf/local.conf
cp ~/yocto/rpi/meta-rpi/conf/bblayers.conf.sample ~/yocto/rpi/build/conf/bblayers.conf
sed -i 's/IMAGE_FSTYPES = "tar.xz"/IMAGE_FSTYPES = "tar.xz rpi-sdimg"/g' ~/yocto/rpi/build/conf/local.conf
sed -i 's/MACHINE = "raspberrypi3"/#MACHINE = "raspberrypi3"/g' ~/yocto/rpi/build/conf/local.conf
sed -i 's/DISTRO_FEATURES = "ext2/DISTRO_FEATURES = "x11 ext2/g' ~/yocto/rpi/build/conf/local.conf
export MACHINE=raspberrypi0-wifi
source ~/yocto/poky-dunfell/oe-init-build-env ~/yocto/rpi/build
bitbake crankshaft-image

then for pi3

export MACHINE=raspberrypi3
bitbake crankshaft-image

That will produce 2 images using x11 sato.

sharavan-lab commented 3 years ago

Ok, thanks. :-)

On Mon, Feb 15, 2021 at 3:28 PM Matthew Hilton notifications@github.com wrote:

i have it working already. i just need to write steps. give me a couple of days.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/matt2005/csng_yocto/issues/1#issuecomment-779106245, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASHDOMNHTCDEU4JR7BUGP7TS7DV45ANCNFSM4WVKXI7Q .

sharavan-lab commented 3 years ago

fixed gps_read issue...I am on sumo branch , which branch you guys working on. thisi is the issue I have now...

sharavan-lab commented 3 years ago

MainWindow.cpp:1263:54: error: 'class QMediaContent' has no member named 'request' /qt issue...please let me know which version of QT you guys use..

THanks

matt2005 commented 3 years ago

This will build same as my setup try running this for a pi3, it'll take about 48hours to build fully.

mkdir -p ~/yocto
cd ~/yocto
sudo chmod 777 ~/yocto
repo init -u https://github.com/matt2005/yocto_manifests.git -b main
repo sync
mkdir -p ~/yocto/rpi/build/conf
cp ~/yocto/poky-dunfell/meta-crankshaft/conf/local.conf.sample ~/yocto/rpi/build/conf/local.conf
cp ~/yocto/poky-dunfell/meta-crankshaft/conf/bblayers.conf.sample ~/yocto/rpi/build/conf/bblayers.conf
export MACHINE=raspberrypi3
source ~/yocto/poky-dunfell/oe-init-build-env ~/yocto/rpi/build
bitbake crankshaft-image