# Crash after bluetooth earphone is disconnected

**URL:** <https://community.audiorelay.net/t/crash-after-bluetooth-earphone-is-disconnected/2626>\
**Category:** Bug reports\
**Created:** [October 31, 2024, 11:33pm UTC](https://community.audiorelay.net/t/crash-after-bluetooth-earphone-is-disconnected/2626 "2024-10-31T23:33:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabricio\_Figueiredo](https://community-cdn.audiorelay.net/user_avatar/community.audiorelay.net/fabricio_figueiredo/32/1583_2.png) [@Fabricio\_Figueiredo](https://community.audiorelay.net/u/Fabricio_Figueiredo)\
**Post date:** [October 31, 2024, 11:33pm UTC](https://community.audiorelay.net/t/crash-after-bluetooth-earphone-is-disconnected/2626/1 "2024-10-31T23:33:10Z")

</div>

# Description

Application crashes after bluetooth device is disconnected.

# Steps to reproduce

Connect player (device A) to the server (device B).

Connect a bluetooth earphone/headphone to device A.

The bluetooth is selected as the default audio device.

The sound from device A can be heard from device B.

Disconnect the bluetooth earphone/headphone from device A.

AudioRelay on device A crashes.

# Devices

**Device A: as a player**  
Windows 11  
AudioRelay 0.27.5

**Device B: as a server**  
macOS Sonoma 14.6.1  
AudioRelay 0.27.5

log from audioRelay:  
2024-10-31 20:16:39:195 [WARN] System error: SystemErrorId(value=RTAUDIO\_STREAM\_STOPPED\_ERROR)  
2024-10-31 20:16:39:203 [ERROR] Audio output failed: com.azefsw.audioconnect.desktop.exceptions.StreamNotRunningException: The stream stopped running. The audio device changed or was removed  
at ZF0.invokeSuspend(SourceFile:57)  
at jUr4.resumeWith(SourceFile:5)  
at Eu.run(SourceFile:163)  
at Yj.run(SourceFile:19)

log from audiorelay.backend:  
2024-10-31 20:16:39.621 [ERR] Socket service error  
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —\> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host  
at System.Net.Sockets.Socket.Receive(Byte buffer, Int32 offset, Int32 size, SocketFlags socketFlags)  
at System.Net.Sockets.NetworkStream.Read(Byte buffer, Int32 offset, Int32 size)  
— End of inner exception stack trace —  
at System.Net.Sockets.NetworkStream.Read(Byte buffer, Int32 offset, Int32 size)  
at System.IO.Stream.ReadByte()  
at Google.Protobuf.ParsingPrimitives.ReadRawVarint32(Stream input)  
at Google.Protobuf.MessageExtensions.MergeDelimitedFrom(IMessage message, Stream input, Boolean discardUnknownFields, ExtensionRegistry registry)  
at Google.Protobuf.MessageParser`1.ParseDelimitedFrom(Stream input) at AudioConnect.Ipc.IpcSocketsService.<>c __DisplayClass10_0.<ReadMessages>b__ 0() at AudioConnect.Rx.Observables.<>c__DisplayClass2_1`1.b\_\_1(Int32 \_, ICancelable cancelable)  
2024-10-31 20:16:39.622 [INF] Connection lost

---

<div class="post-metadata">

**Author:** ![fewfre](https://community-cdn.audiorelay.net/user_avatar/community.audiorelay.net/fewfre/32/2846_2.png) [@fewfre](https://community.audiorelay.net/u/fewfre)\
**Post date:** [June 25, 2026, 3:49pm UTC](https://community.audiorelay.net/t/crash-after-bluetooth-earphone-is-disconnected/2626/2 "2026-06-25T15:49:36Z")

</div>

I have this issue too - while not a fix, I’m working around this issue by adding this autohotkey (v2) script to my startup folder (update program location if needed, and might have to resize window if the servers list doesn’t show up without scrolling)

```ini
#Requires AutoHotkey v2.0
#SingleInstance Force

SetTitleMatchMode 2
SEC_TO_MS := 1000

Loop {
	; Wait for AudioRelay to crash (crash window title is "AudioRelay.exe" instead of "AudioRelay" which makes it easier to detect)
    WinWait "AudioRelay.exe"
    WinClose "AudioRelay.exe"
    Sleep 1*SEC_TO_MS
    Run 'C:\Program Files (x86)\AudioRelay\AudioRelay.exe'

    WinWait "AudioRelay"
    WinActivate
    Sleep 2*SEC_TO_MS

    CoordMode "Mouse", "Window"
    ; Click the left-side "Player"
    Click 50, 125
	; Wait 5s for servers to load, then click the first one in the list
    Sleep 5*SEC_TO_MS
    Click 375, 800
}

```

---

<div class="post-metadata">

**Author:** ![Asapha](https://community-cdn.audiorelay.net/user_avatar/community.audiorelay.net/asapha/32/7_2.png) [@Asapha](https://community.audiorelay.net/u/Asapha)\
**Post date:** [June 25, 2026, 9:09pm UTC](https://community.audiorelay.net/t/crash-after-bluetooth-earphone-is-disconnected/2626/3 "2026-06-25T21:09:23Z")

</div>

This shouldn’t occur in the next version. An early access version is available from #Announcements
