quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
450 stars 63 forks source link

High latency with vban_emitter/alsa (alsaSetParamsRework) #85

Open vladpetric opened 1 year ago

vladpetric commented 1 year ago

Hi, I'm getting roughly half a second->a second latency when using the vban_emitter (alsaSetParamsRework branch, primary branch wasn't working at all). Everything's fine otherwise.

asoundrc:

pcm.!default
{
    type asym
    capture.pcm
    {
        type plug
        slave.pcm "mic_control"
    }
}

pcm.mic_control {
    type            softvol
    slave {
        pcm         "hw:CARD=Rx,DEV=0"
    }
    control {
        name        "Softmute Capture Volume"
        card        0
    }
    max_dB 20.0
    min_dB -100.0
}

Command line:

./vban_emitter -i 192.168.1.231 -p 6981 --streamname=Stream2 --rate=48000 -b alsa --loglevel=3

Note that the asoundrc is not necessary, I can pass in the device "hw:CARD=Rx,DEV=0" by hand as well (and without asoundrc), and the problem is the same (asoundrc gives me softvol and default device, that's all).

Also, I noticed that the buffer size set in the main function is not used at all within the alsa backend (again, this is the rework branch)