main demux error: socket bind error: Cannot assign requested address when trying to connect gstreamer and vlc - sockets

I am trying to connect with vlc to an embedded board where a gstreamer cmd is executed. However vlc gives me the error:
[00007f9734001160] main demux error: socket bind error: Cannot assign requested address
The following gstreamer cmd is used:
"appsrc ! videoconvert ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! jpegenc ! multipartmux ! tcpserversink name=out-sink host=0.0.0.0 port=7001"
And I try to use the following command on the host machine:
vlc rtp://192.168.0.10:7001
Sadly it does not work, however I can ping from the one machine to the other and vice-versa.
Furthermore, it is a precompiled binary, therefore I am unable to change the gstreamer command and can only adapt the command and utilities used at the host machine.
Any ideas what could be the problem?

I tested in my local system with videotestsrc instead of your appsink.
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! jpegenc ! multipartmux ! tcpserversink name=out-sink host=0.0.0.0 port=7001
Please note that you are transmitting over TCP and without RTP payloading so instead of rtp://.. I listened with tcp:// and vlc was able to open.
vlc tcp://127.0.0.1:7001
If you still want to use rtp I would recommend that you use rtpjpegpay, and some sdp file like
v=0
m=video 7001 RTP/AVP 26
c=IN IP4 127.0.0.1
a=rtpmap:26 JPEG/90000

Related

OpenOCD doesn't open a gdb connection for a ST nucleo-h743zi board

I have successfully flashed a nucleo-h743zi board with a small app that blinks an LED and sends strings through the UART.
I'm now trying to connect to it with gdb, using OpenOCD v 0.12.0.
After building it, I execute this:
$./build/bin/openocd -f tcl/interface/stlink.cfg -c "transport select hla_swd" -f tcl/target/stm32h7x.cfg
And I obtain this:
Open On-Chip Debugger 0.12.0-rc2+dev-00989-g9501b263e (2022-12-15-15:37)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1800 kHz
(the command line returns after printing that)
I have tried as well
./build/bin/openocd -f ./build/share/openocd/scripts/board/st_nucleo_h743zi.cfg
and I obtain the same result.
I have double checked that the mentioned ports are not open with netstat -tulpn | grep LISTEN
As you can see, there is no gdb connection. I have tried telnet localhost 4444 as well, and I obtain:
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
What am I doing wrong?
The problem was that I had the STM32CubeProgrammer connected.

How do you stream WebCam feed to multiple clients on the same wifi network, where client IP's can be random due to DHCP?

I have a scenario where I want to stream a webcam feed to multiple display devices over a single wifi network. I've tried using UDP multicast, but it seems the wifi is flooded with packets and the video is extremely choppy or simply doesn't work. It's like I can see the first frame of the video and then maybe a few later frames, then it just stops altogether.
Currently I have three Raspberry Pi's (RPi) configured like this:
All 3 RPi's are version 4 with Raspberry Pi OS (buster), and none of them are connected to the LAN via ethernet (eth0).
The primary RPi has a webcam and also an USB wifi adapter.
◦ The wifi adapter is a Panda PAU06. [Wifi adapter link]
◦ The webcam is connected to the PRi's camera port.
[camera link]
◦ The primary RPi does not have a display, only the webcam.
◦ The internal nic (wlan0) is connected to my home router, but should not be needed in this scenario. I simply use it to connect to the RPi network, like a jump spot, for configuration purposes.
◦ The Panda nic (wlan1) uses a static IP of 192.168.44.1, and is configured as an Access Point using hostapd and WPA security.
◦ The primary RPi has DHCP configured to hand out addresses in the range 192.168.44.[10-50] on wlan1.
◦ Routing is not setup to allow the wlan1 to access the internet.
The secondary RPi's just have the internal wifi (wlan0) connecting to the primary RPi's SSID.
◦ The secondary RPI's have display's attached to them, with native resolution of 800x480. [display link]
I can ssh just fine between the three RPi's, but obviously I must connect to the primary before connecting to the other two.
This is what I've been trying to setup, but doesn't quite work right. I don't know if I'm doing something wrong, or if there's a bug in gstreamer's multicast protocol.
‣ Host with camera using multicast:
$ sudo route add 224.1.1.1 wlan1
$ gst-launch-1.0 -v v4l2src device=/dev/video0 \
! 'video/x-raw,width=800,height=480,framerate=24/1' \
! clockoverlay 'time-format=%D %H:%M:%S' \
! jpegenc ! rtpjpegpay \
! udpsink host=224.1.1.1 port=5000 auto-multicast=true
‣ Client(s) with display using multicast:
$ gst-launch-1.0 udpsrc address=224.1.1.1 port=5000 \
auto-multicast=true \
! application/x-rtp, 'encoding-name=JPEG' \
! rtpjpegdepay ! jpegdec ! autovideosink
Any comments or suggestions are greatly appreciated!
Note: Using unicast, works fine, but I can only have 1 remote connected and I have to know it's IP address in advance, which I don't because its controlled by DHCP.
‣ Host with camera using unicast:
$ gst-launch-1.0 -v v4l2src device=/dev/video0 \
! 'video/x-raw,width=800,height=480,' framerate=24/1 \
! clockoverlay 'time-format=%D %H:%M:%S' \
! jpegenc ! rtpjpegpay \
! udpsink host=192.168.44.11 port=5000
‣ Client with display using unicast:
$ gst-launch-1.0 udpsrc port=5000 \
! application/x-rtp, 'encoding-name=JPEG' \
! rtpjpegdepay ! jpegdec ! autovideosink
Wifi is weird for Multicast. It can hog the full bandwidth at 2.5GHZ and 20% of bandwith for 5GHz. So using unicast would be better.
You would just use tee for replicating the stream and send to each of your targets (assuming their IP addresses ending with 11,12,13):
gst-launch-1.0 -v v4l2src device=/dev/video0 \
! 'video/x-raw,width=800,height=480,' framerate=24/1 \
! clockoverlay 'time-format=%D %H:%M:%S' \
! jpegenc ! rtpjpegpay \
! tee name=stream \
stream. ! queue ! udpsink auto-multicast=0 host=192.168.44.11 port=5000 \
stream. ! queue ! udpsink auto-multicast=0 host=192.168.44.12 port=5000 \
stream. ! queue ! udpsink auto-multicast=0 host=192.168.44.13 port=5000
I'd suggest adding rtpjitterbuffer on receiver side:
gst-launch-1.0 udpsrc port=5002 auto-multicast=0 ! application/x-rtp,encoding-name=JPEG ! rtpjitterbuffer latency=500 ! rtpjpegdepay ! jpegdec ! autovideosink

