Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: moving motion to a newer machine (Dave Howorth)


----------------------------------------------------------------------

Message: 1
Date: Fri, 12 Aug 2022 16:57:28 +0100
From: Dave Howorth <d...@howorth.org.uk>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] moving motion to a newer machine
Message-ID: <20220812165728.5aedd...@acer-suse.lan>
Content-Type: text/plain; charset=UTF-8

On Thu, 11 Aug 2022 11:49:07 +0100
Dave Howorth <d...@howorth.org.uk> wrote:

> On Wed, 10 Aug 2022 18:57:20 -0600
> MrDave <motionmrd...@gmail.com> wrote:
> 
> > n 8/10/2022 3:36 PM, Dave Howorth wrote:  
> > > On Wed, 10 Aug 2022 18:09:13 +0100
> > > Dave Howorth<d...@howorth.org.uk>  wrote:
> > >    
> > >> On Mon, 8 Aug 2022 09:09:58 -0500
> > >> Barry Martin<barry3mar...@gmail.com>  wrote:
> > >>    
> > >>> Hi Dave!
> > >>>        
> > >>>> I now have an R Pi 3B+ that I can substitute for the old
> > >>>> machine and hope that might give me an upgraded frame rate. It
> > >>>> presently has buster on it, 32-bit I think (uname -m says
> > >>>> armv71). So:    
> > >>> AFAIK Buster is 32-bit. /uname -m/ gives the processor
> > >>> type; /cat /etc/os-release/ gives some of the information
> > >>> you're asking about but not all.? ...I'm not sure how to tell
> > >>> the bit option? (looks like we'll both be learning!)    
> > >> Thanks for your reply. I went ahead and upgraded the pi to a
> > >> 64-bit version. I used the official rpi-imager and that has
> > >> given me bullseye. Now I'm confused when I look at
> > >> https://github.com/Motion-Project/motion/releases  because
> > >> although I see an arm64 release for both bionic and buster I
> > >> don't see one for bullseye:
> > >>
> > >>   Assets 29
> > >>
> > >> bionic_motion_4.4.0-1_amd64.deb
> > >> 458 KB
> > >> bionic_motion_4.4.0-1_arm64.deb
> > >> 435 KB
> > >> bionic_motion_4.4.0-1_armhf.deb
> > >> 443 KB
> > >> bionic_motion_4.4.0-1_i386.deb
> > >> 464 KB
> > >> bullseye_motion_4.4.0-1_amd64.deb
> > >> 501 KB
> > >> bullseye_motion_4.4.0-1_armel.deb
> > >> 481 KB
> > >> bullseye_motion_4.4.0-1_armhf.deb
> > >> 485 KB
> > >> bullseye_motion_4.4.0-1_i386.deb
> > >> 506 KB
> > >> buster_motion_4.4.0-1_amd64.deb
> > >> 499 KB
> > >> buster_motion_4.4.0-1_arm64.deb
> > >> 485 KB
> > >> buster_motion_4.4.0-1_armel.deb
> > >> 479 KB
> > >> buster_motion_4.4.0-1_armhf.deb
> > >> 484 KB
> > >> buster_motion_4.4.0-1_i386.deb
> > >> 506 KB
> > >>
> > >> Is there supposed to be a 64-bit version, or is there some known
> > >> problem, or am I left to build it myself?    
> > > Hmm, so I got impatient and thought I'd have a go at building it
> > > myself. I followed the 'Building a deb package' section from
> > > https://motion-project.github.io/motion_build.html  but it failed.
> > > The last part of the build log is as follows:
> > >
> > > gcc -DHAVE_CONFIG_H -I. -I..  -Dsysconfdir=\"/etc/motion\"
> > > -DLOCALEDIR=\"/usr/share/locale\" -W date-time -D_FORTIFY_SOURCE=2
> > > -D_THREAD_SAFE  -I/usr/include/p11-kit-1  -Irasppicam
> > > -I/usr/include/aarch64-linux-gnu -I/usr/include/mariadb/
> > > -I/usr/include/postgresql  -g -O2
> > > -ffile-prefix-map=/tmp/motion.QVvuLx/motion=.
> > > -fstack-protector-strong -Wformat -Werror=format-security -c -o
> > > raspicam/RaspiCamControl.o raspicam/RaspiCamControl.c
> > > raspicam/RaspiCamControl.c:47:10: fatal error:
> > > interface/mmal/mmal.h: No such file or directory 47 | #include
> > > "interface/mmal/mmal.h" |          ^~~~~~~~~~~~~~~~~~~~~~~
> > > compilation terminated. make[3]: *** [Makefile:477:
> > > raspicam/RaspiCamControl.o] Error 1 make[3]: *** Waiting for
> > > unfinished jobs.... mmalcam.c:38:10: fatal error:
> > > interface/mmal/mmal.h: No such file or directory 38 | #include
> > > "interface/mmal/mmal.h" |          ^~~~~~~~~~~~~~~~~~~~~~~
> > > compilation terminated. make[3]: *** [Makefile:477: mmalcam.o]
> > > Error 1 make[3]: Leaving directory '/tmp/motion.QVvuLx/motion/src'
> > > make[2]: *** [Makefile:554: all-recursive] Error 1 make[2]:
> > > Leaving directory '/tmp/motion.QVvuLx/motion' make[1]: ***
> > > [Makefile:398: all] Error 2 make[1]: Leaving directory
> > > '/tmp/motion.QVvuLx/motion' dh_auto_build: error: make -j4
> > > returned exit code 2 make: *** [debian/rules:10: build] Error 25
> > > dpkg-buildpackage: error: debian/rules build subprocess returned
> > > exit status 2
> > >
> > >
> > > So it looks to me like it thinks it is building on a raspberry pi
> > > and therefore I must want to use a raspberry pi camera :( But I
> > > don't! And I don't especially want to install whatever libraries
> > > etc are necessary to build for such a device. It didn't ask me any
> > > questions.
> > >
> > > So, is my supposition right? And is there any way to tell it not
> > > to build the raspicam stuff, short of hacking the script about to
> > > remove it?
> > >
> > > TIA, Dave    
> > 
> > The configuration process identified that there was some MMAL items
> > on the computer but apparently it wasn't all of the files needed so
> > it failed.  
> 
> Thanks for responding. I confess I have/had no idea what MMAL is.
> 
> > As for fixing this, it is a bit complex since the builddeb.sh
> > script doesn't have any options to turn off the MMAL detection. It
> > must be done by edits and revisions.? There are multiple ways to go
> > about turning it off but the following is my suggestion.
> > 
> > First, the general concept/method on what you are going to try to 
> > accomplish.? You'll copy down the motion code, go into the
> > directory, edit the configuration file that is searching for the
> > MMAL and then run the builddeb.sh while in the directory for
> > motion.? When the builddeb script is run from and while in the
> > motion directory, it will copy that code and build a deb from it
> > instead of cloning a fresh copy.? So the process would be:
> > 
> > git clone https://github.com/Motion-Project/motion.git
> > cd motion
> > nano configure.ac
> > Change the following line which is a few pages down in the MMAL
> > section. /AS_IF([test "${MMAL}" = "no"], [/
> > to
> > /AS_IF([test "no" = "no"], [/
> > cntrl-x to exit / save
> > 
> > Then copy the builddeb.sh file into this directory and run it. As 
> > indicated above, it is important that it be executed from and while
> > in the motion directory so it grabs/uses the code with the edit just
> > made.  
> 
> OK I think I just did that carefully but I got the same error in the
> build log (with a different UUID or whatever it is i0qef7 instead of
> QVvuLx). Part way through the log is this bit:
> 
> checking for webp... yes
> checking MMAL pkg-config path... .:/opt/vc/lib/pkgconfig
> checking for MMAL... yes
> checking FFmpeg pkg-config
> path... /usr/lib/aarch64-linux-gnu/lib/pkgconfig:
> 
> (sorry for the last wrapped line) which suggests the modification
> isn't sufficient. I've double-checked the directory contents etc to
> make sure I'm in the right place.
> 
> I can post any extra information or look to answer any questions to
> help in diagnosis.
> 
> > If you are not building a deb, it is a bit easier since it is
> > simply specifying --without-mmal in the configure step.? However,
> > the install/uninstall is then a problem since it isn't a deb.  
> 
> Yes, I would definitely prefer a neater install/uninstall
> 
> > Finally, I'd guess you have a question as to why this isn't just
> > out there as a compiled deb to download.? The answer is simple. We
> > don't have one of these PIs.  
> 
> Ah, OK. I'm confused then as to why it is only bullseye that doesn't
> have a 64-bit version? buster and bionic do.

I've done a bit more digging and I'm still very confused. I don't know
autoconf at all, so it's very slow going.

I think I do now understand why there is a problem in the first place.
I found a discussion of a similar problem building kodi at
https://forum.kodi.tv/showthread.php?tid=358136 and that says that the
64-bit environment on raspbian doesn't support mmal. I think it says
the workaround for kodi is to run 32-bit kodi on 64-bit raspbian but
that seems counterproductive given that video and image processing is
supposed to be one area where 64-bit brings substantial gains. So I'd
still like to build a 64-bit motion if I can.

It leaves me wondering what is in the 64-bit motion debs for bionic and
buster? Can I just downgrade to 64-bit buster and use that 64-bit
motion?

I don't understand what is being executed from configure.ac because the
output in the build log is the same as before, even though I've added
what I think should produce some debug output. But there is none. See
the extracts from the various files at the bottom of this message. The
modification times indicate that the correct files are being accessed.

Does anybody understand how to  get some more information about what
control path is being followed or how to definitely nuke the
MMAL/rasppicam stuff?

TIA, Dave

> >  ?MrDave
> >   
> > >>>> Q1 Would putting a 64-bit version of the OS on the machine be
> > >>>> worthwhile? And regardless, it it worth upgrading to a newer OS
> > >>>> release?    
> > >>> I have three RPi 4B's here.? Two are running Bullseye and the
> > >>> third Buster.? With this limited experience I have not found a
> > >>> difference running Motion? on Buster vs. Bullseye. All three
> > >>> seem to be equal, running at 15 fps and an image of 720 (1080
> > >>> caused some dropouts: gray sections, image shifts, etc.)? So
> > >>> from what I see here no difference between Buster and Bullseye,
> > >>> though I would go with 'the latest and greatest' just to make
> > >>> future updating easier. Instructions for Bullseye:
> > >>> https://motion-project.github.io/motion_build.html
> > >>> <https://motion-project.github.io/motion_build.html>       
> > >>>> Q2 Is armhf the correct version for 32-bit and arm64 presumably
> > >>>> for 64?    
> > >> [snip]
> > >>    
> > >>>> Q3 I've copied /etc/motion from the old machine. Is there
> > >>>> anything else I need to keep/copy apart from those config
> > >>>> files?
> > >>>>
> > >>>> I know the config files have changed a bit but I expect I can
> > >>>> figure out how to transfer settings to the new
> > >>>> installation.    
> > >> [snip]  

Here's how I've edited configure.ac
Note especially the "no" = "no" and the two AC_MSG_NOTICE lines,
neither of which appear to have produced any output:

##############################################################################
###  raspberry pi mmal - Optional.
##############################################################################
AC_ARG_WITH([mmal],
  AS_HELP_STRING([--with-mmal[=DIR]],[Compile with RasperryPi mmal camera 
support]),
  [MMAL="$withval"],
  [MMAL="yes"]
)

# djh 2022-08-11 removed MMAL code - see Mr Dave's post on motion list
AC_MSG_NOTICE([in the modified configure])
AS_IF([test "no" = "no"], [
    AC_MSG_CHECKING(for MMAL)
    AC_MSG_RESULT(skipped)
  ],[
    AC_MSG_NOTICE([in the modified configure #2])
    AC_MSG_CHECKING(MMAL pkg-config path)
    TEMP_PATH=$PKG_CONFIG_PATH
    AS_IF([test "${MMAL}" != "yes"], [
        PKG_CONFIG_PATH=${MMAL}/lib/pkgconfig:$PKG_CONFIG_PATH
        MMAL="yes"
      ],[
        PKG_CONFIG_PATH=.:/opt/vc/lib/pkgconfig
      ]
    )
    export PKG_CONFIG_PATH
    AC_MSG_RESULT($PKG_CONFIG_PATH)

    AC_MSG_CHECKING(for MMAL)
    AS_IF([pkg-config mmal], [
        TEMP_CFLAGS="$TEMP_CFLAGS -Irasppicam "`pkg-config --cflags mmal`
        TEMP_LIBS="$TEMP_LIBS "`pkg-config --libs mmal`
        #pkg config parm does not provide -lvchostif that buildroot requires
        TEMP_LIBS="$TEMP_LIBS -lvchostif "
        AC_MSG_RESULT([yes])
        AC_DEFINE([HAVE_MMAL], [1], [Define to 1 if MMAL is around])
      ],[
        AC_MSG_RESULT([no])
        MMAL="no"
      ]
    )
    PKG_CONFIG_PATH=$TEMP_PATH
    export PKG_CONFIG_PATH
  ]
)
AM_CONDITIONAL([INC_MMAL_SRC],[test x${MMAL} = xyes])


Here's the output of builddeb:

$ ./builddeb.sh 

Usage:    builddeb.sh name email <optional branch>
Name:     Name to use for deb package must not include spaces
Email:    Email address to use for deb package
Branch:   The git branch name of Motion to build (If none specified, uses 
master)
Install:  Install required packages
Arch:     Architecture


Using Username: AdhocBuild, User Email: adhocbu...@nowhere.com, Git Branch: 
master, Install Pkgs: N, Arch: aarch64

All packages installed
Cloning into 'motion'...
remote: Enumerating objects: 7869, done.
remote: Counting objects: 100% (441/441), done.
remote: Compressing objects: 100% (202/202), done.
remote: Total 7869 (delta 295), reused 362 (delta 236), pack-reused 7428
Receiving objects: 100% (7869/7869), 7.34 MiB | 5.48 MiB/s, done.
Resolving deltas: 100% (5884/5884), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
Cloning into 'motion-packaging'...
remote: Enumerating objects: 172, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 172 (delta 28), reused 44 (delta 21), pack-reused 113
Receiving objects: 100% (172/172), 118.20 KiB | 2.19 MiB/s, done.
Resolving deltas: 100% (60/60), done.
Version: 4.4.0+dirty20220702-025e613
Building package....
Build Error.  Check build log 
saved in /home/motion/mr-dave/motion

Here's the lines from the checking stage of the build log:

checking MMAL pkg-config path... .:/opt/vc/lib/pkgconfig
checking for MMAL... yes

and the error was as before.



------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 194, Issue 8
*******************************************

Reply via email to