awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.04k stars 313 forks source link

[BUG] : library linking order for my embedded system #632

Closed shiv50084 closed 4 years ago

shiv50084 commented 4 years ago

A one liner description about the use case and what you are trying to achieve:-

By using this command i have compiled my webrtc sdk for my embedded platform:-

cmake .. -DADD_MUCLIBC=TRUE -DBUILD_OPENSSL=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic32 \ -DOPENSSL_EXTRA="no-egd;no-sse2;no-asm;no-threads;no-hw;no-zlib;no-weak-ssl-ciphers;no-static-engine" \ -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=mips-unknown-linux-uclibcgnu \ -DCMAKE_INSTALL_PREFIX=/opensource/amazon-kinesis-video-streams-webrtc-sdk-c/out/

**I am trying to link webrtc SDK with my embedded system. and my library linking order is

amazon-kinesis-video-streams-webrtc-sdk-c/out/lib -lkvsWebrtcClient -lkvsWebrtcSignalingClient amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/ -lkvspicUtils -lwebsockets -lkvsCommonLws amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libssl.so amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libcrypto.so amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libsrtp2.so amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libusrsctp.so**

Any design considerations/constraints Explain in detail how you would like to integrate our SDK into your solution

I am taking a sample code reference from file "kvsWebRTCClientMaster.c" and my device send video and audio to viewer and receive audio from viewer to achieve 2-way communication.

while linking i am facing an error. Please see attached file for error.

linkingerro.txt

So i want to know what will be the library linking order to resolve this error.

If you would not like to open an issue to discuss your solution in open-platform, please email your question to kinesis-video-support@amazon.com

lherman-cs commented 4 years ago

@shiv50084 it seems that the linker failed to find third party dependency symbols. Could you try to give BUILD_STATIC_LIBS=ON to cmake? This will compile third party dependencies statically.

shiv50084 commented 4 years ago

@lherman-cs I found one issue while cross compiling dependencies opnessl compile and create .a library properly. While creating library for other dependencies like libwebsocket , srtp, usrsctp etc... compiling from cross-toolchain but creating library using /usr/bin/ar instead of cross-toolchain mips-linux-gnu-ar.

Can you please help how to set these path even export path down't make any effect?

i did like:- export CC=${CROSS_COMPILER_PREFIX}-gcc export LD=${CROSS_COMPILER_PREFIX}-ld export AR=${CROSS_COMPILER_PREFIX}-ar export AS=${CROSS_COMPILER_PREFIX}-as export NM=${CROSS_COMPILER_PREFIX}-nm export RANLIB=${CROSS_COMPILER_PREFIX}-ranlib export CXX=${CROSS_COMPILER_PREFIX}-g++

lherman-cs commented 4 years ago

@shiv50084 not sure how it was fine for openssl but not others. It seems that cmake doesn't respect other environment variables other than CC and CXX, I might be wrong about this.

From https://stackoverflow.com/questions/5098360/cmake-specifying-build-toolchain, it looks like you can specify a toolchain file which is a cmake file which you can use to set the toolchain.

shiv50084 commented 4 years ago

Can you Please tell this SDK currently support OPUS audio only?

Bcz in code its showing audio support for for PCMALaw and PCMULaw also in function "writeFrame".

    case RTC_CODEC_OPUS:
        rtpPayloadFunc = createPayloadForOpus;
        rtpTimestamp = convertTimestampToRTP(OPUS_CLOCKRATE, pFrame->presentationTs);
        break;

    case RTC_CODEC_MULAW:
    case RTC_CODEC_ALAW:
        rtpPayloadFunc = createPayloadForG711;
        rtpTimestamp = convertTimestampToRTP(PCM_CLOCKRATE, pFrame->presentationTs);
        break;
lherman-cs commented 4 years ago

@shiv50084 yes, we do support PCMALaw and PCMULaw. You can also change our example's media pipeline to use PCMALaw, https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/master/samples/kvsWebRTCClientMasterGstreamerSample.c#L138-L140.

I'll also update the README to include these.

lherman-cs commented 4 years ago

The documentation fix: https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/pull/659

shiv50084 commented 4 years ago

I tried pcmalaw audio stream from encoder at 8K sample rate but I didn't able to listen audio on test page https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html and android generic APP

How can I test pcm alwa and ulaw audio ?

Is there any specific requirements for pcm alaw and ulaw audio to play with test page or app?

Or we need to test any specific bitrate and sampling rate to encoder to test with test page? Can you please suggest for this?