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

Unplugged audio interface requires restart #61

Open
atesija opened this issue Mar 19, 2023 · 2 comments
Open

Unplugged audio interface requires restart #61

atesija opened this issue Mar 19, 2023 · 2 comments
Assignees
Labels

Comments

@atesija
Copy link

atesija commented Mar 19, 2023

I had a show where I accidentally unplugged my audio interface and the only way to get audio again was by restarting my program. Is there a way to reset the audio input programmatically?

Reproduction steps:
1: Run a program using Lasp
2: Unplug your audio interface (I use a Focusrite Scarlet 2i2)
3: Plug it back in (expecting it all to keep working but instead it won't pick up audio again unless I restart the program)

The error I see when doing this in editor:

InStream error (Streaming)
0x00007ff7dc3b368d (Unity) StackWalker::GetCurrentCallstack
0x00007ff7dc3ba369 (Unity) StackWalker::ShowCallstack
0x00007ff7dd32b683 (Unity) GetStacktrace
0x00007ff7dd9c947d (Unity) DebugStringToFile
0x00007ff7db59abd2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000002d78b119e23 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002d78b119d5b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000002d78b119ae0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002d78b1199a8 (Mono JIT Code) UnityEngine.Debug:LogWarning (object)
0x000002d78b11969b (Mono JIT Code) [InputDeviceHandle.cs:313] Lasp.InputDeviceHandle:OnErrorInStream (SoundIO.InStreamData&,SoundIO.Error) 
0x000002d787f56c2b (Mono JIT Code) (wrapper native-to-managed) Lasp.InputDeviceHandle:OnErrorInStream (SoundIO.InStreamData&,SoundIO.Error)
0x000000005eab69f4 (soundio) soundio_ring_buffer_clear
0x000000005eab365c (soundio) soundio_version_patch
0x00007ffd2e567614 (KERNEL32) BaseThreadInitThunk
0x00007ffd2ee626a1 (ntdll) RtlUserThreadStart
@atesija atesija changed the title Unplugged Audio Interface Requires Restart Unplugged audio interface requires restart Mar 19, 2023
@keijiro keijiro self-assigned this Mar 19, 2023
@keijiro
Copy link
Owner

keijiro commented Mar 19, 2023

How about destroying/recreating related objects after device reconnection?

@atesija
Copy link
Author

atesija commented Mar 19, 2023

I tried recreating both the Spectrum Analyzer and an Audio Level Tracker but they seem frozen, like no audio is recognized. I made sure they used the same Device ID, channel, and other settings. I also tried resetting the scene by loading it fresh and that didn't work either. It feels like the audio stream that is read from breaks and can't be repaired.

(This isn't a big issue, I can always try to make sure the interface stays plugged in or try a different one if it's only happening with mine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants