Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I debug CRAS #247

Closed
wwd-615 opened this issue Apr 27, 2023 · 16 comments
Closed

How do I debug CRAS #247

wwd-615 opened this issue Apr 27, 2023 · 16 comments

Comments

@wwd-615
Copy link

wwd-615 commented Apr 27, 2023

Can you give me a hand?
I added a debug statement to snd_pcm_cras_open,
and executed emerge-${BOARD} media-sound/adhd and other compiling commands.
But I didn't find my print statement in /var/log on ChromiumOS

@Damenly
Copy link

Damenly commented Apr 27, 2023

May I know if anything works abnormally in your raspberry_pi?

Suggest to use syslog() to output debug to /var/log/messages.

@wwd-615
Copy link
Author

wwd-615 commented Apr 27, 2023

yes,I use syslog(), but there is no corresponding print in message.

@Damenly
Copy link

Damenly commented Apr 27, 2023

Do you call openlog() first? Or call exit() so the process will crash intentionally to confirm the function was called.

@wwd-615
Copy link
Author

wwd-615 commented Apr 27, 2023

Ok, thank you very much. I'll have a try

@wwd-615
Copy link
Author

wwd-615 commented Apr 27, 2023

Maybe my changes didn't compile to image,
I first modified the src/third_party/adhd/cras/src/alsa_plugin/pcm_cras.c file,
then use the command sudo emerge-${BOARD} media-sound/adhd,
then use./build_image --board=${BOARD} --noenable_rootfs_verification dev,
finally use the cros flash usb:// ${BOARD}/latest command
But my changes didn't go into Raspberry PI.
Can you tell me how to correctly compile my changes into Raspberry PI

@wwd-615
Copy link
Author

wwd-615 commented Apr 27, 2023

I came to this conclusion because I made a deliberate error, but the compiler did not report an error

@Damenly
Copy link

Damenly commented Apr 27, 2023

No need to build_image wasting time. You can call
emerge-${BOARD} media-sound/adhd then cros deploy ${ip} media-sound/adhd
see https://chromium.googlesource.com/chromiumos/docs/+/main/cros_deploy.md.

@wwd-615
Copy link
Author

wwd-615 commented Apr 27, 2023

hi,I follow the documentation https://chromium.googlesource.com/chromiumos/docs/+/main/developer_guide.md
Execute the following command:
cros_workon --board=${BOARD} start media-sound/adhd
cros_workon_make --board=${BOARD} media-sound/adhd
cros_workon_make --board=${BOARD} media-sound/adhd --install
./build_image --board=${BOARD} --noenable_rootfs_verificatio
cros_workon --board=${BOARD} stop media-sound/adhd
Then I run the build image command and I get an error
"All ebuilds that could satisfy "media-sound/adhd" for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_195945-a1/rootfs/ have been masked"
Could you tell me how to solve this problem?

@Damenly
Copy link

Damenly commented Apr 28, 2023

Just use emerge after call of cros_workon as the doc says:

