Alsa_dev C Pb_thread_func Underrun
Post by Swinney C. Hi All, Is anyone aware of a way to get PJSIP to work on the Raspberry Pi so that it might just use the 3.5mm audio out? We have no need to take a mic input and so just are looking to have PJSIP as a dumb client accepting an inbound call and outputting the incoming audio stream via the 3.5 mm audio socket. Tschedbuffersize and tschedbufferwatermark were the settings that made it work for me. I run my PulseAudio as a system instance, so the config is in /etc/pulse/system.pa.If you are using a session instance instead, then the config will be in /etc/pulse/default.pa. This is the default. Buffer underrun means the buffer is getting empty, not full. A larger buffer would tend to either not affect the symptoms, or maybe even make it worse. – twalberg Jan 30 '13 at 16:31 add a comment. We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand. Underrun(underflow) In computing, buffer underrun or buffer underflow is a state occurring when a buffer used to communicate between two devices or processes is fed with data at a lower speed than the data is being read from it. This requires the program or device reading from the buffer to pause its processing while the buffer refills.
These are the steps I used to get PJSIP running on a Raspberry Pi 3 with audio and video. Strap in.
Flash an SD Card with Raspian Stretch. I used the latest at the time of this writing (2018-03-13-raspian-stretch):Download Raspian Stretch
- Log in as user pi and update:
Run the raspi-config utility and set timezone, local, keyboard, ssh, expand filesystem, etc. Most importantly, enable the camera.
Reboot
Test the camera:
- Build and install SDL. I used 2-2.0.8 (latest at time of writing)
- Build and Install OpenH264
- Install libfaac, libmp3lame, libvorbis, other (non-free) codecs:
Add the following line to the /etc/apt/sources.list
file:
Now install the packages:
- Build and Install FFMPEG (3.4.2 at the time of this writing). You are going to want to go out and climb a tree, read a book, or drink a few cups of coffee at this point.
- Build and install PJSIP (2.7.2 release at the time of this writing)
Create a new file called pjlib/include/pj/config_site.h
with the following contents:
Create a file called 'user.mak' in the root of the pjsip source directory:
with the following contents (note: these are specific to the RPI3)
There is a bug in the build script that you must correct, as the system tries to compile sse2 support which is not available on the RPI. Edit the 'third-party/build/os-auto.mak.in':
Copy over the following block (note the comments, which force the build system to skip sse2):
Now make PJSIP:
Note: I had a compile error during make dep, probably due to the fact that I was missing dependencies and went back and added some additional packages. If you are following these instructions, you should be ok. However, if you have errors, try the following:
Alsa_dev C Pb_thread_func Underrun Form
Now you can find the index of your audio and video devices by executing some sample apps.Find the index of your audio out and in devices
Best auto tune settings for baritone. Test your video codecs:
Create a configuration file to specify params for the pjsua cli application
Contents of file:
Note: I have a USB soundcard device, which shows up as pjsip index 8 in the auddemo app mentioned above. This is the soundcard I am using to interface with a set of speakers and a microphone:
Alsa_dev C Pb_thread_func Underrun Service
Thats it! You should be able to make audio calls as well as video calls. Enjoy!
- $ ./scream-ivshmem-alsa /dev/shm/scream-ivshmem -v
- Its setup is:
- access : RW_INTERLEAVED
- subformat : STD
- rate : 44100
- msbits : 16
- period_size : 551
- tstamp_mode : NONE
- period_step : 1
- period_event : 0
- stop_threshold : 2205
- silence_size : 0
- Channel 0 mapped to Front Left
- ALSA <-> PulseAudio PCM I/O Plugin
- stream : PLAYBACK
- format : S16_LE
- channels : 2
- exact rate : 48000 (48000/1)
- buffer_size : 2400
- period_time : 12500
- tstamp_type : GETTIMEOFDAY
- avail_min : 600
- start_threshold : 2400
- silence_threshold: 0
- boundary : 5404319552844595200
- Switched format to sample rate 48000, sample size 16 and 2 channels.
- ALSA lib pcm.c:8432:(snd_pcm_recover) underrun occurred
- ALSA lib pcm.c:8432:(snd_pcm_recover) underrun occurred
- ALSA lib pcm.c:8432:(snd_pcm_recover) underrun occurred
- ALSA lib pcm.c:8432:(snd_pcm_recover) underrun occurred
- ALSA lib pcm.c:8432:(snd_pcm_recover) underrun occurred