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

FreeBSD port WIP SRTP protect error. #2232

Closed
jsm222 opened this issue Jun 15, 2020 · 5 comments
Closed

FreeBSD port WIP SRTP protect error. #2232

jsm222 opened this issue Jun 15, 2020 · 5 comments

Comments

@jsm222
Copy link
Contributor

jsm222 commented Jun 15, 2020

Hi
I hope you can point me to some things to investegate..I have tested libsrtp2 and tried different openssl implementations. and I have compiled with and without --disable-aes-gcm all with same results.
I have compiled the commit dc0b4e0 (master as of 2020-06-15)

#on 192.168.1.1

gst-launch-1.0 -v videotestsrc ! vp8enc ! rtpvp8pay ! srtpenc key=012345678901234567890123456789012345678901234567890123456789 ! udpsink host=192.168.1.5 port=5000
#on 192.168.1.5 with x11:
gst-launch-1.0 -v udpsrc port=5000 caps="application/x-srtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)VP8, payload=(int)96, ssrc=(uint)3563210037, timestamp-offset=(uint)1370188763, seqnum-offset=(uint)1751, a-framerate=(string)30, srtp-key=(buffer)012345678901234567890123456789012345678901234567890123456789, srtp-cipher=(string)aes-128-icm, srtp-auth=(string)hmac-sha1-80, srtcp-cipher=(string)aes-128-icm, srtcp-auth=(string)hmac-sha1-80" ! srtpdec ! rtpvp8depay ! decodebin ! videoconvert ! autovideosink
#video shows so libsrtp2 should be working
sh /usr/local/share/janus/streams/test_gstreamer_1.sh

open stream in demos:
New video stream! (ssrc=3988464710, index 0)
Video SSRC changed, 0 --> 3988464710
Video SSRC changed, 0 --> 3988464710
[ice.c:janus_ice_outgoing_traffic_handle:4395] [5504237728486635] ... SRTP protect error... srtp_err_status_bad_param (len=24-->24, ts=0, seq=1)...
[ice.c:janus_ice_outgoing_traffic_handle:4395] [5504237728486635] ... SRTP protect error... srtp_err_status_bad_param (len=24-->24, ts=0, seq=2)...
[ice.c:janus_ice_outgoing_traffic_handle:4395] [5504237728486635] ... SRTP protect error... srtp_err_status_bad_param (len=24-->24, ts=0, seq=3)...
[ice.c:janus_ice_outgoing_traffic_handle:4395] [5504237728486635] ... SRTP protect error... srtp_err_status_bad_param (len=24-->24, ts=0, seq=4)...

I can provide you access to compiler output and binary packages for FreeBSD 12.1 if you would like to take a deep dive...

@lminiero
Copy link
Member

srtp_err_status_bad_param is a libsrtp error, and I'm not familiar with its internals. You may want to check what can cause it to happen there.

@jsm222
Copy link
Contributor Author

jsm222 commented Jun 15, 2020

--- rtp.h.orig  2020-06-15 20:40:17 UTC
+++ rtp.h
@@ -14,7 +14,7 @@
 #define JANUS_RTP_H
 
 #include <arpa/inet.h>
-#ifdef __MACH__
+#if defined (__MACH__) || defined(__FreeBSD__)
 #include <machine/endian.h>
 #define __BYTE_ORDER BYTE_ORDER
 #define __BIG_ENDIAN BIG_ENDIAN

made the

typedef struct rtp_header
{
#if __BYTE_ORDER == __BIG_ENDIAN
	uint16_t version:2;
	uint16_t padding:1;
	uint16_t extension:1;
	uint16_t csrccount:4;
	uint16_t markerbit:1;
	uint16_t type:7;
#elif __BYTE_ORDER == __LITTLE_ENDIAN
	uint16_t csrccount:4;
	uint16_t extension:1;
	uint16_t padding:1;
	uint16_t version:2;
	uint16_t type:7;
	uint16_t markerbit:1;
#endif
	uint16_t seq_number;
	uint32_t timestamp;
	uint32_t ssrc;
	uint32_t csrc[16];
} rtp_header;

correct and now my port can stream

@jsm222 jsm222 closed this as completed Jun 15, 2020
@lminiero
Copy link
Member

@jsm222 I've seen you mentioning a couple of other FreeBSD-related fixes somewhere else. Will you consider putting them together in a pull request we can merge, or are you still investigating if there's other things that need fixing first?

@jsm222
Copy link
Contributor Author

jsm222 commented Jun 16, 2020

I'll have to do some more testing, but I'll be happy to make a pull request with FreeBSD support when done. Thanks..

@lminiero
Copy link
Member

Thanks, looking forward to that then!

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

No branches or pull requests

2 participants