From e5770670a865f6a4f85245c7f895acb03f295e26 Mon Sep 17 00:00:00 2001 From: ronag Date: Sat, 5 Nov 2011 14:42:02 +0000 Subject: [PATCH] 2.0.2: Improved log messages. In particular regarding GPU stall warning. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1537 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- common/log/log.cpp | 20 ++++++++++---------- core/mixer/gpu/fence.cpp | 16 ++++++++++++++-- modules/ffmpeg/producer/input.cpp | 6 +++--- protocol/amcp/AMCPProtocolStrategy.cpp | 2 +- shell/main.cpp | 2 ++ 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/common/log/log.cpp b/common/log/log.cpp index 802eb9349..3446e5c34 100644 --- a/common/log/log.cpp +++ b/common/log/log.cpp @@ -110,11 +110,11 @@ void init() auto stream_sink = boost::make_shared(stream_backend); -#ifdef NDEBUG - stream_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= trace); -#else - stream_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= trace); -#endif +//#ifdef NDEBUG +// stream_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= debug); +//#else +// stream_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= debug); +//#endif stream_sink->locked_backend()->set_formatter(&my_formatter); @@ -143,11 +143,11 @@ void add_file_sink(const std::wstring& folder) file_sink->locked_backend()->set_formatter(&my_formatter); -#ifdef NDEBUG - file_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= trace); -#else - file_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= trace); -#endif +//#ifdef NDEBUG +// file_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= debug); +//#else +// file_sink->set_filter(boost::log::filters::attr(boost::log::sources::aux::severity_attribute_name::get()) >= debug); +//#endif boost::log::wcore::get()->add_sink(file_sink); CASPAR_LOG(info) << L"Logging [info] or higher severity to " << folder << std::endl << std::endl; diff --git a/core/mixer/gpu/fence.cpp b/core/mixer/gpu/fence.cpp index 41e2d4cb1..5de2a5894 100644 --- a/core/mixer/gpu/fence.cpp +++ b/core/mixer/gpu/fence.cpp @@ -48,8 +48,20 @@ struct fence::implementation } } - if(delay > 0) - CASPAR_LOG(debug) << L"[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << L" ms."; + static tbb::atomic warned; + + if(delay > 2) + { + if(!warned.fetch_and_store(true)) + { + CASPAR_LOG(warning) << L"[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << L" ms. Further warnings are sent to trace log level." + << L" You can ignore this warning if you do not notice any problems with output video. This warning is caused by insufficent support or performance of your graphics card for OpenGL based memory transfers. " + << L" Please try to update your graphics drivers or update your graphics card, see recommendations on (www.casparcg.com)." + << L" Further help is available at (www.casparcg.com/forum)."; + } + else + CASPAR_LOG(trace) << L"[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << L" ms."; + } } }; diff --git a/modules/ffmpeg/producer/input.cpp b/modules/ffmpeg/producer/input.cpp index c8b32cd4a..ec661bcfa 100644 --- a/modules/ffmpeg/producer/input.cpp +++ b/modules/ffmpeg/producer/input.cpp @@ -217,12 +217,12 @@ private: seek_frame(start_, flags); graph_->add_tag("seek"); - CASPAR_LOG(trace) << print() << " Looping."; + CASPAR_LOG(debug) << print() << " Looping."; } else { is_running_ = false; - CASPAR_LOG(trace) << print() << " Stopping."; + CASPAR_LOG(debug) << print() << " Stopping."; } } else @@ -272,7 +272,7 @@ private: if(ret == AVERROR(EIO)) CASPAR_LOG(trace) << print() << " Received EIO, assuming EOF. " << nb_frames_; if(ret == AVERROR_EOF) - CASPAR_LOG(trace) << print() << " Received EOF. " << nb_frames_; + CASPAR_LOG(debug) << print() << " Received EOF. " << nb_frames_; return ret == AVERROR_EOF || ret == AVERROR(EIO) || frame_number_ >= length_; // av_read_frame doesn't always correctly return AVERROR_EOF; } diff --git a/protocol/amcp/AMCPProtocolStrategy.cpp b/protocol/amcp/AMCPProtocolStrategy.cpp index fdd685875..03b32196f 100644 --- a/protocol/amcp/AMCPProtocolStrategy.cpp +++ b/protocol/amcp/AMCPProtocolStrategy.cpp @@ -168,7 +168,7 @@ AMCPCommandPtr AMCPProtocolStrategy::InterpretCommandString(const std::wstring& AMCPCommandPtr pCommand; MessageParserState state = New; - CASPAR_LOG(trace) << message; + CASPAR_LOG(info) << message; std::size_t tokensInMessage = TokenizeMessage(message, &tokens); diff --git a/shell/main.cpp b/shell/main.cpp index 97c9760b1..4ce3e24de 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -184,6 +184,8 @@ int main(int argc, wchar_t* argv[]) // Install structured exception handler. caspar::win32_exception::install_handler(); + + caspar::log::set_log_level(L"debug"); // Increase time precision. This will increase accuracy of function like Sleep(1) from 10 ms to 1 ms. struct inc_prec -- 2.39.2