Alternatively, you can build your package using emerge-${BOARD} and quickly install it to the device by using [cros deploy](https://chromium.googlesource.com/chromiumos/docs/+/main/cros_deploy.md).

For example, if you want to build ec-utils to test on your device, use

@wwd-615
Copy link
Author

wwd-615 commented Apr 28, 2023

Since I used the dev image earlier, I need to re-execute ./build_image --board=${BOARD} --noenable_rootfs_verification test, However, the following error occurs when the command is executed:
"All ebuilds that could satisfy "media-sound/adhd" for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_195945-a1/rootfs/ have been masked"
So I need to fix it

@Damenly
Copy link

Damenly commented Apr 28, 2023

Please paste context around "All ebuilds that could satisfy "media-sound/adhd" for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_195945-a1/rootfs/ have been masked".
There should be a reason why the package is masked in the output.

And emerge-${BOARD} --info media-sound/adhd

@wwd-615
Copy link
Author

wwd-615 commented Apr 28, 2023

This is log information, thank you very much for your help:
Setting up symlinks for /usr/local for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/stateful/dev_image
20:30:38 INFO : Image specified by /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1 mounted at /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs successfully.
Setting up symlinks for /usr/local for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/stateful/dev_image
20:30:38 INFO : Running: sudo tar -Ilbzip2 -xpf /var/lib/portage/pkgs/cross-armv7a-cros-linux-gnueabihf/glibc-2.33-r16.tbz2 -C /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs ./usr/armv7a-cros-linux-gnueabihf --strip-components=3 --exclude=usr/include --exclude=sys-include --exclude=.[ao] --exclude=usr/bin/getent --exclude=usr/bin/ldd --exclude=lib/libmemusage.so --exclude=lib*/libpcprofile.so --exclude=lib*/libSegFault.so --exclude=usr/lib*/audit --exclude=lib*/libnss_compat*.so* --exclude=lib*/libnss_db*.so* --exclude=lib*/libnss_hesiod*.so* --exclude=lib*/libnss_nis*.so* --exclude=lib*/libnss_nisplus*.so* --exclude=lib*/libBrokenLocale*.so*
20:30:38 INFO : Running: sudo -E /mnt/host/source/chromite/bin/parallel_emerge --board=rpi4 --root-deps=rdeps --usepkgonly -v --with-bdeps=n --root=/mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs virtual/target-os
20:30:39.274: INFO: Running: emerge --usepkgonly '--with-bdeps=n' virtual/target-os --sysroot /build/rpi4 --root /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs '--root-deps=rdeps' '--jobs=4' '--rebuild-exclude=chromeos-base/chromeos-chrome' '--rebuild-exclude=chromeos-base/chromium-source' '--rebuild-exclude=chromeos-base/chrome-icu'
!!! CONFIG_PROTECT is empty for '/mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs/'
!!! CONFIG_PROTECT is empty for '/build/rpi4/'
Calculating dependencies... done!

!!! All ebuilds that could satisfy "media-sound/adhd" for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs/ have been masked.
!!! One of the following masked packages is required to complete your request:

  • media-sound/adhd-9999::baseboard-rpi3 (masked by: missing keyword)

(dependency required by "virtual/target-chromium-os-1-r201::chromiumos" [binary])
(dependency required by "virtual/target-os-1-r5::chromiumos" [binary])
(dependency required by "virtual/target-os" [argument])
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

Entering /mnt/host/source/src/scripts/mount_gpt_image.sh --unmount --from /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/chromiumos_base_image.bin --rootfs_mountpt /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs --stateful_mountpt /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/stateful --esp_mountpt /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/esp --delete_mountpts
20:30:50 INFO : Unmounting image from /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/stateful and /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs
20:30:50 INFO : Unmounting temporary rootfs /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/rootfs//build/rootfs.
Cleaning up /usr/local symlinks for /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/stateful/dev_image
20:30:50 INFO : Running sync -f /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1/chromiumos_base_image.bin
partx: specified range <1:0> does not make sense
An error occurred in your build so your latest output directory is invalid.
Would you like to delete the output directory (y/N)? y
Deleted /mnt/host/source/src/build/images/rpi4/R102-14695.195.0-d2023_04_27_203033-a1

@wwd-615
Copy link
Author

wwd-615 commented May 4, 2023

This is the log information after executing the emerge-${BOARD} --info media-sound/adhd command
log.txt

@Damenly
Copy link

Damenly commented May 4, 2023

There is a line KEYWORDS="~*" in adhd-9999.ebuild. Changing it to KEYWORDS="*" should let compile pass.

@wwd-615
Copy link
Author

wwd-615 commented May 5, 2023

Thank you very much. I have solved the problem with your help

@wwd-615 wwd-615 closed this as completed May 5, 2023
nirocfz pushed a commit that referenced this issue May 5, 2023
Link: #247
Signed-off-by: Su Yue <glass@fydeos.io>
@wwd-615 wwd-615 reopened this May 8, 2023
@wwd-615
Copy link
Author

wwd-615 commented May 8, 2023

Hi,did chromium_os-raspberry_pi crop out the part about cras_dsp_module?
If I want to use drc algorithm on Raspberry PI, how do I apply it?
Can you give me a hand?

@wwd-615 wwd-615 closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants