Skip to content
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

audio problems in Windows #960

Closed
jobo-zt opened this issue Apr 11, 2020 · 7 comments
Closed

audio problems in Windows #960

jobo-zt opened this issue Apr 11, 2020 · 7 comments

Comments

@jobo-zt
Copy link
Contributor

jobo-zt commented Apr 11, 2020

The master code is tested in Windows 10, with the following problems.(test winows10 baresip <-> linux(RPI) baresip)

  1. The local audio has no code to spread to the remote.
  2. During the meeting, the local cannot hang up normally. (neither remote nor local)

//log
PS D:\baresip\bin_vpn> .\baresip-win32.exe -e "/dial sip:0755000002@10.8.0.2"
baresip v0.6.5 Copyright (C) 2010 - 2020 Alfred E. Heggestad et al.
Binding to interface or IP address '10.8.0.3'
Local network address: IPv4={E6BEA673-6CFE-46B8-A7E8-B6CEB6F98FBB}|10.8.0.3
httpd: listening on 0.0.0.0:8000
aucodec: opus/48000/2
aucodec: PCMU/8000/1
aucodec: PCMA/8000/1
aufilt: speex_pp
winwave: output devices: 1, input devices: 1
ausrc: winwave
auplay: winwave
vidcodec: H264
vidcodec: H264
vidcodec: H263
vidcodec: MP4V-ES
vidcodec: H265
avcodec: using H.264 encoder 'libx264' -- libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
avcodec: using H.264 decoder 'h264' -- H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
avcodec: using H.265 encoder 'libx265' -- libx265 H.265 / HEVC
avcodec: using H.265 decoder 'hevc' -- HEVC (High Efficiency Video Coding)
vidsrc: dshow
vidisp: sdl
medianat: stun
medianat: turn
medianat: ice
medianat: ice-lite
Populated 1 account
glog: module init
Could not create logging file: No such file or directory
Could not create logging file: No such file or directory
Populated 3 contacts
Populated 3 audio codecs
Populated 1 audio filter
Populated 5 video codecs
Populated 0 video filters
baresip is ready.
/dial sip:0755000002@10.8.0.2
ua: using best effort AF: af=AF_INET
call: connecting to 'sip:0755000002@10.8.0.2'..
unhandeled request from 10.8.0.3:5060: REGISTER sip:10.8.0.3
reg: sip:0755000003@10.8.0.3: 501 Not Implemented (baresip v0.6.5 (?/win32))
call: SIP Progress: 180 Ringing (/)
play: /usr/share/baresip/ringback.wav: No such file or directory
stream: incoming rtp for 'audio' established, receiving from 10.8.0.2:18348
audio: Set audio decoder: opus 48000Hz 2ch
audio: player started with sample format S16LE
long async blocking: 240>100 ms (h=0xfc9f00 arg=0x1592e38)
stream: update 'audio'
stream: update 'video'
audio: Set audio encoder: opus 48000Hz 2ch
speex_pp: Speex preprocessor loaded: srate = 48000Hz
audio: source started with sample format S16LE
audio tx pipeline: winwave ---> speex_pp ---> opus
audio rx pipeline: winwave <--- opus
Set video encoder: H264 packetization-mode=0 (2000000 bit/s, 25.00 fps)
avcodec: h264 encoder activated
dshow: got device '' id=0
Set video decoder: H264 packetization-mode=0
avcodec: h264 decoder activated
avcodec: decode: hardware accel disabled
0755000003@10.8.0.3: Call established: sip:0755000002@10.8.0.2
long async blocking: 715>100 ms (h=0xfc9f00 arg=0x1593180)
stream: incoming rtp for 'video' established, receiving from 10.8.0.2:48144
[h264 @ 038e8bc0] no frame!
avcodec: avcodec_send_packet error, packet=26 bytes, ret=-1094995529 (Invalid data found when processing input)
video: H264 decode error (seq=9012, 5 bytes): Unknown error
video: receiving with resolution 352 x 288 and format 'yuv420p'
sdl: created renderer 'direct3d'
long async blocking: 308>100 ms (h=0xfc9f00 arg=0x15a0890)
[libx264 @ 038d6940] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 038d6940] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
long async blocking: 762>100 ms (h=0xf81760 arg=0x158fcd8).8/22.0
long async blocking: 102>100 ms (h=0xfad4c0 arg=0x15e1ec0).7/22.8
unhandeled request from 10.8.0.3:5060: REGISTER sip:10.8.0.34/21.0
reg: sip:0755000003@10.8.0.3: 501 Not Implemented (baresip v0.6.5 (?/win32))
long async blocking: 108>100 ms (h=0xfad4c0 arg=0x15e1ec0)0.5/22.8
long async blocking: 617>100 ms (h=0xf7b950 arg=(nil))ps=10.0/19.0
long async blocking: 108>100 ms (h=0xf7b950 arg=(nil))ps=10.0/19.0
[0:01:43] audio=0/28390 video=506620/281671 (bit/s) efps=10.0/14.5

@jobo-zt jobo-zt changed the title audio problems on Windows audio problems in Windows Apr 14, 2020
@alfredh
Copy link
Collaborator

alfredh commented Apr 16, 2020

hi @75535552

I just wanted to check if you are a real person and not a robot.

Are you working for a company that is using the product ?

if the request for help is coming from a real person, it is easier for me
to help you.

if the request is coming from 981723981264912763912837 I am not really sure what to do :)

Alfred

@jobo-zt
Copy link
Contributor Author

jobo-zt commented Apr 17, 2020

hi @alfredh
I'm a multimedia communications developer and I'm sure it's not a robot. It's not used in my project. Baresip implementation is very good. I like it in my spare time. I put it in RPI, which can connect with the Windows client very well. when the code is updated, I will test it in windows and Linux. about "981723981264912763912837" I don't quite understand what line and column marks my from. I don't think it's valid

@alfredh
Copy link
Collaborator

alfredh commented Apr 17, 2020

if you have signed your request with a real name, it would become more personal,
and hence easier for me to help you.

if I receive a bug report from 12345 it is not really easy for me to take it seriously.
it can be a automated bot.

regarding your issue:

  • what OS version are you running (exact) ?

  • what kind of audio hardware do you use ?

  • please share the full config+accounts

  • have you tried if the /auloop command is working?

  • please dump the output of /audio_debug command after 10 second in the call

  • add some debug code here and check if samples are coming:

https://github.com/alfredh/baresip/blob/master/modules/winwave/src.c#L81

  • this line: "glog: module init" is not from stock baresip. Please use a clean baresip
    from git HEAD without any local modifications when reporting.

@jobo-zt
Copy link
Contributor Author

jobo-zt commented Apr 17, 2020

Thanks. I'll update it later.

@jobo-zt
Copy link
Contributor Author

jobo-zt commented Apr 18, 2020

hi @alfredh

I git reset --hard *** without any. in Win10 enterprise x64 IDE is vs2015 thinkpad t470s

I went back to the code to confirm that the problem was introduced in the following submission. The previous version is OK.
//
Revision: 3f2a182
Author: Ola Palm ola.palm@me.com
Date: 2020/4/4 15:43:41
Message:
Aubuf current jb value to mqtt (#954)

  • Aubuf current jb value to mqtt
  • fix comments.
  • changed type for current_jb value to uint32
  • another type update to get by clang on mac
  • tabs not spaces

Modified: include/baresip.h
Modified: modules/mqtt/publish.c
Modified: src/audio.c
Modified: src/event.c

//config

baresip configuration

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

Core

poll_method select # poll, select

SIP

sip_listen 0.0.0.0:5060
#sip_certificate cert.pem
#sip_cafile /etc/ssl/certs/ca-certificates.crt

Call

call_local_timeout 120
call_max_calls 4

Audio

#audio_path /usr/share/baresip
audio_player winwave,nil
audio_source winwave,nil
audio_alert winwave,nil
#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

Video

#video_source dshow,nil
#video_display sdl,nil
video_size 352x288
video_bitrate 500000
video_fps 25.00
video_fullscreen no
videnc_format yuv420p

AVT - Audio/Video Transport

rtp_tos 184
#rtp_ports 10000-20000
#rtp_bandwidth 512-1024 # [kbit/s]
rtcp_mux no
jitter_buffer_delay 5-10 # frames
rtp_stats no
#rtp_timeout 60

Network

#dns_server 1.1.1.1:53
#dns_server 1.0.0.1:53
#net_interface eth0
#net_interface 192.168.9.100
net_interface 10.8.0.3

#BFCP
bfcp_proto udp

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

Modules

#module_path /usr/lib/baresip/modules

UI Modules

module wincons.dll
#module cons.dll
#module evdev.dll
#module httpd.dll

Audio codec Modules (in order)

#module opus.dll
#module amr.dll
#module g7221.dll
#module g722.dll
#module g726.dll
module g711.dll
#module gsm.dll
#module l16.dll
#module mpa.dll
#module codec2.dll
#module ilbc.dll
#module isac.dll

Audio filter Modules (in encoding order)

#module vumeter.dll
#module sndfile.dll
#module speex_pp.dll
#module plc.dll
#module webrtc_aec.dll

Audio driver Modules

module winwave.dll
#module jack.dll
#module portaudio.dll
#module aubridge.dll
#module aufile.dll

Video codec Modules (in order)

#module avcodec.dll
#module vp8.dll
#module vp9.dll

Video filter Modules (in encoding order)

#module selfview.dll
#module snapshot.dll
#module swscale.dll
#module vidinfo.dll

Video source modules

module dshow.dll
#module x11grab.dll
#module cairo.dll
#module vidbridge.dll

Video display modules

#module x11.dll
#module sdl.dll
#module fakevideo.dll

Audio/Video source modules

#module avformat.dll
#module rst.dll
#module gst.dll
#module gst_video.dll

Compatibility modules

#module ebuacip.dll

Media NAT modules

module stun.dll
module turn.dll
module ice.dll
#module natpmp.dll
#module pcp.dll

Media encryption modules

#module srtp.dll
#module dtls_srtp.dll
#module zrtp.dll

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

Temporary Modules (loaded then unloaded)

module_tmp uuid.dll
module_tmp account.dll

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

Application Modules

module_app auloop.dll
#module_app b2bua.dll
module_app contact.dll
module_app debug_cmd.dll
#module_app echo.dll
#module_app gtk.dll
module_app menu.dll
#module_app mwi.dll
#module_app presence.dll
#module_app syslog.dll
#module_app mqtt.dll
#module_app ctrl_tcp.dll
module_app vidloop.dll

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

Module parameters

UI Modules parameters

cons_listen 0.0.0.0:5555 # cons

http_listen 0.0.0.0:8000 # httpd - server

ctrl_tcp_listen 0.0.0.0:4444 # ctrl_tcp

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

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

ICE

ice_debug no

ZRTP

#zrtp_hash no # Disable SDP zrtp-hash (not recommended)

Menu

#menu_bell yes
#redial_attempts 0 # Num or
#redial_delay 5 # Delay in seconds
#ringback_disabled no
#statmode_default off

avcodec

#avcodec_h264enc libx264
#avcodec_h264dec h264
#avcodec_h265enc libx265
#avcodec_h265dec hevc
#avcodec_hwaccel none

mqtt

#mqtt_broker_host 127.0.0.1
#mqtt_broker_port 1883
#mqtt_broker_clientid baresip01
#mqtt_broker_user user
#mqtt_broker_password pass
#mqtt_basetopic baresip/01

sndfile

#snd_path /tmp

EBU ACIP

#ebuacip_jb_type fixed # auto,fixed

//accounts
sip:0755000003@10.8.0.3;auth_pass=0755000003

I will continue to provide other info.

@jobo-zt
Copy link
Contributor Author

jobo-zt commented Apr 24, 2020

hi @alfredh @ola Palm
I found waveInGetPosition function in waveInCallback.

[waveInGetPosition is no longer supported for use as of Windows Vista. Instead, use IAudioClock::GetPosition
https://docs.microsoft.com/zh-cn/windows/win32/api/mmeapi/nf-mmeapi-waveingetposition?redirectedfrom=MSDN

@alfredh
Copy link
Collaborator

alfredh commented Apr 25, 2020

I pushed a fixed that uses tmr_jiffies_usec instead

if you want to use IAudioClock::GetPosition then please make a PR for that.

Many thanks for reporting the bug!

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this issue Nov 28, 2020
(Presumably the changelog [Unreleased] section is for 1.0.0)

= Baresip Changelog

== [Unreleased]

=== Added

- aac: add AAC_STREAMTYPE_AUDIO enum value
- aac: add AAC_ prefix
- Video mode param to call_answer(), ua_answer() and ua_hold_answer [#966]
- video_stop_display() API function [#977]
- module: add path to module_load() function
- conf: add conf_configure_buf
- test: add usage of g711.so module [#978]
- JSON initial codec state command and response [#973]
- account_set_video_codecs() API function [#981]
- net: add fallback dns nameserver [#996]
- gtk: show call_peername in notify title [#1006]
- call: Added call_state() API function that returns enum state of the call [#1013]
- account_set_stun_user() and account_set_stun_pass() API functions [#1015]
- API functions account_stun_uri and account_set_stun_uri. [#1018]
- ausine: Audio sine wave input module [#1021]
- gtk/menu: replace spaces from uri [#1007]
- jack: allowing jack client name to be specified in the config file [#1025] [#1020]
- snapshot: Add snapshot_send and snapshot_recv commands [#1029]
- webrtc_aec: 'extended_filter' config option [#1030]
- avfilter: FFmpeg filter graphs integration [#1038]
- reg: view proxy expiry value in reg_status [#1068]
- account: add parameter rwait for re-register interval [#1069]
- call, stream, menu: add cmd to set the direction of video stream [#1073]

=== Changed

- **Using [baresip/re](https://github.com/baresip/re) fork now**
- audio: move calculation to audio_jb_current_value
- avformat: clean up docs
- gzrtp: update docs
- account: increased size of audio codec list to 16
- video: make video_sdp_attr_decode public
- config: Derive default audio driver from default audio device [#1009]
- jack: modifying info message on jack client creation [#1019]
- call: when video stream is disabled, stop also video display [#1023]
- dtls_srtp: use tls_set_selfsigned_rsa with keysize 2048 [#1062] [#1056]
- rst: use a min ptime of 20ms
- aac: change ptime to 4ms

=== Fixed

- avcodec: fix H.264 interop with Firefox
- winwave: waveInGetPosition is no longer supported for use as of Windows Vista [#960]
- avcodec: call av_hwdevice_ctx_create before if-statement
- account: use single quote instead of backtick
- ice: fix segfault in connh [#980]
- call: Update call->got_offer when re-INVITE or answer to re-INVITE
  is received [#986]
- mk: Test also for /usr/lib64/libspeexdsp.so to cover Fedora/RHEL/CentOS [#992]
- config: Allow distribution specific CA trust bundle locations (fixes [#993]
- config: Allow distribution specific default audio device (fixes [#994]
- mqtt: fix err is never read (found by clang static analyzer)
- avcodec: fix err is never read (found by clang static analyzer)
- gtk: notification buttons do not work on Systems [#1012]
- gtk: fix dtmf_tone and add tones as feedback [#1010]
- pulse: drain pulse buffers before freeing [#1016]
- jack: jack_play connect all physical ports [#1028]
- Makefile: do not try to install modules if build is static [#1031]
- gzrtp: media_alloc function is missing [#1034] [#1022]
- call: when updating video, check if video stream has been disabled [#1037]
- amr: fix length check, fixes [#1011]
- modules: fix search path for avdevice.h [#1043]
- gtk: declare variables C89 style
- config: init newly added member
- menu: fix segfault in ua_event_handler [#1059] [#1061]
- debug_cmd: fix OpenSSL no-deprecated [#1065]
- aac: handle missing bitrate parameter in SDP format
- av1: properly configure encoder

=== Removed

- ice: remove support for ICE-lite
- ice: remove ice_debug, use log level DEBUG instead
- ice: make stun server optional
- config: remove ice_debug option (unused)

=== Contributors (many thanks)

- Alfred E. Heggestad
- Alexander Gramner
- Andrew Webster
- Christian Spielberger
- Christoph Huber
- Davide Alberani
- Ethan Funk
- Juha Heinanen
- mbattista
- Michael Malone
- Mikl Kurkov
- ndilieto
- Robert Scheck
- Roger Sandholm
- Sebastian Reimers

[#966]: baresip/baresip#966
[#977]: baresip/baresip#977
[#978]: baresip/baresip#978
[#973]: baresip/baresip#973
[#981]: baresip/baresip#981
[#996]: baresip/baresip#996
[#1006]: baresip/baresip#1006
[#1013]: baresip/baresip#1013
[#1015]: baresip/baresip#1015
[#1018]: baresip/baresip#1018
[#1021]: baresip/baresip#1021
[#1007]: baresip/baresip#1007
[#1025]: baresip/baresip#1025
[#1020]: baresip/baresip#1020
[#1029]: baresip/baresip#1029
[#1030]: baresip/baresip#1030
[#1038]: baresip/baresip#1038
[#1009]: baresip/baresip#1009
[#1019]: baresip/baresip#1019
[#1023]: baresip/baresip#1023
[#1062]: baresip/baresip#1062
[#1056]: baresip/baresip#1056
[#960]: baresip/baresip#960
[#980]: baresip/baresip#980
[#986]: baresip/baresip#986
[#992]: baresip/baresip#992
[#993]: baresip/baresip#993
[#994]: baresip/baresip#994
[#1012]: baresip/baresip#1012
[#1010]: baresip/baresip#1010
[#1016]: baresip/baresip#1016
[#1028]: baresip/baresip#1028
[#1031]: baresip/baresip#1031
[#1034]: baresip/baresip#1034
[#1022]: baresip/baresip#1022
[#1037]: baresip/baresip#1037
[#1011]: baresip/baresip#1011
[#1043]: baresip/baresip#1043
[#1059]: baresip/baresip#1059
[#1061]: baresip/baresip#1061
[#1065]: baresip/baresip#1065
[#1068]: baresip/baresip#1068
[#1069]: baresip/baresip#1069
[#1073]: baresip/baresip#1073

[Unreleased]: baresip/baresip@v0.6.6...HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants