Code Monkey home page Code Monkey logo

doorpi's People

Contributors

bettman66 avatar drafenger avatar emphasize avatar frrr1 avatar gernot-h avatar hermanthegerman2 avatar hubsif avatar irgsmirx avatar m-reimer avatar motom001 avatar msmolny avatar nea74 avatar ralic avatar schwa-l-be avatar wuestengecko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

eichator

doorpi's Issues

[Addition] Videoserver

Mit der Implementierung von 5707719 ist die Möglichkeit hinzugekommen, einen Videoserver als feed für das sipphone (pjsua) zu nutzen.

Da die benötigten Sytemressourcen noch nicht im Installationsscript verankert sind, hier die Dependenzen

#--- v4l2loopback
sudo apt install v4l2loopback-dkms v4l2loopback-utils

#Falls Probleme auftreten, video0 und video1 vertauscht werden (und damit der rtsp server nicht funktioniert)
#kann man statt devices=1 video_nr=X festlegen
#ACHTUNG: der wert von video_nr MUSS 3 oder kleiner sein, da sonst PJSUA das Gerät nicht initialisiert
#Es als /dev/video0 zu laden hat den vorteil, das es damit zum default device in PJSUA wird

echo "v4l2loopback" | sudo tee -a /etc/modules

echo 'options v4l2loopback devices=1
options v4l2loopback max_buffers=2
options v4l2loopback exclusive_caps=1
options v4l2loopback card_label="VirtualDoorpiCam #0"' | sudo tee /etc/modprobe.d/v4l2loopback.conf

Wer einen server aufsetzen will:

#--- v4l2rtspserver
sudo apt -y install cmake liblog4cpp5-dev libv4l-dev git

## Edit as needed. 
VID_WIDTH=720
VID_HEIGHT=480
VID_FRAMES=15
VID_SER_PORT=7447
VID_DEV=/dev/video1
cd ~
git clone https://github.com/mpromonet/v4l2rtspserver.git
cd v4l2rtspserver/
cmake . && make && sudo make install

sudo sed -i "s#^ExecStart=.*#ExecStart=\/usr\/local\/bin\/v4l2rtspserver -W $VID_WIDTH -H $VID_HEIGHT -F $VID_FRAMES -P $VID_SER_PORT $VID_DEV#g" /lib/systemd/system/v4l2rtspserver.service

sudo systemctl enable v4l2rtspserver
cd ~ && rm -rf v4l2rtspserver

Reboot + Test (z.B. VLC Client): rtsp://<localip>:7447/unicast

Zur Erklärung: Der RTSP Server streamt direkt von dem Kamera Modul. Doorpi (resp. FFmpeg) transcoded den feed und legt ihn auf das loopback device (das wiederum von pjsua gelesen wird). Ähnlich funktioniert es, wenn man einen nicht stationären stream einbinden will (stream->tanscoding->loopback->pjsua)

Abbruch bei Neuinstallation

HW: Raspi 3

Distri: Raspberry0S: Release date: January 28th 2022 32bit

Python: 3.9

Neuinstallation

Installtionsschritte

sudo apt-get -y install git mc
sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
git clone https://github.com/emphasize/DoorPi
cd /tmp
cd DoorPi
git checkout bugfix/setuptools  
sudo python3 setup.py install --prefix=/usr/local

Logs habe ich mit angehängt

Log

Installation Script

Was soll das script können?

  • eine Vorauswahl der verwendeten (nicht core relevanten) Module zulassen - dementsprechend auch leicht erweiterbar sein
    Beispiel: MQTT, Mycroft, ... - ebenfalls ist es möglich schon Integriertes als optional herauszulösen
  • System Requirements installieren (auch in Abhängigkeit von Vorauswahlen)
  • anschlussfähig an setuptools sein
    Beispiel: Vorauswahl x triggert ein Ergänzen der entrypoints.in die dann über setuptools durch :file entrypoints.in eingebunden wird.
  • schlussendlich natürlich die installation initialisieren

Für system requirements empfehle ich das Python paket pako, um nicht für verschiedene Distros packages finden zu müssen

"nicht core relevant" ist dabei noch zu definieren.
Erweiternd ist zu erörtern was programmatisch nötig wäre Keyboards optional einzubinden.

[Build] PJSUA2 / Asterisk (video-spezifisch)

Base: RaspiOS Bulleseye 32-Bit (2022-04-07) + Doorpi (branch bugfix/setuptools)

Da noch nicht im Setupscript verankert hier ein Rezept für eine laufende PJSUA/Asterisk konfiguration

Das ganze stützt sich auf 4 Komponenten:

  • Pjproject
  • SDL
  • Asterisk
  • FFmpeg
    (es wird nur pjproject und openh264 kompiliert)

System Dependenzen:

libtool pkg-config libasound2-dev libpulse-dev libaudio-dev libjack-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev \
libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev \
libzrtpcpp-dev libxext-dev libpcre3-dev libtool libccrtp-dev libdbus-c++-dev libcommoncpp2-dev \
libdbus-1-dev libyaml-dev swig libsamplerate0-dev libspeexdsp-dev libspeex-dev libv4l-dev libx264-dev libcelt-dev \
libgmp3-dev libmpfr-dev libmpfr-doc libmpc-dev libffi-dev libmp3lame-dev libvorbis-dev libtheora-dev yasm nasm \
libopencore-amrwb-dev libopencore-amrnb-dev libvo-amrwbenc-dev libgsm1-dev opus-tools libopus-dev \
libass-dev libfreetype6-dev libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev meson ninja-build texinfo wget zlib1g-dev libsdl2-dev vpx-tools libvpx-dev libvpx6 x264

Swap Anpassung (Kompilierung von pjsua hat eine gewisse ohne die der Prozess abbricht)

#notwendig sind 1.5Gb für (pjsua2) Kompilierung
MINMEM=1572864
SWAP=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
MEM=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')
TOTALMEM=$(expr $SWAP + $MEM)
if [ $TOTALMEM -lt $MINMEM ] ; then
   sudo dphys-swapfile swapoff
   SWAPNEEDED=$(expr $(expr $MINMEM - $MEM) / 1000)
   sudo sed -i "s/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=${SWAPNEEDED}/g" /etc/dphys-swapfile
   sudo dphys-swapfile setup
   sudo dphys-swapfile swapon
   sudo reboot
fi
O264_PACKAGE="v2.2.0.tar.gz"
PJSIP_PACKAGE="2.12.tar.gz"
O264_VER=$(echo ${O264_PACKAGE%".tar.gz"} | cut -c 2-)
PJSIP_VER=${PJSIP_PACKAGE%".tar.gz"}

Openh264

cd ~ && wget https://github.com/cisco/openh264/archive/refs/tags/${O264_PACKAGE} && tar xvfz ${O264_PACKAGE} && cd openh264-${O264_VER} 
make -j`nproc` && sudo make install
cd ~ && rm -rf openh264-${O264_VER} && rm ${O264_PACKAGE}
sudo ldconfig

Pjproject

cd ~
wget https://github.com/pjsip/pjproject/archive/refs/tags/${PJSIP_PACKAGE}
tar xvfz ${PJSIP_PACKAGE} && cd pjproject-${PJSIP_VER}
echo '#define PJMEDIA_AUDIO_DEV_HAS_ALSA      1
#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
#define PJMEDIA_HAS_VIDEO       1' > pjlib/include/pj/config_site.h
Raspberry Pi -mtune -mfpu -march
Zero /1 A+/1 B+ arm1176jzf-s vfp armv6
2 B cortex-a7 neon-vfpv4 armv7
3 B cortex-a53 neon-vfpv4 armv7
3 B+ /4 B cortex-a72 neon-fp-armv8 armv8

vielleicht noch einmal genauer nachschauen, da es in jeder Generation zwischenmodelle gibt

echo "export CFLAGS += -march=armv7 -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access 
-ffast-math
export LDFLGS +=" > user.mak
nano third_party/build/os-auto.mak.in

Die webrtc sektion mit folgender überschreiben:

ifneq (@ac_no_webrtc@,1)
ifeq (@ac_external_webrtc@,1)
# External webrtc
else
DIRS += webrtc
WEBRTC_OTHER_CFLAGS = -fexceptions -DWEBRTC_POSIX=1 @ac_webrtc_cflags@
#ifneq ($(findstring sse2,@ac_webrtc_instset@),)
#    WEBRTC_SRC = \
#             modules/audio_processing/aec/aec_core_sse2.o               \
#             modules/audio_processing/aec/aec_rdft_sse2.o               \
#             modules/audio_processing/aecm/aecm_core_c.o                \
#             modules/audio_processing/ns/nsx_core_c.o                   \
#             system_wrappers/source/cpu_features.o
#else ifneq ($(findstring neon,@ac_webrtc_instset@),)
    WEBRTC_SRC = \
              modules/audio_processing/aec/aec_core_neon.o               \
              modules/audio_processing/aec/aec_rdft_neon.o               \
              modules/audio_processing/aecm/aecm_core_c.o                \
              modules/audio_processing/aecm/aecm_core_neon.o             \
              modules/audio_processing/ns/nsx_core_c.o                   \
              modules/audio_processing/ns/nsx_core_neon.o                \
              common_audio/signal_processing/cross_correlation_neon.o    \
              common_audio/signal_processing/downsample_fast_neon.o      \
              common_audio/signal_processing/min_max_operations_neon.o
    WEBRTC_OTHER_CFLAGS += -DWEBRTC_HAS_NEON
#else ifneq ($(findstring mips,@ac_webrtc_instset@),)
#    WEBRTC_SRC = \
#              modules/audio_processing/aec/aec_core_mips.o               \
#             modules/audio_processing/aec/aec_rdft_mips.o               \
#             modules/audio_processing/aecm/aecm_core_mips.o             \
#             modules/audio_processing/ns/nsx_core_mips.o                \
#             common_audio/signal_processing/cross_correlation_mips.o    \
#             common_audio/signal_processing/downsample_fast_mips.o      \
#             common_audio/signal_processing/min_max_operations_mips.o
#
#    WEBRTC_OTHER_CFLAGS += -DMIPS_FPU_LE
#else # Generic fixed point
#    WEBRTC_SRC = \
#             modules/audio_processing/aecm/aecm_core_c.o                \
#             modules/audio_processing/ns/nsx_core_c.o                   \
#             common_audio/signal_processing/complex_fft.o
#endif
endif
endif
./configure --enable-shared
make dep && make -j`nproc`
sudo make install
cd pjsip-apps/src/swig/python
make
sudo pip install .
cd ~ && sudo rm -rf pjproject-${PJSIP_VER} && rm ${PJSIP_PACKAGE}
sudo ldconfig

Status of master

Pjsua hab ich zwischenzeitlich am laufen. Grundsätzlich sieht es auch eine Videoübertragung vor. Ob und wie jezt der PiKamera stream in die Sip übertragung eingebunden werden kann hab/kann ich derzeitig nicht testen können , mangels Hardware. Da die FB sowieso keine Bildübertragung unterstütz muss zusätzlich noch ein Sip Server eingerichtet werden mit dem man dann einen möglichen Stream testen kann. Piface geht auch lässt sich aber noch nicht ordnugsgemäß beenden, da stehe ich gerade auf dem schlauch
Anrufen von Pjsua führt derzeitig noch zum Absturz.

@emphasize @leoguiders @Pampersjoe wenn ich es richtig verstanden habe wollen wir die Diskussion hier weiter führen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.