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

Compilation of icamerasrc-git fails #18

Closed
alba4k opened this issue Apr 18, 2023 · 14 comments · Fixed by #22
Closed

Compilation of icamerasrc-git fails #18

alba4k opened this issue Apr 18, 2023 · 14 comments · Fixed by #22

Comments

@alba4k
Copy link
Contributor

alba4k commented Apr 18, 2023

gstcamerasrc.cpp: In function 'void gst_camerasrc_class_init(GstcamerasrcClass*)':
gstcamerasrc.cpp:980:67: error: expected primary-expression before ',' token
  980 |         gst_camerasrc_device_id_get_type(), DEFAULT_PROP_DEVICE_ID, (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
      |                                                                   ^
gstcamerasrc.cpp: In function 'void gst_camerasrc_init(Gstcamerasrc*)':
gstcamerasrc.cpp:1258:30: error: expected primary-expression before '<' token
 1258 |   if (DEFAULT_PROP_DEVICE_ID < camerasrc->number_of_cameras) {
      |                              ^
gstcamerasrc.cpp:1259:50: error: expected primary-expression before ';' token
 1259 |     camerasrc->device_id = DEFAULT_PROP_DEVICE_ID;
      |                                                  ^
mv -f .deps/libgsticamerasrc_la-gstcameraformat.Tpo .deps/libgsticamerasrc_la-gstcameraformat.Plo
gstcamerasrc.cpp: In function 'gboolean gst_camerasrc_start(GstCamBaseSrc*)':
gstcamerasrc.cpp:2839:27: error: too many arguments to function 'int icamera::camera_device_open(int)'
 2839 |   ret = camera_device_open(camerasrc->device_id, camerasrc->num_vc);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gstcamerasrc.cpp:62:
/usr/include/libcamhal/api/ICamera.h:210:5: note: declared here
  210 | int camera_device_open(int camera_id);
      |     ^~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:624: libgsticamerasrc_la-gstcamerasrc.lo] Error 1
make[3]: *** Attesa per i processi non terminati....
mv -f .deps/libgsticamerasrc_la-gstcamerasrcbufferpool.Tpo .deps/libgsticamerasrc_la-gstcamerasrcbufferpool.Plo
mv -f .deps/libgsticamerasrc_la-gstcambasesrc.Tpo .deps/libgsticamerasrc_la-gstcambasesrc.Plo
make[3]: uscita dalla directory «/home/alba4k/.cache/paru/clone/icamerasrc-git/src/icamerasrc/src»
make[2]: *** [Makefile:685: all-recursive] Error 1
make[2]: uscita dalla directory «/home/alba4k/.cache/paru/clone/icamerasrc-git/src/icamerasrc/src»
make[1]: *** [Makefile:520: all-recursive] Error 1
make[1]: uscita dalla directory «/home/alba4k/.cache/paru/clone/icamerasrc-git/src/icamerasrc»
make: *** [Makefile:429: all] Error 2
==> ERRORE: Si è verificato un errore in build().
    L'operazione sta per essere interrotta...
errore: compilazione fallita per 'icamerasrc-git-r57.2d36ade-1': 
errore: compilazione fallita per i seguenti pacchetti: icamerasrc-git-r57.2d36ade-1
ERROR: Failed to install: intel-ivsc-driver-dkms-git intel-ivsc-firmware icamerasrc-git gst-plugin-pipewire
@alba4k
Copy link
Contributor Author

alba4k commented Apr 18, 2023

I know this issue isn't strictly related to this repository, but it affects it.

test.sh seems to fail after WARNING: erroneous pipeline: no element "icamerasrc"

@GorgetGuilhem
Copy link

Same issue here, compilation of icamerasrc-git fails !

@clintlombard
Copy link

Issue is with the package on AUR https://aur.archlinux.org/packages/icamerasrc-git. Workaround is to manually edit gstcamerasrc.cpp with

diff --git a/src/gstcamerasrc.cpp b/src/gstcamerasrc.cpp
--- a/src/gstcamerasrc.cpp
+++ b/src/gstcamerasrc.cpp
@@ -2839 +2839 @@
-   ret = camera_device_open(camerasrc->device_id, camerasrc->num_vc);
+  ret = camera_device_open(camerasrc->device_id);

@alba4k
Copy link
Contributor Author

alba4k commented May 15, 2023

Still getting errors tho..

gstcamerasrc.cpp: In function 'void gst_camerasrc_class_init(GstcamerasrcClass*)':
gstcamerasrc.cpp:980:67: error: expected primary-expression before ',' token
  980 |         gst_camerasrc_device_id_get_type(), DEFAULT_PROP_DEVICE_ID, (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
      |                                                                   ^
gstcamerasrc.cpp: In function 'void gst_camerasrc_init(Gstcamerasrc*)':
gstcamerasrc.cpp:1258:30: error: expected primary-expression before '<' token
 1258 |   if (DEFAULT_PROP_DEVICE_ID < camerasrc->number_of_cameras) {
      |                              ^
gstcamerasrc.cpp:1259:50: error: expected primary-expression before ';' token
 1259 |     camerasrc->device_id = DEFAULT_PROP_DEVICE_ID;
      |                                                  ^
make[3]: *** [Makefile:624: libgsticamerasrc_la-gstcamerasrc.lo] Error 1
make[2]: *** [Makefile:685: all-recursive] Error 1
make[1]: *** [Makefile:520: all-recursive] Error 1
make: *** [Makefile:429: all] Error 2

@clintlombard
Copy link

Strange. No idea why it worked for me. Errors look like missing ; somewhere. Alternatively change the PKGBUILD to point to this commit 2d36adecf1af9b44df591482aec27a32d8627999 instead of the icamerasrc_slim_api branch.

@sigboe
Copy link
Contributor

sigboe commented May 19, 2023

Hello, I also noticed this issue, since the ipu6 driver was updated to compile on Linux 6.3 and I made a merge request to update the driver I came across this issue. An older commit works to compile. I wrote my workaround in the merge request #19

@sigboe
Copy link
Contributor

sigboe commented May 22, 2023

Hello as I have said before there are 3 main issues getting this to compile and run today.

  1. Linux 6.3 support (PR to fix this is here update driver to be able to compile on Linux 6.3 #19 )
  2. Error handling in the install script. If you already have icamerasrc-git or any other dependency, don't fail if a newer commit can't compile. (PR to fix this is here fix situation where AUR package cannot build as is from AUR, but user has the package installed #20 )
  3. Compiling icamerasrc-git for new users, they should not have to do manual work to get icamerasrc-git working.

@stefanpartheym I am open to discussion how we proceed with icamerasrc-git intel has introduced a bug at this line in this file that breaks compiling. The compiler says the function is passing too many arguments, removing the second (newly added argument) fixes compiling. I have not tested if any functionality is lost by doing this. This bug was introduced in commit fe733e7 at April 3. And has issue intel/icamerasrc#32 opened at April 6. Our issue #18 was opened at April 18. Do you want us to roll our own PKGBUILD file or something? 17841ab compiles successfully and can be compiled by replacing the source array in the PKGBUILD to fetch "git+${url}.git#commit=17841ab6249aaa69bd9b3959262bf182dee74111" instead.

If someone is reading this and just want it to work right now. the steps are

cd ~ #or wherever you want to clone a repo
git clone git@github.com:stefanpartheym/archlinux-ipu6-webcam.git  #need to do this on a clean repo
cd archlinux-ipu6-webcam
git fetch origin pull/19/head:refs/heads/pr19
git merge pr19
git fetch origin pull/20/head:refs/heads/pr20
git merge pr20
#save and exit the file because a text editor will open, in vim this is done by hittin `:wq<enter>` if vim is what opened up
./install.sh

This will fail but some of the steps in install.sh is needed to have dependencies to compile icamerasrc-git. So lets do that now

cd ~ #or wherever you want to clone a repo
git clone https://aur.archlinux.org/icamerasrc-git.git
cd icamerasrc-git
sed -i 's/branch=icamerasrc_slim_api/commit=17841ab6249aaa69bd9b3959262bf182dee74111/' PKGBUILD
makepkg -sic

Now this will compile and install the correct older icamerasrc-git, then go back to the folder where you checked out the repo in the previous step. And run ./install.sh again

And then either Stefan has accepted my two pull requests, in case just install like normal on the newest git pull. And I am sorry I spread that out over two pull requests makes it harder for people to follow at home

When these are merge, just delete the repo you cloned and clone it again to "clean up" your local changes (you merged the two PRs locally including making a commit to merge the second PR)

EDIT: order of the steps changed

@GorgetGuilhem
Copy link

Thanks for your work @sigboe !

Following your steps, I still encounter issues.

First, icamerasrc-git complains about missing ipu6-camera-hal dependencies.

makepkg -sic
==> Création du paquet icamerasrc-git r59.17841ab-1 (mar. 23 mai 2023 09:52:38)
==> Vérification des dépendances pour l’exécution…
==> Installation des dépendances manquantes…
erreur : impossible de trouver la cible : ipu6-camera-hal
==> ERREUR : « pacman » n’a pas pu installer les dépendances manquantes.
==> Dépendances manquantes :
  -> ipu6-camera-hal
==> Vérification des dépendances pour la compilation…
==> ERREUR : Échec de résolution des dépendances.

After installing intel-ipu6ep-camera-hal-git with yay -S intel-ipu6ep-camera-hal-git (I'm on Alder Lake) it compiles and installs properly. I'm not sure this is really an issue, but it would be great to integrate it to your steps.

Following your steps, I clone the archlinux-ipu6-webcam repo and locally merge your two PRs, and then the problems begins. Pacman starts complaining about packages conflicts.

recherche des conflits entre paquets…
:: intel-ipu6-dkms-git-fix et intel-ipu6-dkms-git sont en conflit. Supprimer intel-ipu6-dkms-git ? [o/N] 
erreur : un conflit de paquets impossible à résoudre a été détecté
erreur : la préparation de la transaction a échoué (conflit de dépendances )
:: intel-ipu6-dkms-git-fix et intel-ipu6-dkms-git sont en conflit
==> ATTENTION : Échec à l’installation des paquets.
~/Documents/VisualStudioCodeProjects/archlinux-ipu6-webcam
ERROR: Failed to install: intel-ipu6-dkms-git

I can't remove intel-ipu6-dkms-git cause it's needed by intel-ipu6ep-camera-bin and intel-ipu6ep-camera-hal-git.

sudo pacman -Rs intel-ipu6-dkms-git
vérification des dépendances…
erreur : la préparation de la transaction a échoué (la satisfaction des dépendances a échoué)
:: la suppression de intel-ipu6-dkms-git casse la dépendance « intel-ipu6-dkms-git » requise par intel-ipu6ep-camera-bin
:: la suppression de intel-ipu6-dkms-git casse la dépendance « intel-ipu6-dkms-git » requise par intel-ipu6ep-camera-hal-git

Do you have any clue for solving this ?

PS : sorry for the French outputs, can't motivate myself to translate it all !

@sigboe
Copy link
Contributor

sigboe commented May 23, 2023

@GorgetGuilhem Okay, try to remove all the related packages,

Then run the install.sh script, it will fail, but it will set up the correct dependencies first

then install the icamerasrc-git with the modified PKGBUILD,

then run the install.sh again

if this works I'll update the steps!

@GorgetGuilhem
Copy link

GorgetGuilhem commented May 23, 2023

@sigboe thanks, it worked ! However the --workarround flag does not seem to work anymore, camera doesn't start on Firefox. But that's a start ! I'll try investigate this point when I have time.

@sigboe
Copy link
Contributor

sigboe commented May 23, 2023

@GorgetGuilhem Maybe because it is spelled --workaround?

if [[ "${1}" == "--workaround" ]]; then

Anyway, I will try to remember to make a PR to handle command line options in a different way.

@GorgetGuilhem
Copy link

GorgetGuilhem commented May 23, 2023

@sigboe sorry for the typo in my previous message, I checked my history and I ran the proper command (without the typo), so it's not coming from here.

EDIT : There's no subject actually, my Firefox was just messed up. It works perfectly in a new window.

@sigboe
Copy link
Contributor

sigboe commented May 25, 2023

@GorgetGuilhem I updated the previous commit with the fixes we discussed when I noticed more people saying it works for them

#18 (comment)

@GorgetGuilhem
Copy link

@sigboe perfect, thanks for your work :)

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

Successfully merging a pull request may close this issue.

4 participants