timeout error with usocket on common lisp

I’m having trouble with cl-smtp:send-email which seems to stem from a timeout error when calling usocket:socket-connect.
Here is what I am trying to do:
(cl-smtp:send-email "outgoing.mit.edu" "m_klein#mit.edu"
(list "m_klein#mit.edu") "s1" "m1”)
This seems to be the call where the failure occurs (according to the backtrace):
(usocket:socket-connect "outgoing.mit.edu" 25
:protocol :stream
:element-type '(unsigned-byte 8)
:timeout nil
:deadline nil
:nodelay nil
:local-host nil
:local-port nil)
Here is the error:
Error: Error #<USOCKET:TIMEOUT-ERROR #x302001E5FDED>
While executing: USOCKET::RAISE-ERROR-FROM-ID, in process Listener(475).
The odd thing is that the same function call has worked on other machines, but not on my current mac laptop or the cloud-based mac I’ve also been using.
I am running Clozure Common Lisp 1.11.1 on a MacBook Pro on OS 10.13.3
Here are snapshots of the backtrace FYI: https://imgur.com/a/e2xcf
Any ideas? Any help would be greatly appreciated.
Since you are using an external server, first you need to check, correctness of the address (connect using telnet), port and maybe you need an authentication.
Since you are using cl-smtp, first I recommend you to test how it works, for that the easy way of testing smptp is using mailcatcher inside a docker container:
docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher
docker ps | grep mailcatcher
6fb056fceb6b schickling/mailcatcher "mailcatcher -f --ip…" 9 months ago Up 18 minutes 0.0.0.0:1025->1025/tcp, 0.0.0.0:1080->1080/tcp mailcatcher
Then you can access to the ourtgoing mail in a web browser localhost:1080, and send mail to localhost:1025
For testing the SMTP, server I recommend to use telnet:
telnet
telnet> o localhost 1025
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 EventMachine SMTP Server
EHLO localhost
250-Ok EventMachine SMTP Server
250-NO-SOLICITING
250 SIZE 20000000
there is a great article on that here
When you are sure that, you get the requirements try with lisp:
CL-USER> (cl-smtp:send-email "127.0.0.1" "antonio.querol#example.com" "pedro.lopez#example.com" "Say Hello" "Hello World"
:port 1025)
("Ok")

Unable to send traffic over RDMA

I have softROCE setup on SUSE Linux SP11. I am trying to validate the traffic over RXE device. I am able to send and receive traffic using ibv_*_pingpong. But for rping it is giving and error RDMA_CM_EVENT_UNREACHABLE, error -110.
#rxe_cfg -l
Name Link Driver Speed NMTU IPv4_addr RDEV RMTU
p4p1 yes r8169 1500 10.213.64.106 rxe0 1024 (3)

SIPP with Proxy Media

I am using SIPP to load test a proxy media server. I am not able to set the IP and port of the proxy media server on the SDP generated by SIPP,
I get the below error,
./sipp -sn uac -d 10000 -l 1000 -i 192.12.24.32 -p 50970 -mi 65.67.8.99 -mp 48321 10.12.24.32:5060 -sf uac_pcap.xml
Unable to bind audio RTP socket (IP=65.67.8.99, port=48322), errno = 99 (Cannot assign requested address).
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
t=0 0
c=IN IP[local_ip_type] [media_ip]
m=audio [auto_media_port] RTP/AVP 8
a=rtpmap:8 PCMA/8000
Please help !!!
I'm not an expert in either sdp (sdp probably should be one of your tags, btw) or sipp but the sipp documentation says:
-mi : Set the local media IP address (default: local primary host IP address)
-mp : Set the local RTP echo port number. Default is 6000.
This means that sipp tries to open the port designed by -mp on the local IP designed by -mi.
From what you said I understand the IP:port combination you give in -mi/-mp to be the IP:port combination on the media server, not on the machine running sipp. This means that sipp is trying to open a port on an IP owned by the destination, hence why it "Cannot assign requested address".
The IP:port of the media server should not be part of the SDP generated by sipp. Sipp should describe its end of the media session, then the reply to the INVITE should contain an SDP coming in from 10.12.24.32:5060 with an SDP describing the other end of the media session, including the IP:port of the media server.
Think about it. In a real call you would know the destination SIP address (or sips or...) but you would have no idea of where their media would be. The exchange of SIP message is what establishes that (through an exchange of SDPs), so your sipp SDP should not contain information about a remote media server that it would not know about in a real call.
Try this*:
./sipp -d 10000 -l 1000 -i 192.12.24.32 -p 50970 -mi 192.12.24.32 -mp 48321 10.12.24.32:5060 -sf uac_pcap.xml
*You use both -sn to specify a built in scenario and -sf to specify a scenario file. In other word you are specifying two scenarios, so I removed the built in scenario from the line. Maybe you have good reasons for it to be here that I know nothing about, in which case put it back in.