-
Notifications
You must be signed in to change notification settings - Fork 189
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
Loss of frames with pjsip #27
Comments
The buffer size for aplay (works) fine:
And for pjsua:
HW buffer is different for the same hardware. |
Are you sure, that the frame_size is calculated as 16 bytes? Because it seems ridiculously wrong. It should be 2 bytes for mono and 4 bytes for stereo. If however it is calculated as 16 bytes, then it might a cause of trouble.
Actually this issue might be performance related. But the bottleneck in not a CPU, but an overall bluealsa performance/timing. The problem might be too small period. I've tried to set the minimum requirement for period size to 1024 bytes, but it is not respected... I remember that I've seen such an interruption in the audio by myself, but I can't remember with which application. I'd like to reproduce this issue with the pjsua, however I don't know how to set it up :D - I've got no (zero, null, zilch) experience with VoIP. Could you give me a hint how to setup pjsua. Some "howto" article, or simple configuration. I was able to compile pjproject and that's all :). |
Sorry, forgot divided into 8 (snd_pcm_format_physical_width(io->format) = 16, io->channels = 1). So it 2 bytes. But changing this variable affects the sound interruption. Ok, to reproduce this issue need to install VoIP server and compile pjproject. I use AsteriskNOW Linux distro with Asterisk 11. It is free and based on Cent OS. Install on the any virtual machine (use free Oracle VM VirtualBox). When it's done, FreePBX web interface will available by address (change to own IP address). It is need to add 2 users (Applications -> Extensions -> Add an Extension -> Generic CHAN SIP Device, set any value for User Extension field (for example 600), Display Name (for example User 600) and password in the Secret field (for example ab1234), press Submit and then Apply Config at the top of the page). When configure the network in Settings -> Asterisk SIP Settings tab (in Local Networks field, press Submit and Apply Settings). The VoIP SIP server is ready. :-) Then compile the PJSIP (I try 2.4.5, 2.5.5 and 2.6 versions).
To run PJSUA just run the command ./pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu after successful compilation. When select _ (+a) Add new accnt_:
Just change credentials to own. Repeat that on the second PC (add the second account):
And make the call from first PC to the second:
To answer the call, press a hot button and send 200 reply code on the second PC. With bluez-alsa this issue reproduced, with pulseaudio no any problems. :-) |
Did you manage to find out anything? Be may need my help? |
Unfortunately not yet. When something pops out, or I will need some
assistance, I will write immediately :)
|
Hello! Are there any news? |
Hi! I'm constantly working on it, and it seems, that it is a little bit harder than I thought. There is no much info on the net about the ALSA PCM I/O plugin architecture.... I'm making some progress, though :] However, it might take another week or two. |
Hi. If you're still using bluez-alsa try fresh master snapshot. I think, that finally I've made things right (commit ca72c1e). I wasn't able to test it with the PJSIP (I have failed to set it up right....), though. |
Of course, I like bluez-alsa and still using it. Thank you very much for the fix! I will check it within a week. |
Thanks in advance! No any problems with PJSIP with the latest master snapshot. |
That's great! 🎉 |
Hello and TIA for good work!
I try to use pjsua (SIP application) from pjsip library with latest version of bluez-alsa (SCO profile).
The sound always interrupt, the conversation example here. I have some suspicions with incorrect buffer length of the buffer or drop the buffer before it finish.
The CPU load for pjsua is about 10% and 5% for bluez-alsa. So the problem is not performance.
aplay works fine on the same system with bluez-alsa, pjsua also works fine on the same system with PulseAudio.
How to debug and fix this error?
If to set pcm->frame_size to 15 bytes (calculated as 16) in bluealsa_hw_params function, the sound is almost continuous, but cracks appear.
The text was updated successfully, but these errors were encountered: