Discussion:
AGC and signal level
Marcin 'Malcom' Malich
2008-07-21 14:59:45 UTC
Permalink
Witam!

IMHO after setting signal level to a certain amount, the signal coming
out should have the same level independently of hardware/system
config, yet unfortunately it isn't so, in some cases.

I tried analyzing AGC used by pjmedia (conference.c) but I can't quite
understand the idea of its function.
Could someone explain how the AGC used by the library works?
--
Pozdrowienia,
Marcin 'Malcom' Malich
***@malcom.pl
http://malcom.pl
Benny Prijono
2008-07-22 12:56:58 UTC
Permalink
Post by Marcin 'Malcom' Malich
Witam!
IMHO after setting signal level to a certain amount, the signal coming
out should have the same level independently of hardware/system
config, yet unfortunately it isn't so, in some cases.
Sorry for the late reply. And sorry I don't quite get what you mean, can you
explain more?
Post by Marcin 'Malcom' Malich
I tried analyzing AGC used by pjmedia (conference.c) but I can't quite
understand the idea of its function.
Could someone explain how the AGC used by the library works?
The AGC in conference.c is used to smoothen the mixing factors when we mix
the output from more than one sources to avoid non-aligned samples between
frames, and it's not AGC in a real sense. And more over this has been
deprecated since 0.9 as we have replaced the mixing algorithm with a new,
better one (http://trac.pjsip.org/repos/ticket/449).

Cheers
Benny
Marcin 'Malcom' Malich
2008-07-23 09:55:00 UTC
Permalink
Witam!
Post by Benny Prijono
Sorry for the late reply. And sorry I don't quite get what you mean, can you
explain more?
I thought that it was typical AGC which would monitor the signal
written to the conference bridge port and maintain stable level set by
pjsua_conf_adjust_tx_level.
Unfortunately, on various computers/sound devices voice is too quiet or too loud.
Post by Benny Prijono
The AGC in conference.c is used to smoothen the mixing factors when we mix
the output from more than one sources to avoid non-aligned samples between
frames, and it's not AGC in a real sense. And more over this has been
deprecated since 0.9 as we have replaced the mixing algorithm with a new,
better one (http://trac.pjsip.org/repos/ticket/449).
Do you plan to implement a typical AGC?
How in simple manner can I connect an external soft which would act as
AGC to pjmedia?
--
Pozdrowienia,
Marcin 'Malcom' Malich
***@malcom.pl
http://malcom.pl
Benny Prijono
2008-07-23 10:32:24 UTC
Permalink
Post by Marcin 'Malcom' Malich
Witam!
Post by Benny Prijono
Sorry for the late reply. And sorry I don't quite get what you mean, can
you
Post by Benny Prijono
explain more?
I thought that it was typical AGC which would monitor the signal
written to the conference bridge port and maintain stable level set by
pjsua_conf_adjust_tx_level.
Ah, ok. No we don't do that now.
Post by Marcin 'Malcom' Malich
Unfortunately, on various computers/sound devices voice is too quiet or too loud.
Post by Benny Prijono
The AGC in conference.c is used to smoothen the mixing factors when we
mix
Post by Benny Prijono
the output from more than one sources to avoid non-aligned samples
between
Post by Benny Prijono
frames, and it's not AGC in a real sense. And more over this has been
deprecated since 0.9 as we have replaced the mixing algorithm with a new,
better one (http://trac.pjsip.org/repos/ticket/449).
Do you plan to implement a typical AGC?
It will be nice, but probably not anytime soon. We've had this ticket in
Unassigned status for long time, but haven't had time to implement it yet:
http://trac.pjsip.org/repos/ticket/173
Post by Marcin 'Malcom' Malich
How in simple manner can I connect an external soft which would act as
AGC to pjmedia?
Speex has AGC preprocessor, so ideally we could implement this as a
pass-throgh pjmedia_port to do AGC (similar to how resample port let the
audio passes while changing the sampling rate). Then we can just plug this
media port anywhere we want AGC.

Cheers
Benny
Marcin 'Malcom' Malich
2008-08-08 15:29:55 UTC
Permalink
Witam!

I implemented AGC functionality for pjmedia based on AGC speex
preprocessor and resample code, but adjustment on sample (agcplay.c)
is not work well. I don't know why, maybe I forgot something,
so can somebody help me? ;)
I written small patch - first review ;)
I attached here my patch, because I can't add it on pjsip track.
--
Pozdrowienia,
Marcin 'Malcom' Malich
***@malcom.pl
http://malcom.pl
Marcin 'Malcom' Malich
2008-08-20 08:11:41 UTC
Permalink
Witam!
Post by Marcin 'Malcom' Malich
I implemented AGC functionality for pjmedia based on AGC speex
preprocessor and resample code, but adjustment on sample (agcplay.c)
is not work well. I don't know why, maybe I forgot something,
so can somebody help me? ;)
I written small patch - first review ;)
I attached here my patch, because I can't add it on pjsip track.
Any ideas about this problem?
--
Pozdrowienia,
Marcin 'Malcom' Malich
***@malcom.pl
http://malcom.pl
Benny Prijono
2008-08-20 09:32:59 UTC
Permalink
Post by Marcin 'Malcom' Malich
Witam!
Post by Marcin 'Malcom' Malich
I implemented AGC functionality for pjmedia based on AGC speex
preprocessor and resample code, but adjustment on sample (agcplay.c)
is not work well. I don't know why, maybe I forgot something,
so can somebody help me? ;)
I written small patch - first review ;)
I attached here my patch, because I can't add it on pjsip track.
Any ideas about this problem?
Frankly I haven't had time to check this, sorry. But looking at glance to
your code it looks okay. Perhaps it's the way Speex preprocessor works, or
something else needs to be set? Sorry can't help you much here.

-benny
Marcin 'Malcom' Malich
2008-09-16 13:32:37 UTC
Permalink
Witam!

I updated the agc patch. It looks to be working well,
but I don't know where is a good place to insert/connect
the agc port into pjmedia, pjsua.
Any ideas and suggestions?
--
Pozdrowienia,
Marcin 'Malcom' Malich
***@malcom.pl
http://malcom.pl
Loading...