ArdroneSDK3 STREAMING not working


#1

Hy guys,

I have a strange problem in video streaming in the Unix Sample BebopDroneDecodeStream.c.
I have successfully installed the ArdroneSDK3 on my Ubuntu 14.04 LTS.
ffmpeg version is 2.4.3

When i run the sample BebopDroneDecodeStream.c, I got a segmentation fault in the ARSTREAM_Reader.c source file at line 420.
This is the produced output:

joshy@NB-Giorgio:/opt/beebop/Samples/Unix/BebopDroneDecodeStream/build$ ./BebopDroneDecodeStream
[INF] BebopDroneReceiveStream | 20:05:29:726 | main:481 - -- Starting --
[INF] BebopDroneReceiveStream | 20:05:29:726 | ardiscoveryConnect:761 - - ARDiscovery Connection
[ERR] BebopDroneReceiveStream | 20:05:29:737 | ARDISCOVERY_Connection_ReceiveJsonCallback:819 -     - ReceiveJson:{ "status": 0 , "c2d_port": 54321, "arstream_fragment_size": 1000, "arstream_fragment_maximum_number": 128, "arstream_max_ack_interval": 0, "c2d_update_port": 51, "c2d_user_port": 21 } 
[INF] BebopDroneReceiveStream | 20:05:29:737 | startNetwork:839 - - Start ARNetwork
[ERR] BebopDroneReceiveStream | 20:05:29:738 | startDecoder:1488 - ARCODECS_Manager_New: OK
[INF] BebopDroneReceiveStream | 20:05:29:739 | startDecoder:1579 - Creation of video decodingThread...Done
[INF] BebopDroneReceiveStream | 20:05:29:739 | startVideo:962 - - Start ARStream
[ERR] BebopDroneReceiveStream | 20:05:29:739 | startVideo:981 - ARStream creation : No error
[ERR] BebopDroneReceiveStream | 20:05:29:739 | startVideo:995 - Creation of video Rx thread OK
[ERR] BebopDroneReceiveStream | 20:05:29:739 | startVideo:1005 - Creation of video Tx thread OK
[ERR] BebopDroneReceiveStream | 20:05:29:739 | startVideo:1010 - Creation of video decoding Thread...OK.
[INF] BebopDroneReceiveStream | 20:05:29:739 | sendDate:1178 - - Send date
[INF] BebopDroneReceiveStream | 20:05:29:739 | sendAllSettings:1220 - - Send get all settings
[INF] BebopDroneReceiveStream | 20:05:29:739 | sendAllStates:1247 - - Send get all states
[INF] BebopDroneReceiveStream | 20:05:29:739 | sendBeginStream:1273 - - Send Streaming Begin

Do you have any suggestion? Which ffmpeg version should be used?

Thank you!!


#2

I have the same issue with an Bebop drone and ARSDK3_version_3_7_5. My operating system is ubuntu 14.04. Segfault occurs in ARSTREAM_Reader.c

I did a lot of gdb inspection. It seems that the ar controller can not start the stream, since there is no codec given. The following switch statement in ARCONTROLLER_Stream1.c does the trouble:

stream1Controller->codec.type is none of the H264, PCM or MJPEG in my case (it is zero, to be specific), so the both indices remain -1.

    int d2cStreamData = -1;
    int c2dStreamAck = -1;

    switch (stream1Controller->codec.type)
    {
        case ARCONTROLLER_STREAM_CODEC_TYPE_H264:
        case ARCONTROLLER_STREAM_CODEC_TYPE_MJPEG:
                d2cStreamData = stream1Controller->networkConfiguration->deviceToControllerARStreamData;
                c2dStreamAck = stream1Controller->networkConfiguration->controllerToDeviceARStreamAck;
                break;
        case ARCONTROLLER_STREAM_CODEC_TYPE_PCM16LE:
                d2cStreamData = stream1Controller->networkConfiguration->deviceToControllerARStreamAudioData;
                c2dStreamAck = stream1Controller->networkConfiguration->controllerToDeviceARStreamAudioAck;
            break;
        default:
            break;
    }

However, I was able to “hard code” the codec in ARCONTROLLER_Stream_video_New(), where there is the setting for the bebop missing anyway:

// Get video codec
switch (discoveryDevice->productID)
{
    case ARDISCOVERY_PRODUCT_JS:
    case ARDISCOVERY_PRODUCT_JS_EVO_LIGHT:
    case ARDISCOVERY_PRODUCT_JS_EVO_RACE:
    case ARDISCOVERY_PRODUCT_POWER_UP:
	codecType =  ARCONTROLLER_STREAM_CODEC_TYPE_MJPEG;
	break;

    default:
	codecType = ARCONTROLLER_STREAM_CODEC_TYPE_MJPEG; // originally was DEFAULT, not MJPEG
	break;
}

The segfault vanished, but now I get lots of error messages:

   [ERR] ARSTREAM_Reader | 13:08:31:580 | ARSTREAM_Reader_RunDataThread:389 - Error while reading stream data: Given IOBuffer identifier is unknown

No way to settle this right without further knowledge or more time-consuming investigation :frowning:


#3

Hi,

You should upgrade your SDK to a newer version. The 3.7.5 SDK is more than one and a half years old, and the drone firmware have greatly changed since.

You can find the documentation about the new SDK version here.

Regards,
Nicolas


#4

Thank you very much for your hint, Nicolas. Updating firmware and SDK indeed solved the problem for me.

Turned out that I have installed a legacy version of the freeflight app, so I was not able to connect and update my drone prior to using the SDK. So it was simply a version mismatch.