Skip to content

no sound output, while dialing via mqtt command on embedded arm device #3478

@marcel-behlau-elfin

Description

@marcel-behlau-elfin

Hi,

i'm using baresip within a embedded device. Baresip is running as an application, my frontend application interfaces baresip via MQTT. Both applications are executed on the embedded device. I'm using a mosquitto, which is also executed on the device.

While porting to a new platform (arm device, based on freescale imx6), i'm observing problems. My application sends a dial command and baresip starts the call. But while dialing process, i don't get any dial tone. If i accept the call, there is also no sound (no mic sound, no speaker sound).

If i send the same MQTT command via mosquitto_pub command from, baresip is working fine with sound output. I can also start calls from the baresip CLI frontend, or executing the application on my host (while connecting the broker on the device). For the tests, the same baresip instance is used/baresip was never restarted. If i switch back to the application on the device, the problem is still there. So i assume, baresip is not in some strange state and the problem must be related to the specific MQTT message from the application.

This setup is stable and can be reproduced every time on the device. I already analyses the MQTT packages via tcpdump, but don't see any difference. See pictures.

On the same platform i also observed a problem, while running baresip within a Boost::Process::Child. While performing the call, baresip exited with error code 7, caused by SIGBUS signal.

Unfortunately i cannot reproduce this on my host device. Does somebody have an idea, what could be the reason for this behaviour?

I'm using the current v4.0.0 release and also on an older release.

Thank you very much in advance and best regards,

Marcel

Working Frame:

Image

Broken Frame:

Image

Baresip log with working sound:

mqtt: got message '{"command" : "dial", "params" : "192.168.2.47", "token" : "dial" }' for topic '/baresip/01/command/c'
mqtt: got message for '/baresip/01/command/c' topic
mqtt: handle_command:  cmd='dial', token='dial'
@127.0.0.1: selected for request
call: alloc with params laddr=192.168.2.41, af=AF_INET, use_rtp=1
call: use_video=0
call: connecting to 'sip:192.168.2.47'..
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
alsa: reset: srate=8000, ch=1, num_frames=320, pcmfmt=S16_LE
alsa: playback started (sysdefault:CARD=imx6qapalissgtl)
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: got SDP answer (244 bytes)
@127.0.0.1: Call answered: sip:192.168.2.47
alsa: stopping playback thread (sysdefault:CARD=imx6qapalissgtl)
call: update media
stream: update 'audio'
stream: disable audio RTP receiver
stream: disable audio RTP sender
stream: enable audio RTP receiver
stream: enable audio RTP sender
stream: audio: starting RTCP with remote 192.168.2.47:56597
audio: update
audio_recv: Set audio decoder: PCMU 8000Hz 1ch
alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE
alsa: playback started (sysdefault:CARD=imx6qapalissgtl)
audio_recv: player started with sample format S16LE
audio: Set audio encoder: PCMU 8000Hz 1ch
stream: enable audio RTP receiver
alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE
alsa: recording started (sysdefault:CARD=Device) format=S16LE
audio: source started with sample format S16LE
stream: enable audio RTP sender
audio tx pipeline:        alsa ---> aubuf ---> auconv ---> auresamp ---> mixausrc ---> PCMU
audio rx pipeline:        alsa <--- aubuf <--- auconv <--- auresamp <--- mixausrc <--- PCMU
call: timer started
@127.0.0.1: Call established: sip:192.168.2.47
auresamp: resample encoder 8000/1 --> 8000/1
sip:192.168.2.47: session closed: Connection reset by peer [104]
stream: disable audio RTP sender
alsa: stopping recording thread (sysdefault:CARD=Device)
stream: disable audio RTP receiver
alsa: stopping playback thread (sysdefault:CARD=imx6qapalissgtl)
sip:127.0.0.1: Call with sip:192.168.2.47 terminated (duration: 1 sec)
stream: disable audio RTP sender
stream: disable audio RTP receiver
audio: destroyed (started=0)
stream: disable audio RTP sender
stream: disable audio RTP receiver

Baresip log with broken sound:

mqtt: got message '{"command" : "dial", "params" : "192.168.2.47", "token" : "dial" }' for topic '/baresip/01/command/c'
mqtt: got message for '/baresip/01/command/c' topic
mqtt: handle_command:  cmd='dial', token='dial'
@127.0.0.1: selected for request
call: alloc with params laddr=192.168.2.41, af=AF_INET, use_rtp=1
call: use_video=0
call: connecting to 'sip:192.168.2.47'..
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
alsa: reset: srate=8000, ch=1, num_frames=320, pcmfmt=S16_LE
alsa: playback started (sysdefault:CARD=imx6qapalissgtl)
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: SIP Progress: 180 Ringing (/)
stream: disable audio RTP sender
stream: disable audio RTP receiver
call: got SDP answer (244 bytes)
@127.0.0.1: Call answered: sip:192.168.2.47
alsa: stopping playback thread (sysdefault:CARD=imx6qapalissgtl)
call: update media
stream: update 'audio'
stream: disable audio RTP receiver
stream: disable audio RTP sender
stream: enable audio RTP receiver
stream: enable audio RTP sender
stream: audio: starting RTCP with remote 192.168.2.47:57131
audio: update
audio_recv: Set audio decoder: PCMU 8000Hz 1ch
alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE
alsa: playback started (sysdefault:CARD=imx6qapalissgtl)
audio_recv: player started with sample format S16LE
audio: Set audio encoder: PCMU 8000Hz 1ch
stream: enable audio RTP receiver
alsa: reset: srate=8000, ch=1, num_frames=160, pcmfmt=S16_LE
alsa: recording started (sysdefault:CARD=Device) format=S16LE
audio: source started with sample format S16LE
stream: enable audio RTP sender
audio tx pipeline:        alsa ---> aubuf ---> auconv ---> auresamp ---> mixausrc ---> PCMU
audio rx pipeline:        alsa <--- aubuf <--- auconv <--- auresamp <--- mixausrc <--- PCMU
call: timer started
@127.0.0.1: Call established: sip:192.168.2.47
auresamp: resample encoder 8000/1 --> 8000/1
rtprecv: incoming rtp for 'audio' established, receiving from 192.168.2.47:57130
sip:192.168.2.47: session closed: Connection reset by peer [104]
stream: disable audio RTP sender
alsa: stopping recording thread (sysdefault:CARD=Device)
stream: disable audio RTP receiver
alsa: stopping playback thread (sysdefault:CARD=imx6qapalissgtl)
stream: disable audio RTP sender
stream: disable audio RTP receiver
audio: destroyed (started=0)
stream: disable audio RTP sender
stream: disable audio RTP receiver
mqtt: got message '{
  "command" : "hangup",
  "params" : "",
  "token" : "hangup"
}' for topic '/baresip/01/command/c'
mqtt: got message for '/baresip/01/command/c' topic
mqtt: handle_command:  cmd='hangup', token='hangup'

Used config file:

#
# baresip configuration
#

#------------------------------------------------------------------------------

# SIP
sip_listen		0.0.0.0:5060
sip_cafile		/etc/ssl/certs/ca-certificates.crt
#sip_transports		udp,tcp,tls,ws,wss
#sip_trans_def		udp
#sip_verify_server	yes
sip_tos			160

# Call
call_local_timeout	120
call_max_calls		1
call_hold_other_calls	yes

# Audio
#audio_path		/usr/local/share/baresip
audio_player		alsa,sysdefault:CARD=imx6qapalissgtl
audio_source		alsa,sysdefault:CARD=Device
audio_alert		alsa,sysdefault:CARD=imx6qapalissgtl
#ausrc_srate		48000
#auplay_srate		48000
#ausrc_channels		0
#auplay_channels	0
#audio_txmode		poll		# poll, thread
audio_level		no
ausrc_format		s16		# s16, float, ..
auplay_format		s16		# s16, float, ..
auenc_format		s16		# s16, float, ..
audec_format		s16		# s16, float, ..
audio_buffer		20-160		# ms
audio_buffer_mode	fixed		# fixed, adaptive
audio_silence		-35.0		# in [dB]
audio_telev_pt		101		# payload type for telephone-event

# Video
#video_source		v4l2,/dev/video0
#video_display		x11,nil
video_size		640x480
video_bitrate		1000000
video_fps		30.00
video_fullscreen	no
videnc_format		yuv420p

# AVT - Audio/Video Transport
rtp_tos			184
rtp_video_tos		136
#rtp_ports		10000-20000
#rtp_bandwidth		512-1024 # [kbit/s]
audio_jitter_buffer_type	fixed		# off, fixed, adaptive
audio_jitter_buffer_delay	5-10		# (min. frames)-(max. packets)
video_jitter_buffer_type	fixed		# off, fixed, adaptive
video_jitter_buffer_delay	5-50		# (min. frames)-(max. packets)
rtp_stats		no
#rtp_timeout		60
#avt_bundle		no

# Network
#dns_server		1.1.1.1:53
#dns_server		1.0.0.1:53
#dns_fallback		8.8.8.8:53
#dns_getaddrinfo		no
#net_interface		eth0

# Play tones
#file_ausrc		aufile
#file_srate		16000
#file_channels		1

#------------------------------------------------------------------------------
# Modules

module_path		/usr/lib/baresip/modules

# UI Modules
module			stdio.so
#module			cons.so
#module			evdev.so
#module			httpd.so

# Audio codec Modules (in order)
#module			opus.so
#module			amr.so
#module			g7221.so
#module			g722.so
#module			g726.so
module			g711.so
#module			l16.so
#module			mpa.so
#module			codec2.so

# Audio filter Modules (in encoding order)
module			auconv.so
module			auresamp.so
#module			vumeter.so
#module			sndfile.so
#module			plc.so
module			mixausrc.so

# Audio driver Modules
module			alsa.so
#module			pulse.so
#module			pipewire.so
#module			jack.so
#module			portaudio.so
#module			aubridge.so
module			aufile.so
#module			ausine.so

