Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

vcdbg missing #67

Open
satmandu opened this issue Jul 1, 2020 · 16 comments
Open

vcdbg missing #67

satmandu opened this issue Jul 1, 2020 · 16 comments

Comments

@satmandu
Copy link

satmandu commented Jul 1, 2020

I got it installed by copying it over from a 32-bit install to /usr/bin/vcdbg, installing apt install libc6-armhf-cross and then running sudo LD_LIBRARY_PATH=/opt/vc/lib /usr/bin/vcdbg though some messing with patchelf might negate the need to do that if you don't want to just compile it for arm64.

Relevant: raspberrypi/userland#314 (comment)

(I needed vcdbg to troubleshoot awb issues with my no-ir camera setup)

@pelwell
Copy link

pelwell commented Jul 1, 2020

See raspberrypi/linux#3666 and https://git.venev.name/hristo/rpi-vc-log for an alternative. @hvenev kindly submitted them ages ago and I've been pondering and tweaking when I get a spare moment because the driver change is larger than I feel ought to be necessary, but they should basically just work as is.

@satmandu
Copy link
Author

satmandu commented Jul 1, 2020

Whoops. The command I end up needing to run is sudo LD_LIBRARY_PATH=/opt/vc/lib /usr/bin/vcdbg set awb_mode 0

I'm not seeing how to do that using vc-log though I can compile it just fine.

@hvenev
Copy link

hvenev commented Jul 1, 2020 via email

@satmandu
Copy link
Author

satmandu commented Jul 1, 2020

Nevertheless, I can't get it to read the log on a RPI4:

pi@goat ~/src/rpi-vc-log$ sudo ./vc-log 
pread() failed: Invalid argument
Aborted
pi@goat ~/src/rpi-vc-log$ ls -aFl /dev/vc-mem
crw------- 1 root root 248, 0 Jul  1 16:17 /dev/vc-mem

@hvenev
Copy link

hvenev commented Jul 1, 2020 via email

@satmandu
Copy link
Author

satmandu commented Jul 2, 2020

I think it should work.

Thanks that works splendidly for using vcdbg to get the log.

But I for instance need to run vcdbg set awb_mode 0 to get AWB turned off for my no-ir camera. vc-log doesn't seem to replicate that functionality from vcdbg for me yet, I think.

@hvenev
Copy link

hvenev commented Jul 2, 2020 via email

@pelwell
Copy link

pelwell commented Jul 2, 2020

@satmandu Yes, of course - that wasn't obvious from your first few posts. I'll have a go at a static 64-bit build.

@hvenev You've already got all the tools for the vclog set <var> <value> in the form of vc_sym_find - the <var> is just a symbol in the list.

@pelwell
Copy link

pelwell commented Jul 2, 2020

Hmm, it's more than just a question of typing make - it's definitely not 64-bit clean.

Would a static 32-bit build of vcdbg be acceptable?

@satmandu
Copy link
Author

satmandu commented Jul 2, 2020

@pelwell Any chance of having libraspberrypi0 packaged like the libc6-armhf-cross package such that the libraries in /opt/vc/lib end up in a standard location like /usr/arm-linux-gnueabihf/lib/? Since armhf binaries work fine in arm64 as long as the libraries are in the right place, this might be a cleaner way to deal with this in the near term until everything is made to compile properly on arm64?

As long as the libraries are in the right location, (and the right cross-libraries are installed, such as libgcc1-armhf-cross libstdc++6-armhf-cross libc6-armhf-cross, one can just use patchelf to force an rpath and interpreter for the vc* binaries as part of the packaging process.

sudo /opt/vc/bin/vcdbg
sudo: unable to execute /opt/vc/bin/vcdbg: No such file or directory
sudo patchelf --print-rpath   /opt/vc/bin/vcdbg

sudo patchelf --print-interpreter   /opt/vc/bin/vcdbg
/lib/ld-linux-armhf.so.3

sudo patchelf --force-rpath --set-rpath "/usr/arm-linux-gnueabihf/lib" /opt/vc/bin/vcdbg
sudo patchelf --set-interpreter /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /opt/vc/bin/vcdbg
sudo /opt/vc/bin/vcdbg
(lots of this)
debug_sym: vc_mem_copy: Unable to open '/dev/fb0': No such file or directory(2)
/opt/vc/bin/vcdbg - no command specified

@pelwell
Copy link

pelwell commented Jul 2, 2020

That's a larger task than I'm prepared to take on, as one that wouldn't naturally fall to me.

@satmandu
Copy link
Author

satmandu commented Jul 2, 2020

And yes a static build would absolutely be acceptable.

@lurch
Copy link

lurch commented Jul 2, 2020

I believe packaging comes under @XECDesign 's umbrella, and IIRC there was a decision to deliberately not ship cross-libraries by default in the 64-bit beta OS, in order to uncover exactly these kinds of issues 😉

@pelwell
Copy link

pelwell commented Jul 2, 2020

The fact that the utility is absent means this issue is already uncovered. Until the compilation and packaging has been sorted out, there's a static 32-bit build here: https://drive.google.com/file/d/1HS9E5vnxxNqrizB4mEYrnFoQQ1axSRKm/view?usp=sharing

@satmandu
Copy link
Author

satmandu commented Jul 2, 2020 via email

@acostach
Copy link

Hi, are there any plans to include the 32bit statically linked version in the firmware repository too, or is the gdrive link the only approved option for now, at least until packaging is sorted out?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants