<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">can you drop a core file and see where its stuck?<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 23, 2017, at 6:57 PM, Guillermo Ruiz Camauer <<a href="mailto:grcamauer@gmail.com" class="">grcamauer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I have created a small utility program based on fs_encode which will take ALL files in a directory and convert them from .WAV to .G729 and .PCMU formats. The utility is called wavBatchEncode and takes just a directory path as an argument.<div class=""><br class=""></div><div class="">This program was working very well until I upgraded FreeSwitch. Now the program seems to hang when it tries to write out the first converted files. I have to KILL the program from another terminal. It leaves 2 0 byte files with .PCMU and .G729 extension.</div><div class=""><br class=""></div><div class=""> I have run through a GIT bisect to find where things broke. The last working version is Version 1.6.16 git ae1cdce 2017-04-11.</div><div class="">The first broken version is 38621e47bad3b63f03a0a27f6ca9ed92f6969032.</div><div class=""><br class=""></div><div class="">I then used GIT DIFF to see if I could see what had happened. There are very few modifications between these two commits:</div><div class=""><br class=""></div><div class=""><div class="">root@fs3:/usr/src/freeswitch.git# git diff ae1cdce 38621e47bad3b63f03a0a27f6ca9ed92f6969032</div><div class="">diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h</div><div class="">index e0a5c20..7ca027d 100644</div><div class="">--- a/src/include/switch_module_interfaces.h</div><div class="">+++ b/src/include/switch_module_interfaces.h</div><div class="">@@ -329,6 +329,11 @@ typedef struct switch_mm_s {</div><div class=""> switch_video_profile_t vprofile;</div><div class=""> switch_video_encode_speed_t vencspd;</div><div class=""> uint8_t try_hardware_encoder;</div><div class="">+ int scale_w;</div><div class="">+ int scale_h;</div><div class="">+ switch_img_fmt_t fmt;</div><div class="">+ char *auth_username;</div><div class="">+ char *auth_password;</div><div class=""> } switch_mm_t;</div><div class=""> </div><div class=""> /*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */</div><div class="">diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c</div><div class="">index b944625..4b92801 100644</div><div class="">--- a/src/mod/applications/mod_av/avformat.c</div><div class="">+++ b/src/mod/applications/mod_av/avformat.c</div><div class="">@@ -906,7 +906,7 @@ SWITCH_STANDARD_APP(record_av_function)</div><div class=""> char codec_str[256];</div><div class=""> const AVCodecDescriptor *desc;</div><div class=""> </div><div class="">- if (!strncmp(data, "rtmp://", 7)) {</div><div class="">+ if (!strncmp(data, "rtmp://", 7) || !strncmp(data, "rtsp://", 7)) {</div><div class=""> fmt->video_codec = AV_CODEC_ID_H264;</div><div class=""> fmt->audio_codec = AV_CODEC_ID_AAC;</div><div class=""> }</div><div class="">@@ -1694,9 +1694,20 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa</div><div class=""> return SWITCH_STATUS_GENERR;</div><div class=""> } else if (handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "youtube"))) {</div><div class=""> format = "flv";</div><div class="">- switch_snprintf(file, sizeof(file), "<a href="rtmp://%s" class="">rtmp://%s</a>", path);</div><div class="">+</div><div class="">+ // meh really silly format for the user / pass libav.....</div><div class="">+ if (handle->mm.auth_username && handle->mm.auth_password) { </div><div class="">+ switch_snprintf(file, sizeof(file), "<a href="rtmp://%s" class="">rtmp://%s</a> pubUser=%s pubPasswd=%s flashver=FMLE/3.0", path, handle->mm.auth_username, handle->mm.auth_password);</div><div class="">+ } else {</div><div class="">+ switch_snprintf(file, sizeof(file), "<a href="rtmp://%s" class="">rtmp://%s</a>", path);</div><div class="">+ }</div><div class="">+</div><div class="">+ } else if (handle->stream_name && !strcasecmp(handle->stream_name, "rtsp")) {</div><div class="">+ format = "rtsp";</div><div class="">+ switch_snprintf(file, sizeof(file), "<a href="rtsp://%s" class="">rtsp://%s</a>", path);</div><div class=""> }</div><div class=""> </div><div class="">+</div><div class=""> ext++;</div><div class=""> </div><div class=""> if ((context = (av_file_context_t *)switch_core_alloc(handle->memory_pool, sizeof(av_file_context_t))) == 0) {</div><div class="">@@ -1783,7 +1794,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa</div><div class=""> if (fmt->video_codec != AV_CODEC_ID_NONE) {</div><div class=""> const AVCodecDescriptor *desc;</div><div class=""> </div><div class="">- if ((handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "youtube")))) {</div><div class="">+ if ((handle->stream_name && (!strcasecmp(handle->stream_name, "rtmp") || !strcasecmp(handle->stream_name, "rtsp") || !strcasecmp(handle->stream_name, "youtube")))) {</div><div class=""> </div><div class=""> if (fmt->video_codec != AV_CODEC_ID_H264 ) {</div><div class=""> fmt->video_codec = AV_CODEC_ID_H264; // force H264</div><div class="">@@ -2525,6 +2536,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avformat_load)</div><div class=""> </div><div class=""> supported_formats[i++] = "av";</div><div class=""> supported_formats[i++] = "rtmp";</div><div class="">+ supported_formats[i++] = "rtsp";</div><div class=""> supported_formats[i++] = "mp4";</div><div class=""> supported_formats[i++] = "m4a";</div><div class=""> supported_formats[i++] = "mov";</div><div class="">diff --git a/src/mod/applications/mod_av/mod_av.c b/src/mod/applications/mod_av/mod_av.c</div><div class="">index 3d3bd82..141fcdc 100644</div><div class="">--- a/src/mod/applications/mod_av/mod_av.c</div><div class="">+++ b/src/mod/applications/mod_av/mod_av.c</div><div class="">@@ -93,7 +93,7 @@ int mod_av_lockmgr_cb(void **m, enum AVLockOp op)</div><div class=""> static void log_callback(void *ptr, int level, const char *fmt, va_list vl)</div><div class=""> {</div><div class=""> switch_log_level_t switch_level = SWITCH_LOG_DEBUG;</div><div class="">-</div><div class="">+ return;</div><div class=""> /* naggy messages */</div><div class=""> if (level == AV_LOG_DEBUG || level == AV_LOG_WARNING) return;</div><div class=""> </div><div class="">diff --git a/src/switch_core_file.c b/src/switch_core_file.c</div><div class="">index 46ee539..aff9442 100644</div><div class="">--- a/src/switch_core_file.c</div><div class="">+++ b/src/switch_core_file.c</div><div class="">@@ -177,6 +177,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,</div><div class=""> fh->mm.try_hardware_encoder = switch_true(val);</div><div class=""> }</div><div class=""> </div><div class="">+ if ((val = switch_event_get_header(fh->params, "auth_username"))) {</div><div class="">+ fh->mm.auth_username = switch_core_strdup(fh->memory_pool, val);</div><div class="">+ }</div><div class="">+</div><div class="">+ if ((val = switch_event_get_header(fh->params, "auth_password"))) {</div><div class="">+ fh->mm.auth_password = switch_core_strdup(fh->memory_pool, val);</div><div class="">+ }</div><div class="">+</div><div class=""> if ((val = switch_event_get_header(fh->params, "fps"))) {</div><div class=""> float ftmp = atof(val);</div><div class=""> if (ftmp > 0.0f) {</div><div class="">(END)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I believe that it is the changes in switch_core_file.c that break my utility program, but I can't be sure. Just o add some detail, I have a Digium TCE400 card in my system which handles the G729 conversion.</div><div class=""><br class=""></div><div class="">I have no idea of what those auth_username and auth_password parameters are, but that seems to break things for me. Any idea of what I can do to get things working again?</div><div class=""><br class=""></div><div class="">I have created a PasteBin with the code of my fs_encode derived utility: <a href="https://pastebin.freeswitch.org/view/a3d64c69" style="font-size:13px;color:rgb(0,136,204);text-decoration-line:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif" class="">https://pastebin.freeswitch.org/view/a3d64c69</a> It is pretty short.</div><div class=""><br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>