-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPUS codec with custom 16khz sampling returns error. #24
Comments
Nevertheless as of today, to leverage Wait a minute. Looking at your SIP debug, you do not allow Opus Codec at all. Was that the correct log file? Please double-check because I am very curious: The SIP/SDP codec negotiation should succeed whatever |
I am looking at testing Asterisk/Opus with narrow-band config for voice. I can see default_opus_attr as you mention in Asterisk 13.7 but I can see also there is code for parsing parameters too. In any case, I am going between two instances of 13.7. Assuming I want to drop the bit rate to 10k, then do I just have to set .maxbitrate to 10000? Thanks. |
Yes, the module parses the negotiation of SDP. However, that struct contains the initial offer made by Asterisk. Consequently yes, when you change However, if you need a fixed upper limit for sure, consider to go for AMR(-WB) instead, for example via my AMR module. That provides even wideband (HD Voice) at your desired bitrate. If you have a large deployment, you may consider to sponsor a EVS module. |
Hi Traud, I'm trying to achieve a Asterisk server to server communication and codec used is opus. It's the correct log file. |
Thanks Traud, I will give that a try. I mention the version I am using as I am too well trained not to! I am building for Yocto, which is another layer of complication (meta-telephony on github) so I have to get each version of Asterisk working with that too. |
Avin, that log states ctrob67, yes Asterisk 13.7 is fine. You need at least Asterisk 13.7 for negotiation/honoring of SDP. Looking forward to read your results, even if they are just personal experience. |
I made the changes and they are reflected in the SDP offering, but it didn't have the desired effect and a 48k option was still taken. I think there is still more to do, the rtp payload (type 107) was 100 bytes: |
Alex, I already added
|
ctrob67, how do you know, it fell back to 48000? With Opus, one cannot defer from the RTP payload size about the average Bit-Rate or Playback-Rate, because Opus is a variable bitrate codec. One cannot set an exact upper bound on it, like one is used from other audio codecs. This is explained in a paper from the conference InterSpeech 2011, chapter 4.1 (who refer to their own paper released previously at InterSpeech 2010). They claim a steady rate after about 30 seconds. These papers do not draw the full picture, because you can tweak the underlying SiLK 8000 via many compile-time settings. By the way, if you are interested in just Opus @ 8000 MHz, double-check via Digium’s or my SiLK module. Long story short: Did you add a Avin, if you want to use Speex on the phone leg for sure, you have to |
I wasn't saying it fell back to 48k more a query about why the selected 107 was described as opus/48000/2. |
Didn't see any pertinent configuration options for libopus but I made a call in the opposite direction and the higher data rate is coming from the call initiator and not from one particular end or the other. Does this shed any light? |
Opus is declared this way, always. This is because each configuration has to be compatible with each other configuration. Furthermore, instead of creating several rtpmaps (which are limited in amount with some SIP/SDP implementations) fmtp declare just a preference. This was a lesson learned from AMR and SiLK… When it comes to your different implementations, I would rather ask such questions on the Opus-Codec mailing list. If I understand you correctly, the Asterisk codec module works correctly, at least with one implementation. Anyway, three thoughts: (1) Did you double-check the version of those Opus libraries? (2) Furthermore, there is a complexity parameter which might be different for those implementations. (3) Finally, did you try without changing the Bit-Rate but just the Playback-Rate? |
Thanks, Traud. |
Sounds like a bug somewhere. Please, add some |
I checked the bytes in wireshark (what else) and it is just a difference in decoding the same thing. When receiving the call: So on transmit attr is null and the hardwired defaults are used. More interestingly, pvt->explicit_dst is not null and so ast_format_get_attribute_data() must be returning null, which means pvt->explcit_dst->attribute_data is null. Hope this helps. |
You isolated a bug. The constants in |
I've tried that already and it does work. I thought it might be a case where it needs to use the default settings from res_format_attr_opus.c but wan't sure how that should be propagated. Thanks for this. I can see how the codec is further configured based on these parameters. Digressing, I see there is code for PLC in the opus plugin. I followed the README and only applied asterisk.patch. There is also enable_native_plc.patch - is this patch required as well for PLC? |
Yes, that patch is required to leverage Native PLC of the Opus Codec in Asterisk. For more details, please, see ASTERISK-25629… |
Thanks again. I am sorted now but will test further commits if able. |
Although the configuration file codecs.conf is not supported, you can change the internal defaults of Asterisk. Previously, you had to change both, res/res_format_attr_opus.c:default_opus_attr and ./codecs/codec_opus.c:opus_encoder_construct. Now, you change the internal defaults in include/asterisk/opus.h. For example, when you change CODEC_OPUS_DEFAULT_MAX_PLAYBACK_RATE from 48000 to 16000, Asterisk does not use Fullband anymore but is limited to Wideband. That reduces the bitrate automatically. resolves seanbright#24
ctrob67, thank you again for your feedback. I changed the code at traud/asterisk-opus, so you have to change only one file Avin, do you still face your issue? If so, please, have a look at my last comment. If something was unclear, please, ask. I would like to get this issue here resolved. |
Testing the Opus codec for Asterisk, working fine with default sampling 48khz.
The default sampling is fixed at 48khz and is there any option to use 16khz
Tried to customize the codec from codecs.conf
Asterisk returns error:
"No audio format found to offer"
Sip Debug: opus16-sipDebug.txt
Thank you!
The text was updated successfully, but these errors were encountered: