From 99bffc67fcc489e9ce2418a2f0fbc346363dc105 Mon Sep 17 00:00:00 2001 From: Rajat Date: Wed, 22 Jul 2026 11:00:21 -0400 Subject: [PATCH 1/5] Test - do not merge --- AampConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AampConfig.cpp b/AampConfig.cpp index 0ff321274e..7004a3f3dd 100644 --- a/AampConfig.cpp +++ b/AampConfig.cpp @@ -368,7 +368,7 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] {false, "enableIFrameTrackExtract", eAAMPConfig_EnableIFrameTrackExtract, true}, {false, "forceMultiPeriodDiscontinuity", eAAMPConfig_ForceMultiPeriodDiscontinuity, false}, {false, "forceLLDFlow", eAAMPConfig_ForceLLDFlow, false}, - {false, "monitorAV", eAAMPConfig_MonitorAV, true}, + {true, "monitorAV", eAAMPConfig_MonitorAV, true}, {false, "enablePTSRestampForHlsTs", eAAMPConfig_HlsTsEnablePTSReStamp, true}, {true, "overrideMediaHeaderDuration", eAAMPConfig_OverrideMediaHeaderDuration, true}, {false, "useMp4Demux", eAAMPConfig_UseMp4Demux,false }, @@ -379,7 +379,7 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] {true, "utcSyncOnStartup", eAAMPConfig_UTCSyncOnStartup, true}, {false, "disableWebVTT", eAAMPConfig_DisableWebVTT, false}, {false, "enablePTSReStampLogging", eAAMPConfig_EnablePTSReStampLogging, false}, - {false, "netTraceCsvDump", eAAMPConfig_NetTraceCsvDump, false}, + {true, "netTraceCsvDump", eAAMPConfig_NetTraceCsvDump, false}, {false, "logFilename", eAAMPConfig_LogFilename, false}, {false, "monitorMp4Integrity", eAAMPConfig_MonitorMp4Integrity, false}, {false, "processLicenseFromEAP", eAAMPConfig_ProcessLicenseFromEAP, false}, From e63e8da9030baeb00b0afb17ec80fe08599482fa Mon Sep 17 00:00:00 2001 From: Rajat Date: Thu, 23 Jul 2026 11:26:29 -0400 Subject: [PATCH 2/5] csv storage location changed --- AampConfig.h | 2 +- CONFIGURATION.md | 2 +- priv_aamp.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AampConfig.h b/AampConfig.h index 23ba53ad50..428f036faf 100644 --- a/AampConfig.h +++ b/AampConfig.h @@ -231,7 +231,7 @@ typedef enum eAAMPConfig_UTCSyncOnStartup, /**< Perform sync at startup */ eAAMPConfig_DisableWebVTT, /**< Config to disable/exclude WebVTT tracks (default: WebVTT enabled) */ eAAMPConfig_EnablePTSReStampLogging, /**< Config to enable logging for PTS restamping in Mp4Demuxer */ - eAAMPConfig_NetTraceCsvDump, /**< Write AAMP_NET_TRACE CSV files when true (default path: /tmp; may be overridden via AAMP_REQ_CSV/AAMP_BUR_CSV; output includes a PID suffix; default: false) */ + eAAMPConfig_NetTraceCsvDump, /**< Write AAMP_NET_TRACE CSV files when true (default path: /opt/logs; may be overridden via AAMP_REQ_CSV/AAMP_BUR_CSV; output includes a PID suffix; default: false) */ eAAMPConfig_LogFilename, /**< Config to include source filename in log output */ eAAMPConfig_MonitorMp4Integrity, /**< Parse every downloaded video/audio segment with Mp4Demux; log each segment, write corrupt ones to harvestPath */ eAAMPConfig_ProcessLicenseFromEAP, /**< Config to enable non-VSS early available period DRM prefetch */ diff --git a/CONFIGURATION.md b/CONFIGURATION.md index a71a9efddb..6ea29606b1 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -248,7 +248,7 @@ Network timeout configurations control how long AAMP waits for various network o | `useWesterosSink` | Boolean | false | Use Westeros sink for video decoding | | `useNewAdBreaker` | Boolean | false | Use new discontinuity processing based on PDT | | `useRetuneForUnpairedDiscontinuity` | Boolean | true | Retune on unpaired discontinuity | -| `netTraceCsvDump` | Boolean | false | Write per-download AAMP network trace CSV files to `/tmp` by default, typically using PID-suffixed filenames such as `/tmp/aamp_net_requests.csv.` and `/tmp/aamp_net_bursts.csv.`; environment overrides may change the final paths. | +| `netTraceCsvDump` | Boolean | false | Write per-download AAMP network trace CSV files to `/opt/logs` by default, typically using PID-suffixed filenames such as `/opt/logs/aamp_net_requests.csv.` and `/opt/logs/aamp_net_bursts.csv.`; environment overrides may change the final paths. | ## Best Practices diff --git a/priv_aamp.cpp b/priv_aamp.cpp index c590a3d1c6..d042d3729e 100644 --- a/priv_aamp.cpp +++ b/priv_aamp.cpp @@ -4474,7 +4474,7 @@ bool PrivateInstanceAAMP::GetFile( std::string remoteUrl, AampMediaType mediaTyp } else if (netTracerEnabled) { aamptrace::NetTrace::SetPathsWithPid( - "/tmp/aamp_net_requests.csv", "/tmp/aamp_net_bursts.csv"); + "/opt/logs/aamp_net_requests.csv", "/opt/logs/aamp_net_bursts.csv"); paths_set.store(true, std::memory_order_release); } // Neither condition: retry next download until config is true From 986a0c3da623991ef626bce5d930e251f942bf74 Mon Sep 17 00:00:00 2001 From: Rajat Date: Thu, 23 Jul 2026 13:06:37 -0400 Subject: [PATCH 3/5] csv storage location changed --- net_trace.h | 15 +++++++++++++-- priv_aamp.cpp | 6 ++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/net_trace.h b/net_trace.h index 5a43da95fd..d70457b33b 100644 --- a/net_trace.h +++ b/net_trace.h @@ -27,6 +27,9 @@ #include #include #include +#include // fprintf, stderr +#include // errno +#include // strerror #if defined(__unix__) || defined(__APPLE__) #include // getpid() #endif @@ -384,11 +387,19 @@ class NetTrace { auto& state = GetFileState(); std::call_once(state.openOnce, [&state]() { state.req_ofs.open(state.req_path, std::ios::app); - if (state.req_ofs.tellp() == 0) { + if (!state.req_ofs.is_open()) { + fprintf(stderr, "[NetTrace] failed to open requests CSV '%s': %s\n", + state.req_path.c_str(), strerror(errno)); + } + else if (state.req_ofs.tellp() == 0) { state.req_ofs << "req_id,when_start_s,url_path,media_type,bytes_total,http_code,conn_reused,primary_ip,local_port,ttfb_s,total_s,namelookup_s,connect_s,appconnect_s,pretransfer_s,redirect_s,chunked,gap_time_s,burst_time_s,burst_count,late_gap_count,avg_burst_rate_Bps\n"; } state.burst_ofs.open(state.burst_path, std::ios::app); - if (state.burst_ofs.tellp() == 0) { + if (!state.burst_ofs.is_open()) { + fprintf(stderr, "[NetTrace] failed to open bursts CSV '%s': %s\n", + state.burst_path.c_str(), strerror(errno)); + } + else if (state.burst_ofs.tellp() == 0) { state.burst_ofs << "req_id,burst_idx,t_start_s,duration_s,bytes,gap_before_s,class\n"; } }); diff --git a/priv_aamp.cpp b/priv_aamp.cpp index d042d3729e..dce4eb65cd 100644 --- a/priv_aamp.cpp +++ b/priv_aamp.cpp @@ -8607,11 +8607,13 @@ void PrivateInstanceAAMP::Stop( bool sendStateChangeEvent ) mProgressReportOffset = -1; mProgressReportAvailabilityOffset = -1; rate = 1; - // Generate persona JSON from accumulated NetTrace data before going idle + // Generate persona JSON from accumulated NetTrace data before going idle. + // Write alongside the NetTrace CSV files in /opt/logs (PID suffix added by + // GeneratePersonaJson), rather than the header default of /tmp. if (GETCONFIGVALUE_PRIV(eAAMPConfig_NetTraceCsvDump)) { aamptrace::NetPersonaFitter::GetInstance().GeneratePersonaJson( - aamptrace::NetPersonaFitter::kDefaultBasePath); + "/opt/logs/aamp_net_persona.json"); } // Set state to IDLE irrespective of sending state change event or not SetState(eSTATE_IDLE, sendStateChangeEvent); From 1d08368f2017ce206b6211f55e563c4f5651f339 Mon Sep 17 00:00:00 2001 From: Rajat Date: Wed, 5 Aug 2026 14:09:39 -0400 Subject: [PATCH 4/5] Config overrides added for DE custom builds --- AampConfig.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AampConfig.cpp b/AampConfig.cpp index 7004a3f3dd..a1ae6f95f8 100644 --- a/AampConfig.cpp +++ b/AampConfig.cpp @@ -243,7 +243,7 @@ static const ConfigLookupEntryString mConfigLookupTableString[AAMPCONFIG_STRING_ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] = { {true,"abr",eAAMPConfig_EnableABR,false}, - {true,"fog",eAAMPConfig_Fog,false}, + {false,"fog",eAAMPConfig_Fog,false}, {false,"preFetchIframePlaylist",eAAMPConfig_PrefetchIFramePlaylistDL,false}, {false,"throttle",eAAMPConfig_Throttle,false}, {false,"demuxAudioBeforeVideo",eAAMPConfig_DemuxAudioBeforeVideo,false}, @@ -278,7 +278,7 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] {false,"appSrcForProgressivePlayback",eAAMPConfig_UseAppSrcForProgressivePlayback,false}, {false,"descriptiveAudioTrack",eAAMPConfig_DescriptiveAudioTrack,false}, {true,"reportBufferEvent",eAAMPConfig_ReportBufferEvent,false}, - {false,"info",eAAMPConfig_InfoLogging,true}, + {true,"info",eAAMPConfig_InfoLogging,true}, {false,"debug",eAAMPConfig_DebugLogging,false}, {false,"trace",eAAMPConfig_TraceLogging,false}, {true,"warn",eAAMPConfig_WarnLogging,false}, @@ -364,7 +364,7 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] {false, "seamlessAudioSwitch", eAAMPConfig_SeamlessAudioSwitch, true}, {false, "useRialtoSink", eAAMPConfig_useRialtoSink, false}, {false, "useDirectRialto", eAAMPConfig_useDirectRialto, false}, - {false, "localTSBEnabled", eAAMPConfig_LocalTSBEnabled, true}, + {true, "localTSBEnabled", eAAMPConfig_LocalTSBEnabled, true}, {false, "enableIFrameTrackExtract", eAAMPConfig_EnableIFrameTrackExtract, true}, {false, "forceMultiPeriodDiscontinuity", eAAMPConfig_ForceMultiPeriodDiscontinuity, false}, {false, "forceLLDFlow", eAAMPConfig_ForceLLDFlow, false}, From 808243d73f430d384cf5b5eb89fde0cd0d9310f0 Mon Sep 17 00:00:00 2001 From: Rajat Date: Wed, 5 Aug 2026 14:23:48 -0400 Subject: [PATCH 5/5] Config overrides added for DE custom builds --- AampConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AampConfig.cpp b/AampConfig.cpp index a1ae6f95f8..862619c3f4 100644 --- a/AampConfig.cpp +++ b/AampConfig.cpp @@ -284,7 +284,7 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] {true,"warn",eAAMPConfig_WarnLogging,false}, {false,"failover",eAAMPConfig_FailoverLogging,false}, {false,"gst",eAAMPConfig_GSTLogging,false}, - {false,"progress",eAAMPConfig_ProgressLogging,false}, + {true,"progress",eAAMPConfig_ProgressLogging,false}, {false,"curl",eAAMPConfig_CurlLogging,false}, {false,"curlLicense",eAAMPConfig_CurlLicenseLogging,false}, {false,"logMetadata",eAAMPConfig_MetadataLogging,false},