RTP Player: Settings for enabling use of disk as temporarly store

New advanced settings are created:
- rtp_player_use_disk1 - controls if decoded samples are stored in
  memory or on disk.
- rtp_player_use_disk2 - controls if dictionary for decoded samples
is stored in memory or on disk.
- documentation updated
This commit is contained in:
Jirka Novak 2021-04-25 19:32:25 +02:00
parent fd14396972
commit c1084fe97e
6 changed files with 55 additions and 12 deletions

View File

@ -114,15 +114,23 @@ Take into account that heuristics is just simple "test" whether packet can be re
When you enable menu:udp[Try heuristic sub-dissectors first], it increases possibility of false positives. If you capture all traffic in network, false positives rate can be quite high.
====
RTP Player must store decoded data somewhere to be able to play it. When data are decoded, there are audio samples and dictionary for fast navigation. Both types of data are stored in memory for default, but you can configure Wireshark to store it on disk. There are two settings:
* ui.rtp_player_use_disk1 - When set to FALSE (default), audio samples are kept in memory. When set to TRUE, audio samples are stored on temporary file.
* ui.rtp_player_use_disk2 - When set to FALSE (default), dictionary is kept in memory. When set to TRUE, dictionary is stored on temporary file.
When any data are configured to be stored on disk, one file is created for each stream. Therefore there might be up to two files for one RTP stream (audio samples and dictionary). If your OS or user has OS enforced limit for count of opened files (most of Unix/Linux systems), you can see fewer streams that was added to playlist. Warnings are printed on console in this case and you will see fewer streams in the playlist than you send to it from other tools.
For common use you can use default settings - store everything in memory. When you will be out of memory, switch ui.rtp_player_use_disk1 to TRUE first - it saves much more memory than ui.rtp_player_use_disk2.
==== VoIP Processing Performance and Related Limits
Processing of RTP and decoding RTP voice takes resources. There are raw estimates you can use as guidelines...
RTP Streams window can show as many streams as found in the capture. Its performance is limited just by memory and CPU.
RTP Player can handle 1000+ streams, but take into account that waveforms are very small in this case.
RTP Player creates temporary file for decoding of each stream. If your OS or user has OS enforced limit for count of opened files (most of Unix/Linux systems), you can see less streams that was added to playlist. Warnings are printed on console in this case and you will see less streams in the playlist than you send to it from other tools.
RTP Player can handle 1000+ streams, but take into account that waveforms are very small and difficult to recognize in this case.
RTP Player plays audio by OS sound system and OS is responsible for mixing audio when multiple streams are played. In many cases OS sound system has limited count of mixed streams it can play/mix. RTP Player tries to handle playback failures and show warning. If it happens, just mute some streams and start playback again.

View File

@ -3481,6 +3481,26 @@ prefs_register_modules(void)
"Value can be in range 2 to 10.",
10,&prefs.gui_decimal_places3);
prefs_register_bool_preference(gui_module, "rtp_player_use_disk1",
"RTP Player saves temporary data to disk",
"If set to true, RTP Player saves temporary data to "
"temp files on disk. If not set, it uses memory."
"Every stream uses one file therefore you might touch "
"OS limit for count of opened files."
"When ui.rtp_player_use_disk2 is set to true too, it uses "
" two files per RTP stream together."
,&prefs.gui_rtp_player_use_disk1);
prefs_register_bool_preference(gui_module, "rtp_player_use_disk2",
"RTP Player saves temporary dictionary for data to disk",
"If set to true, RTP Player saves temporary dictionary to "
"temp files on disk. If not set, it uses memory."
"Every stream uses one file therefore you might touch "
"OS limit for count of opened files."
"When ui.rtp_player_use_disk1 is set to true too, it uses "
" two files per RTP stream."
,&prefs.gui_rtp_player_use_disk2);
prefs_register_bool_preference(gui_layout_module, "packet_list_show_related",
"Show Related Packets",
@ -3662,8 +3682,6 @@ prefs_register_modules(void)
10,
&prefs.tap_update_interval);
prefs_register_obsolete_preference(stats_module, "rtp_player_max_visible");
prefs_register_bool_preference(stats_module, "st_enable_burstinfo",
"Enable the calculation of burst information",
"If enabled burst rates will be calculated for statistics that use the stats_tree system. "

View File

@ -228,6 +228,8 @@ typedef struct _e_prefs {
gint gui_decimal_places1; /* Used for type 1 calculations */
gint gui_decimal_places2; /* Used for type 2 calculations */
gint gui_decimal_places3; /* Used for type 3 calculations */
gboolean gui_rtp_player_use_disk1;
gboolean gui_rtp_player_use_disk2;
gboolean st_enable_burstinfo;
gboolean st_burst_showcount;
gint st_burst_resolution;

View File

@ -72,7 +72,7 @@ RtpAudioStream::RtpAudioStream(QObject *parent, rtpstream_id_t *id, bool stereo_
try {
// RtpAudioFile is ready for writing Frames
audio_file_ = new RtpAudioFile();
audio_file_ = new RtpAudioFile(prefs.gui_rtp_player_use_disk1, prefs.gui_rtp_player_use_disk2);
} catch (...) {
speex_resampler_destroy(visual_resampler_);
rtpstream_info_free_data(&rtpstream_);

View File

@ -32,28 +32,43 @@
#include "rtp_audio_file.h"
#include <ws_attributes.h>
RtpAudioFile::RtpAudioFile():
RtpAudioFile::RtpAudioFile(bool use_disk_for_temp, bool use_disk_for_frames):
real_pos_(0)
, real_size_(0)
, sample_pos_(0)
, sample_size_(0)
{
QString tempname;
// ReadOnly because we write different way
QIODevice::open(QIODevice::ReadOnly);
QString tempname = QString("%1/wireshark_rtp_stream").arg(QDir::tempPath());
sample_file_ = new QTemporaryFile(tempname, this);
tempname = "memory";
if (use_disk_for_temp) {
tempname = QString("%1/wireshark_rtp_stream").arg(QDir::tempPath());
sample_file_ = new QTemporaryFile(tempname, this);
} else {
sample_file_ = new QBuffer(this);
}
if (!sample_file_->open(QIODevice::ReadWrite)) {
// We are out of file resources
delete sample_file_;
qWarning() << "Can't create temp file in " << tempname;
throw -1;
}
sample_file_frame_ = new QBuffer(this);
tempname = "memory";
if (use_disk_for_frames) {
tempname = QString("%1/wireshark_rtp_frames").arg(QDir::tempPath());
sample_file_frame_ = new QTemporaryFile(tempname, this);
} else {
sample_file_frame_ = new QBuffer(this);
}
if (!sample_file_frame_->open(QIODevice::ReadWrite)) {
// We are out of file resources
delete sample_file_;
delete sample_file_frame_;
qWarning() << "Can't create temp file in memory";
qWarning() << "Can't create frame file in " << tempname;
throw -1;
}
}

View File

@ -47,7 +47,7 @@ class RtpAudioFile: public QIODevice
Q_OBJECT
public:
explicit RtpAudioFile();
explicit RtpAudioFile(bool use_disk_for_temp, bool use_disk_for_frames);
~RtpAudioFile();
// Functions for writing Frames