layeh / barnard

barnard is a terminal-based client for the Mumble voice chat software
GNU General Public License v2.0
150 stars 46 forks source link

Post-F1 keypress crash #27

Closed KnuckleBob closed 7 years ago

KnuckleBob commented 7 years ago

I get the following output after connecting to the server and hitting F1, any ideas?

[13:31:49] Welcome message: Welcome to chat █
To: Chat Server
runtime: newstack framesize=0xc argsize=0x0 sp=0x44cfede4 stack=[0x469fd000, 0x469fefd0]
morebuf={pc:0x0 sp:0x0 lr:0x0} sched={pc:0x255b8 sp:0x44cfede4 lr:0x76e10778 ctxt:0x0} runtime: split stack overflow: 0x44cfede4 < 0x469fd000 fatal error: runtime: split stack overflow

runtime stack: runtime.throw(0x45e31b) /usr/lib/go/src/pkg/runtime/panic.c:520 +0x5c runtime.newstack() /usr/lib/go/src/pkg/runtime/stack.c:725 +0x21c runtime.morestack() /usr/lib/go/src/pkg/runtime/asm_arm.s:210 +0x44

goroutine 26 [stack growth]: runtime.cgocall(0x14960, 0x469feee8) /usr/lib/go/src/pkg/runtime/cgocall.c:142 +0xdc fp=0x469feed8 sp=0x469feeac github.com/timshannon/go-openal/openal._Cfunc_alcCaptureSamples(0x0, 0x574ecc00, 0x1e0) github.com/timshannon/go-openal/openal/_obj/_cgo_defun.c:297 +0x34 fp=0x469feee4 sp=0x469feed8 github.com/timshannon/go-openal/openal.(CaptureDevice).CaptureTo(0x57522280, 0x574ecc00, 0x3c0, 0x3c0) /home/pi/gocode/src/github.com/timshannon/go-openal/openal/alcCore.go:179 +0x8c fp=0x469feef4 sp=0x469feee4 github.com/timshannon/go-openal/openal.(CaptureDevice).CaptureSamples(0x57522280, 0x1e0, 0x574ecc00, 0x3c0, 0x3c0) /home/pi/gocode/src/github.com/timshannon/go-openal/openal/alcCore.go:204 +0xa4 fp=0x469fef20 sp=0x469feef4 layeh.com/gumble/gumbleopenal.(Stream).sourceRoutine(0x57510c00) /home/pi/gocode/src/layeh.com/gumble/gumbleopenal/stream.go:142 +0x22c fp=0x469fefc4 sp=0x469fef20 runtime.goexit() /usr/lib/go/src/pkg/runtime/proc.c:1445 fp=0x469fefc4 sp=0x469fefc4 created by layeh.com/gumble/gumbleopenal.(Stream).StartSource /home/pi/gocode/src/layeh.com/gumble/gumbleopenal/stream.go:66 +0xb0

goroutine 16 [runnable]: github.com/nsf/termbox-go.SetCell(0x454, 0xc5, 0x20, 0x10008) /home/pi/gocode/src/github.com/nsf/termbox-go/api.go:225 layeh.com/barnard/uiterm.(Textview).uiDraw(0x56c6e24c) /home/pi/gocode/src/layeh.com/barnard/uiterm/textview.go:146 +0x218 layeh.com/barnard/uiterm.(Ui).Refresh(0x56c28840) /home/pi/gocode/src/layeh.com/barnard/uiterm/ui.go:60 +0x120 layeh.com/barnard.(Barnard).OnVoiceToggle(0x56c6e1a0, 0x56c28840, 0x9ffff) /home/pi/gocode/src/layeh.com/barnard/ui.go:58 +0xcc layeh.com/barnard.Barnard.OnVoiceToggle·fm(0x56c28840, 0x56c1ffff) /home/pi/gocode/src/layeh.com/barnard/ui.go:152 +0x3c layeh.com/barnard/uiterm.(Ui).onKeyEvent(0x56c28840, 0xffff8100) /home/pi/gocode/src/layeh.com/barnard/uiterm/ui.go:142 +0x118 layeh.com/barnard/uiterm.(Ui).Run(0x56c28840, 0x0, 0x0) /home/pi/gocode/src/layeh.com/barnard/uiterm/ui.go:126 +0x2d4 main.main() /home/pi/gocode/src/github.com/layeh/barnard/cmd/barnard/main.go:47 +0x628

goroutine 19 [finalizer wait]: runtime.park(0x2af40, 0x473848, 0x45f0c9) /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x5c runtime.parkunlock(0x473848, 0x45f0c9) /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x40 runfinq() /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xa0 runtime.goexit() /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]: os/signal.loop() /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x24 created by os/signal.init·1 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x48

goroutine 21 [select]: github.com/nsf/termbox-go.func·001() /home/pi/gocode/src/github.com/nsf/termbox-go/api.go:86 +0x38c created by github.com/nsf/termbox-go.Init /home/pi/gocode/src/github.com/nsf/termbox-go/api.go:105 +0x7a8

goroutine 22 [select]: github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /home/pi/gocode/src/github.com/nsf/termbox-go/api.go:320 +0x5c8 layeh.com/barnard/uiterm.func·001() /home/pi/gocode/src/layeh.com/barnard/uiterm/ui.go:104 +0x2c created by layeh.com/barnard/uiterm.(*Ui).Run /home/pi/gocode/src/layeh.com/barnard/uiterm/ui.go:106 +0x150

goroutine 17 [syscall]: runtime.goexit() /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 23 [IO wait]: net.runtime_pollWait(0x46adea70, 0x72, 0x0) /usr/lib/go/src/pkg/runtime/netpoll.goc:146 +0x6c net.(pollDesc).Wait(0x56c3e0b8, 0x72, 0x0, 0x0) /usr/lib/go/src/pkg/net/fd_poll_runtime.go:84 +0x44 net.(pollDesc).WaitRead(0x56c3e0b8, 0x0, 0x0) /usr/lib/go/src/pkg/net/fd_poll_runtime.go:89 +0x40 net.(netFD).Read(0x56c3e080, 0x56c60800, 0x400, 0x400, 0x0, 0x46add230, 0xb) /usr/lib/go/src/pkg/net/fd_unix.go:242 +0x320 net.(conn).Read(0x56c32428, 0x56c60800, 0x400, 0x400, 0x0, 0x0, 0x0) /usr/lib/go/src/pkg/net/net.go:122 +0xd4 crypto/tls.(block).readFromUntil(0x56c1d260, 0x46adeaf8, 0x56c32428, 0x5, 0x0, 0x0) /usr/lib/go/src/pkg/crypto/tls/conn.go:451 +0xdc crypto/tls.(Conn).readRecord(0x56c70180, 0x17, 0x0, 0x0) /usr/lib/go/src/pkg/crypto/tls/conn.go:536 +0x1b4 crypto/tls.(Conn).Read(0x56c70180, 0x57522816, 0x6, 0x6, 0x0, 0x0, 0x0) /usr/lib/go/src/pkg/crypto/tls/conn.go:901 +0x16c io.ReadAtLeast(0x46ae3388, 0x56c70180, 0x57522816, 0x6, 0x6, 0x6, 0x0, 0x0, 0x0) /usr/lib/go/src/pkg/io/io.go:289 +0xf4 io.ReadFull(0x46ae3388, 0x56c70180, 0x57522816, 0x6, 0x6, 0x0, 0x0, 0x0) /usr/lib/go/src/pkg/io/io.go:307 +0x6c layeh.com/gumble/gumble.(Conn).ReadPacket(0x574e7b30, 0x5750e600, 0x0, 0x0, 0x0, 0x0, 0x0) /home/pi/gocode/src/layeh.com/gumble/gumble/conn.go:46 +0x15c layeh.com/gumble/gumble.(*Client).readRoutine(0x56c63d90) /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:234 +0x5c created by layeh.com/gumble/gumble.DialWithDialer /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:116 +0x298

goroutine 24 [select]: layeh.com/gumble/gumble.(*Client).pingRoutine(0x56c63d90) /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:217 +0x330 created by layeh.com/gumble/gumble.DialWithDialer /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:134 +0x550

goroutine 27 [chan receive]: layeh.com/gumble/gumble.func·001() /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:182 +0x6c created by layeh.com/gumble/gumble.(*Client).AudioOutgoing /home/pi/gocode/src/layeh.com/gumble/gumble/client.go:191 +0xc0

pierbiag commented 7 years ago

I get a very similar error in the same condition. what can i do about it?

KnuckleBob commented 7 years ago

After some more investigation, this is related to ALSA and not having the ability to directly select the proper sound capture card or output card. By creating a local ~/.asoundrc file, I've been able to get past the F1 crash to transmit sound (and other parties can hear me), but now I get a crash when someone else in the same channel transmits back to me.

My issue stems from the fact that I have >1 sound devices in the machine and need to use one for sound output and one for sound input. I've not yet made sense of the spaghetti that is ALSA to get both TX and RX working w/o a crash.

KnuckleBob commented 7 years ago

Okay, added an .asoundrc that seems to stop the crashing when either F1 is hit or the other side transmits sound but I need to do some more testing later today.

My configuration:

Sound output device: card 0 = internal sound card that only has output

Sound input device card 0 = External USB mic that has only input capabilities

$ arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
sysdefault:CARD=Device
    USB PnP Sound Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Front speakers
surround21:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Direct sample mixing device
dsnoop:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Direct sample snooping device
hw:CARD=**Device**,DEV=0
    USB PnP Sound Device, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    Hardware device with all software conversions
$ cat ~/.asoundrc
pcm.!default {
   type asym
   playback.pcm {
       type plug 
       slave.pcm "hw:0,0"
   }
   capture.pcm {
   type plug     
       slave.pcm "hw:1,0"
   }     
}
KnuckleBob commented 7 years ago

The above .asoundrc ended up working around the crash bug for me. It in effect binds two separate devices into a single one:

pierbiag commented 7 years ago

Thank you very much! I will try on mine today. I have an unusual hardware configuration which involves a Bluetooth headset over Pulseaudio following this guide: http://youness.net/raspberry-pi/bluetooth-headset-raspberry-pi-3-ad2p-hsp. I assume this should work in principle with barnard, right?