esp rtsp protocol example few problems

accacca
Posts: 34
Joined: Mon Aug 06, 2018 4:59 pm

esp rtsp protocol example few problems

Postby accacca » Wed Nov 15, 2023 2:56 pm

I would like to use the esp-rtsp example with a board (lilygo s3 camera) I was trying to modify the example to fit my board
But I got to a point where the log is telling me.

Code: Select all

I
 (13258) ESP_RTSP_SERVER: esp_rtsp ver: 1.1.0 compile date: Aug 31 2023-09:45:42
E (13263) MEDIA_OS: Not found right xTaskCreateRestrictedPinnedToCore.
Please enter IDF-PATH with "cd $IDF_PATH" and apply the IDF patch with "git apply $ADF_PATH/idf_patches/idf_v3.3_freertos.patch" first

E (13282) MEDIA_OS: Error creating RestrictedPinnedToCore rtsp_server
E (13289) ESP_RTSP_SERVER: Can not start RTSP server task!
I (13295) RTSP_SERVICE: RTSP_STATE_TEARDOWN
and when I apply the patch

Code: Select all

F:\ub\hw\esp\fw\adf2311\esp-adf\esp-idf>git apply f:\ub\hw\esp\fw\adf2311\esp-adf\idf_patches\idf_v3.3_freertos.patch
error: patch failed: components/freertos/include/freertos/task.h:674
error: components/freertos/include/freertos/task.h: patch does not apply
error: patch failed: components/freertos/tasks.c:756
error: components/freertos/tasks.c: patch does not apply
VScode + IDF 4.4.4

Second question:
In the main

Code: Select all

    ESP_LOGI(TAG, "[ 2 ] Initialize av stream");
    av_stream_config_t av_stream_config = {
        .algo_mask = ALGORITHM_STREAM_USE_AEC,
        .acodec_samplerate = AUDIO_CODEC_SAMPLE_RATE,
        .acodec_type = AV_ACODEC_NULL, // AV_ACODEC_G711A,
        .vcodec_type = AV_VCODEC_MJPEG,
        .hal = {
            .uac_en = false,
            .uvc_en = false,
            .video_soft_enc = false,
            .audio_samplerate = AUDIO_HAL_SAMPLE_RATE,
            .audio_framesize = PCM_FRAME_SIZE,
            .video_framesize = RTSP_FRAME_SIZE,
        },
    };
hal.uac_en is set to false but when I go to av_stream_camera_init in av_stream_hal_camera.c

Code: Select all

static camera_config_t camera_config = {
    .pin_pwdn = CAM_PIN_PWDN,
    .pin_reset = CAM_PIN_RESET,
    .pin_xclk = CAM_PIN_XCLK,
    .pin_sccb_sda = -1,
    .pin_sccb_scl = -1,

    .pin_d7 = CAM_PIN_D7,
    .pin_d6 = CAM_PIN_D6,
    .pin_d5 = CAM_PIN_D5,
    .pin_d4 = CAM_PIN_D4,
    .pin_d3 = CAM_PIN_D3,
    .pin_d2 = CAM_PIN_D2,
    .pin_d1 = CAM_PIN_D1,
    .pin_d0 = CAM_PIN_D0,
    .pin_vsync = CAM_PIN_VSYNC,
    .pin_href = CAM_PIN_HREF,
    .pin_pclk = CAM_PIN_PCLK,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,

    .jpeg_quality = 12,     //0-63 lower number means higher quality
    .fb_count = 2,
    .grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};

int av_stream_camera_init(av_stream_hal_config_t *config, void *cb, void *arg)
{
    AUDIO_NULL_CHECK(TAG, config, return ESP_FAIL);

    if (config->uvc_en) {
        if (usb_camera_init(config, cb, arg) != ESP_OK) {
            return ESP_FAIL;
        }
    } else {
        camera_config.frame_size = config->video_framesize;
        if (config->video_soft_enc) {
            camera_config.pixel_format = PIXFORMAT_YUV422;
        }
        if (config->uac_en) {
            camera_config.pin_sccb_scl = CAM_PIN_SIOC;
            camera_config.pin_sccb_sda = CAM_PIN_SIOD;
        }
        if (esp_camera_init(&camera_config) != ESP_OK) {
            return ESP_FAIL;
        }
    }

    return ESP_OK;
}
with hal uac_en=false when call esp_camera_init the .pin_sccb_sda = -1 and .pin_sccb_scl = -1 and i2c init fial

accacca
Posts: 34
Joined: Mon Aug 06, 2018 4:59 pm

Re: esp rtsp protocol example few problems

Postby accacca » Wed Nov 15, 2023 8:26 pm

Ok now works..

Code: Select all

Please enter IDF-PATH with "cd $IDF_PATH" and apply the IDF patch with "git apply $ADF_PATH/idf_patches/idf_v3.3_freertos.patch" first
I looked in the idf patches folder and I realised that v3.3 refers to the ESP-IDF fraework version
I am working with IDF4.4.4 and with the correct idf_v4.4_freertos.patch the problem has been solved

For the second problem I have to study ... it is not yet clear how the library is initialised I probably have to manage the I2C configuration of the SCCB interface externally

Who is online

Users browsing this forum: No registered users and 61 guests