put toxav loop in separate thread