Outils pour utilisateurs

Outils du site


pd:purrneo

Différences

Ci-dessous, les différences entre deux révisions de la page.


pd:purrneo [2024/02/09 17:10] (Version actuelle) – créée - modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +==== script purrr des pieds à la tête ====
 +cas debian stretch sur noyau 4
 +<code>
 +cd /usr/src  #ou on veut...
  
 +## install dependances
 +echo 'flex automake tcl8.5-dev tk8.5-dev tcl-dev tk-dev libtool tkpng tclxapian bison fakeroot libnss3 libgconf2-4 python-tk byacc subversion git python-dev libasound2-dev libjack-jackd2-dev libasound2-plugins qjackctl libfftw3-dev libvorbis-dev libbluetooth-dev ubuntustudio-audio-plugins libmp3lame-dev libspeex-dev libgsl0-dev portaudio19-dev libgl1-mesa-dev  libglu1-mesa-dev libglew-dev libmagick++-dev libftgl-dev libgmerlin-dev libgmerlin-avdec-dev libavifile-0.7-dev libmpeg3-dev libquicktime-dev libv4l-dev libraw1394-dev libdc1394-22-dev ladspa-sdk dssi-dev tap-plugins ladspa-foo-plugins lua5.2-dev lua5.2 invada-studio-plugins-ladspa blepvco swh-plugins mcp-plugins cmt blop slv2-jack omins rev-plugins libslv2-dev dssi-utils vco-plugins wah-plugins fil-plugins mda-lv2 libsmpeg0 libjpeg62 flite1-dev libgsm1-dev libgtk2.0-dev libstk0-dev libsndobj-dev libfluidsynth-dev fluid-soundfont-gm zita-njbridge rsync liblua50-dev' > dep
 +for i in `cat dep`
 +do
 +apt install -y $i
 +done
 +# si Gem nous interesse
 +sudo apt-get install bison flex automake libasound2-dev libjack-jackd2-dev
 +libtool libbluetooth-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev
 +libmagick++-dev libftgl-dev libgmerlin-dev libgmerlin-avdec-dev
 +libavifile-0.7-dev libmpeg3-dev libquicktime-dev libv4l-dev libraw1394-dev
 +libdc1394-22-dev libfftw3-dev libvorbis-dev ladspa-sdk dssi-dev tap-plugins
 +invada-studio-plugins-ladspa blepvco swh-plugins mcp-plugins cmt blop
 +liblilv-dev omins rev-plugins dssi-utils vco-plugins wah-plugins
 +fil-plugins mda-lv2 libmp3lame-dev libspeex-dev libgsl-dev portaudio19-dev
 +liblua5.3-dev python-dev libsmpeg0 libjpeg-turbo8 flite1-dev libgsm1-dev
 +libgtk2.0-dev git libstk0-dev libsndobj-dev libfluidsynth-dev
 +fluid-soundfont-gm byacc
 +## install partie gpio
 +cd /usr/src
 +##git clone https://github.com/friendlyarm/WiringNP # ne connait plus la NEO???
 +wget http://bricoles.du-libre.org/lib/exe/fetch.php?media=pd:wiringnp.tar.gz
 +mv fetch*wiringnp.tar.gz wiringnp.tar.gz
 +tar xvf wiringnp.tar.gz
 +cd WiringNP
 +./build clean
 +./build static
 +
 +# purrr
 +cd /usr/src
 +git clone https://git.purrdata.net/jwilkes/purr-data.git
 +cd purr-data/l2ork_addons/raspberry_pi/disis_gpio
 +mv wiringPi wiringPi.PI
 +cp -a /usr/src/WiringNP wiringPi
 +
 +#ajout -fPIC pour nos ARM
 +cd /usr/src/purr-data/l2ork_addons/raspberry_pi
 +sed -i ./makefile.include -e "s/LINUXCFLAGS = -DPD -O2 /LINUXCFLAGS = -DPD -O2 -fPIC /"
 +# modif dependance rsp
 +cd /usr/src/purr-data
 +sed -i packages/linux_make/debian/control.raspbian -e "s/libgsl0ldbl\,/libgsl0ldbl\| libgsl2\,/"
 +cd /usr/src/purr-data/l2ork_addons
 +./tar_em_up.sh -R
 +
 +# pb avec Gem et pkgconfig a resoudre (ln -s /usr/bin/pkg-config /usr/bin/pkgconfig ...
 +#dans /usr/src/purr-data/packages/linux_make/Makefile , mettre en commentaire ? pkgconfig ?
 +#       -mv -f $(DESTDIR)$(libpddir)/../pkgconfig $(DESTDIR)$(libpddir)/
 +
 +# quand tout est ok on devrait avoir un pd...deb dans /usr/src/purr-data/packages/linux_make sinon
 +
 +cd /usr/src/purr-data/packages/linux_make/build/
 +tar cvfz ../purr-v-2.4.3-A.tgz ./*  # choisir le nom de l'archive... car il semble que le .deb ne se fasse pas
 +
 +# pour l'installation
 +cd /
 +tar xvf /usr/src/purr-data/packages/linux_make/purr-v-2.4.3-A.tgz
 +</code>
 +
 +=== ouverture du mixer audio et des entrée uart,i2c etc ===
 +Dans le cas noyau 4 mettre dans le fichier /boot/armbianEnv.txt 
 +<code>
 +armbianEnv.txt 
 +verbosity=1
 +logo=disabled
 +console=both
 +disp_mode=1920x1080p60
 +overlay_prefix=sun8i-h3
 +overlays=usbhost1 usbhost2 analog-codec i2c0 pps-gpio spi-spidev uart1 uart2
 +rootdev=UUID=a9473195-8c3d-4340-99fa-36e07f900eda
 +rootfstype=ext4
 +usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
 +</code>
 +rebooter pour la prise en compte
 +
 +<code>
 +apt install fluxbox xterm tightvncserver xfonts-base x11-xserver-utils
 +su pi 
 +vncpasswd
 +vncserver #  une fois pour pouvoir fixer le fichier .vnc/xstartup
 +</code>
 +
 +=== Patch et objets Purr ===
 +l'idée étant d'avoir des machines qui envoient du pâté en streaming vers une machine qui héberge icecast2 et des machines qui reçoivent la sauce pour en faire des choses. il y a au moins une machine de réception avec icecast qui peut etre celle de commande d'interfaces, moteur etc .. ou de production de son. 
 +  * http://write.flossmanuals.net/pure-data/audio-streaming/
 +  * objet mp3cast de unauthorized
 +  * http://aug.ment.org/readanysf/
 +
 +Il pourrait y avoir un gestionnaire genre webradio du style https://www.sourcefabric.org/en/airtime/ ou [[ http://liquidsoap.fm/doc-dev/quick_start.html| liquisoap]] avec des entrées/sorties vers Internet possibles...
 +
 +
 +Un qui fonctionne ffmpeg
 +  - : modprobe snd-aloop pcm_substreams=2 
 +  - : .asoundrc <code>
 +# .asoundrc
 +pcm.multi {
 +    type route;
 +    slave.pcm {
 +        type multi;
 +        slaves.a.pcm "output"; # ou slaves.a.pcm "loopout";
 +        slaves.b.pcm "loopin";
 +        slaves.a.channels 2;
 +        slaves.b.channels 2;
 +        bindings.0.slave a;
 +        bindings.0.channel 0;
 +        bindings.1.slave a;
 +        bindings.1.channel 1;
 +        bindings.2.slave b;
 +        bindings.2.channel 0;
 +        bindings.3.slave b;
 +        bindings.3.channel 1;
 +    }
 +
 +    ttable.0.0 1;
 +    ttable.1.1 1;
 +    ttable.0.2 1;
 +    ttable.1.3 1;
 +}
 +
 +pcm.!default {
 +    type plug
 +    slave.pcm "multi"
 +}
 +
 +ctl.!default {
 +    type hw
 +    card 0
 +
 +
 +pcm.output {
 +    type hw
 +    card 0
 +    rate 44100
 +    periods 128
 +    period_time 0
 +    period_size 1024 # must be power of 2
 +    buffer_size 8192
 +}
 +pcm.loopin {
 +    type plug
 +    rate 44100
 +    periods 128
 +    period_time 0
 +    period_size 1024 # must be power of 2
 +    buffer_size 8192
 +
 +    slave.pcm "hw:Loopback,0,0"
 +}
 +pcm.loopout {
 +    type plug
 +    rate 44100
 +    periods 128
 +    period_time 0
 +    period_size 1024 # must be power of 2
 +    buffer_size 8192
 +    slave.pcm "hw:Loopback,1,0"
 +}
 +</code>
 +{{ :pd:asound.tgz |}}
 +
 +apt install ffmpeg
 +
 +avec serveur , ici local
 +  - ffserver -f ffserver.conf # avec server.conf
 +  - ffmpeg -f alsa -ac 2 -i hw:Loopback,1,0 -acodec mp2 -b:a 128k http://localhost:8090/feed1.ffm
 +  - mplayer http://192.168.2.88:8090/stream.mp3 # par ex
 +
 +server.conf:
 +<code>
 +# Port on which the server is listening. You must select a different
 +# port from your standard HTTP web server if it is running on the same
 +# computer.
 +HTTPPort 8090
 +
 +# Address on which the server is bound. Only useful if you have
 +# several network interfaces.
 +HTTPBindAddress 0.0.0.0
 +
 +# Number of simultaneous HTTP connections that can be handled. It has
 +# to be defined *before* the MaxClients parameter, since it defines the
 +# MaxClients maximum limit.
 +MaxHTTPConnections 200
 +
 +# Number of simultaneous requests that can be handled. Since FFServer
 +# is very fast, it is more likely that you will want to leave this high
 +# and use MaxBandwidth, below.
 +MaxClients 100
 +
 +# This the maximum amount of kbit/sec that you are prepared to
 +# consume when streaming to clients.
 +MaxBandwidth 1000
 +
 +# Access log file (uses standard Apache log file format)
 +# '-' is the standard output.
 +CustomLog -
 +
 +# Suppress that if you want to launch ffserver as a daemon.
 +#NoDaemon
 +##################################################################
 +# Definition of the live feeds. Each live feed contains one video
 +# and/or audio sequence coming from an ffmpeg encoder or another
 +# ffserver. This sequence may be encoded simultaneously with several
 +# codecs at several resolutions.
 +
 +<Feed feed1.ffm>
 +# You must use 'ffmpeg' to send a live feed to ffserver. In this
 +# example, you can type:
 +#
 +# ffmpeg http://localhost:8090/feed1.ffm
 +
 +# ffserver can also do time shifting. It means that it can stream any
 +# previously recorded live stream. The request should contain:
 +# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
 +# a path where the feed is stored on disk. You also specify the
 +# maximum size of the feed, where zero means unlimited. Default:
 +# File=/tmp/feed_name.ffm FileMaxSize=5M
 +File /tmp/feed1.ffm
 +FileMaxSize 200K
 +
 +# You could specify
 +# ReadOnlyFile /saved/specialvideo.ffm
 +# This marks the file as readonly and it will not be deleted or updated.
 +
 +# Specify launch in order to start ffmpeg automatically.
 +# First ffmpeg must be defined with an appropriate path if needed,
 +# after that options can follow, but avoid adding the http:// field
 +#Launch ffmpeg
 +
 +# Only allow connections from localhost to the feed.
 +#ACL allow 127.0.0.1
 +
 +</Feed>
 +##################################################################
 +# Now you can define each stream which will be generated from the
 +# original audio and video stream. Each format has a filename (here
 +# 'test1.mpg'). FFServer will send this stream when answering a
 +# request containing this filename.
 +# MP3 audio
 +<Stream stream.mp3>
 +Feed feed1.ffm
 +Format mp2
 +AudioCodec libmp3lame
 +AudioBitRate 128
 +AudioChannels 2
 +AudioSampleRate 44100
 +NoVideo
 +</Stream>
 +# Ogg Vorbis audio
 +#<Stream test.ogg>
 +#Feed feed1.ffm
 +#Format ogg
 +#AudioCodec libvorbis
 +#Title "Stream title"
 +#AudioBitRate 64
 +#AudioChannels 2
 +#AudioSampleRate 44100
 +#NoVideo
 +#</Stream>
 +
 +##################################################################
 +# Special streams
 +
 +# Server status
 +
 +<Stream stat.html>
 +Format status
 +
 +# Only allow local people to get the status
 +ACL allow localhost
 +ACL allow 192.168.2.0 192.168.2.255
 +
 +#FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
 +</Stream>
 +# Redirect index.html to the appropriate site
 +<Redirect index.html>
 +URL http://www.ffmpeg.org/
 +</Redirect>
 +</code>
 +
 +directe sans serveur (mais sans trop de gain en ressource):
 +
 +  - fmpeg -f alsa -ac 2 -i hw:Loopback,1,0 -acodec libmp3lame -b 128k -f rtp rtp://clientip:6000
 +  - sur le client
 +    - avec mplayer stream.sdp
 +    - faire  un fchier texte stream.sdp <code>
 +o=- 0 0 IN IP4 clientip
 +c=IN IP4 clientip
 +m=audio 6000 RTP/AVP 14
 +</code> 
 +
 +acces par fluxbox, pensez vncpasswd et vncserver
 +<code>
 +apt install fluxbox xterm tightvncserver xfonts-base x11-xserver-utils
 +</code>