Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Limit number of threads in audio session



I am looking for a way to set the number of thread in an audio session .

Currently, I am running my software on a 16 cores machine and it looks like I have 16 (!) threads per audio session which is way too much for my audio input (AAC-LC, 2 channel, 48KHz). I believe that 1 thread (max 2 threads) should be enough for my scenario.

Is there any way to set the number of threads? I didn't find it in the "Reference Manual For Audio Processing".

Thank you


0 Kudos
2 Replies

Hi Koby, 

If you interested in managing threads on a multicore machine, I recommend taking a look Intel TBB: But, please note as Audio is a plugin to Media SDK foundation; using MediaSDK and TBB in parallel could impact overall performance.



0 Kudos

Hi Harsh

Thank you for your response but I don't see how Intel TBB  can help me to reduce the number of threads generated by the Server Studio SDK (and not by my software).

To be more clear, when I call: 

	mfxStatus sts = m_audioSession.Init(MFX_IMPL_AUDIO | MFX_IMPL_SOFTWARE, &version);

I see 16 new threads, and all of them are started from libmfxaudiosw64.dll.

I am looking for a way to limit the number of threads, same way (if possible) as it's done with video session (in sample_multi_transcode for example)

mfxStatus			sts;
mfxInitParam 		initParam;
mfxExtThreadsParam 	threadsParam;
mfxExtBuffer* 		extBufs[1];
bool				needInitExtPar(false);

initPar.Version.Major 	= 1;
initPar.Version.Minor 	= 0;
initPar.GPUCopy 		= 0;
initPar.Implementation 	= pParams->libType;


if (pParams->nThreadsNum) {
	threadsPar.NumThread = pParams->nThreadsNum;
	needInitExtPar = true;

if (needInitExtPar) {
	extBufs[0] = (mfxExtBuffer*)&threadsPar;
	initPar.ExtParam = extBufs;
	initPar.NumExtParam = 1;

m_pmfxSession.reset(new MFXVideoSession);
sts = m_pmfxSession->InitEx(initPar);

Thank you !

0 Kudos