# Video codec Modules (in order)
#module			avcodec.so
#module			vp8.so
#module			vp9.so

# Video filter Modules (in encoding order)
#module			selfview.so
#module			snapshot.so
#module			swscale.so
#module			vidinfo.so
#module			avfilter.so

# Video source modules
#module			v4l2.so
#module			vidbridge.so

# Video display modules
#module			directfb.so
#module			x11.so
#module			sdl.so
#module			fakevideo.so

# Audio/Video source modules
#module			avformat.so
#module			gst.so

# Compatibility modules
#module			ebuacip.so
module			uuid.so

# Media NAT modules
module			stun.so
module			turn.so
module			ice.so
#module			natpmp.so
#module			pcp.so

# Media encryption modules
#module			srtp.so
#module			dtls_srtp.so
#module			gzrtp.so


#------------------------------------------------------------------------------
# Application Modules

module_app		account.so
module_app		contact.so
module_app		debug_cmd.so
#module_app		echo.so
#module_app		gtk.so
module_app		menu.so
#module_app		mwi.so
#module_app		presence.so
#module_app		serreg.so
#module_app		syslog.so
module_app		mqtt.so
#module_app		ctrl_tcp.so
#module_app		ctrl_dbus.so
#module_app		httpreq.so
#module_app		multicast.so
module_app		netroam.so


#------------------------------------------------------------------------------
# Module parameters

# DTLS SRTP parameters
#dtls_srtp_use_ec	prime256v1


# UI Modules parameters
cons_listen		0.0.0.0:5555 # cons - Console UI UDP/TCP sockets

http_listen		0.0.0.0:8000 # httpd - HTTP Server

ctrl_tcp_listen		0.0.0.0:4444 # ctrl_tcp - TCP interface JSON

evdev_device		/dev/input/event0

# Opus codec parameters
opus_bitrate		28000 # 6000-510000
#opus_stereo		yes
#opus_sprop_stereo	yes
#opus_cbr		no
#opus_inbandfec		no
#opus_dtx		no
#opus_mirror		no
#opus_complexity	10
#opus_application	audio	# {voip,audio}
#opus_samplerate	48000
#opus_packet_loss	10	# 0-100 percent (expected packet loss)

# Opus Multistream codec parameters
#opus_ms_channels	2	#total channels (2 or 4)
#opus_ms_streams	2	#number of streams
#opus_ms_c_streams	2	#number of coupled streams

vumeter_stderr		yes

#jack_connect_ports	yes

# Selfview
video_selfview		window # {window,pip}
#selfview_size		64x64

# Menu
#redial_attempts	0 # Num or <inf>
#redial_delay		5 # Delay in seconds
#ringback_disabled	no
#statmode_default	off
#menu_clean_number	no
#sip_autoanswer_method	rfc5373 # {rfc5373,call-info,alert-info}
#ring_aufile		ring.wav
#callwaiting_aufile	callwaiting.wav
#ringback_aufile	ringback.wav
#notfound_aufile	notfound.wav
#busy_aufile		busy.wav
#error_aufile		error.wav
#sip_autoanswer_aufile	autoanswer.wav
#menu_max_earlyaudio	32
#menu_max_earlyvideo_rx	32
#menu_max_earlyvideo_tx	32

# GTK
#gtk_clean_number	no

# avcodec
#avcodec_h264enc	libx264
#avcodec_h264dec	h264
#avcodec_h265enc	libx265
#avcodec_h265dec	hevc
#avcodec_hwaccel	vaapi
#avcodec_profile_level_id 42002a
#avcodec_keyint		10

# ctrl_dbus
#ctrl_dbus_use	system		# system, session

# mqtt
mqtt_broker_host	localhost
mqtt_broker_port	1883
#mqtt_broker_cafile	/path/to/broker-ca.crt	# set this to enforce TLS
mqtt_broker_clientid	baresip-libelfinemergencyphone-main
#mqtt_broker_user	user
#mqtt_broker_password	pass
mqtt_basetopic		baresip/01

# sndfile
#snd_path		/tmp

# EBU ACIP
#ebuacip_jb_type	fixed	# auto,fixed

# HTTP request module
#httpreq_ca		trusted1.pem
#httpreq_ca		trusted2.pem
#httpreq_dns		1.1.1.1
#httpreq_dns		8.8.8.8
#httpreq_hostname	myserver
#httpreq_cert		cert.pem
#httpreq_key		key.pem

# multicast receivers (in priority order)- port number must be even
#multicast_call_prio	0
#multicast_ttl	1
#multicast_jbuf_type	fixed		# off, fixed, adaptive
#multicast_jbuf_delay	5-10		# frames
#multicast_listener	224.0.2.21:50000
#multicast_listener	224.0.2.21:50002

# avformat
#avformat_hwaccel	vaapi
#avformat_inputformat	mjpeg
#avformat_decoder	mjpeg
#avformat_pass_through	yes
#avformat_rtsp_transport	udp

# ice
#ice_policy		all	# all, relay (candidates)


webrtc_aec_extended_filter           yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions