# Retrieve low level system from studio / Linux, Mac / python

**URL:** <https://qa.fmod.com/t/retrieve-low-level-system-from-studio-linux-mac-python/12966>\
**Category:** FMOD Studio\
**Created:** [February 8, 2017, 3:52pm UTC](https://qa.fmod.com/t/retrieve-low-level-system-from-studio-linux-mac-python/12966 "2017-02-08T15:52:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eimal](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@Eimal](https://qa.fmod.com/u/Eimal)\
**Post date:** [February 8, 2017, 3:52pm UTC](https://qa.fmod.com/t/retrieve-low-level-system-from-studio-linux-mac-python/12966/1 "2017-02-08T15:52:50Z")

</div>

hey all,

I am using python ctypes to work with fmod studio libs.  
Trying to retrieve the Low Level System from the studio system with Studio::System::getLowLevelSystem - which works perfectly on Mac OS, but I am getting invaid handle errors on linux when I try to access functions like getVersion…

mac:

```
from ctypes import *
from ctypes.util import find_library

VERSION = 0x00010814

def ckresult(ERRCODE):
    print("FMOD:", ERRCODE)

studio_lib = cdll.LoadLibrary(find_library("libfmodstudioL"))
lowlevel_lib = cdll.LoadLibrary(find_library("libfmodL"))

studio = c_void_p()
ckresult(studio_lib.FMOD_Studio_System_Create(byref(studio),VERSION))

lowlevel = c_void_p()
ckresult(studio_lib.FMOD_Studio_System_GetLowLevelSystem(studio, byref(lowlevel)))

VERSION = c_int()
ckresult(lowlevel_lib.FMOD_System_GetVersion(lowlevel, byref(VERSION)))
print("VERSION", VERSION.value)

```

gives me:

```
FMOD: 0
[LOG] System::create : Header version = 1.08.14. Current version = 1.08.14.
FMOD: 0
FMOD: 0
VERSION 67604

```

beautiful!  
on linux (Linux Mint 18.1 x86\_64):

```
from ctypes import *
from ctypes.util import find_library
    
VERSION = 0x00010814
    
def ckresult(ERRCODE):
    print("FMOD:", ERRCODE)
    
studio_lib = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libfmodstudioL.so.8.14")
lowlevel_lib = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libfmodL.so.8.14")
    
studio = c_void_p()
ckresult(studio_lib.FMOD_Studio_System_Create(byref(studio),VERSION))
    
lowlevel = c_void_p()
ckresult(studio_lib.FMOD_Studio_System_GetLowLevelSystem(studio, byref(lowlevel)))
    
VERSION = c_int()
ckresult(lowlevel_lib.FMOD_System_GetVersion(lowlevel, byref(VERSION)))
print("VERSION", VERSION.value)

```

gives me:

```
[LOG] System::create : Header version = 1.08.14. Current version = 1.08.14.
FMOD: 0
FMOD: 0
FMOD: 30 /// (FMOD_ERR_INVALID_HANDLE An invalid object handle was used.)
VERSION 0 /// no version...

```

any ideas? would be a milestone 😉 writing kind of a fmod wrapper at the moment…  
Thank you!

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [February 13, 2017, 1:28am UTC](https://qa.fmod.com/t/retrieve-low-level-system-from-studio-linux-mac-python/12966/2 "2017-02-13T01:28:13Z")

</div>

> [@](#):
>
> hey all,
> 
> I am using python ctypes to work with fmod studio libs.  
> Trying to retrieve the Low Level System from the studio system with Studio::System::getLowLevelSystem - which works perfectly on Mac OS, but I am getting invaid handle errors on linux when I try to access functions like getVersion…
> 
> mac:
> 
> ```
> from ctypes import *
> from ctypes.util import find_library
> 
> VERSION = 0x00010814
> 
> def ckresult(ERRCODE):
> print("FMOD:", ERRCODE)
> 
> studio_lib = cdll.LoadLibrary(find_library("libfmodstudioL"))
> lowlevel_lib = cdll.LoadLibrary(find_library("libfmodL"))
> 
> studio = c_void_p()
> ckresult(studio_lib.FMOD_Studio_System_Create(byref(studio),VERSION))
> 
> lowlevel = c_void_p()
> ckresult(studio_lib.FMOD_Studio_System_GetLowLevelSystem(studio, byref(lowlevel)))
> 
> VERSION = c_int()
> ckresult(lowlevel_lib.FMOD_System_GetVersion(lowlevel, byref(VERSION)))
> print("VERSION", VERSION.value)
> 
> ```
> 
> gives me:
> 
> ```
> FMOD: 0
> [LOG] System::create : Header version = 1.08.14. Current version = 1.08.14.
> FMOD: 0
> FMOD: 0
> VERSION 67604
> 
> ```
> 
> beautiful!  
> on linux (Linux Mint 18.1 x86\_64):
> 
> ```
> from ctypes import *
> from ctypes.util import find_library
>     
> VERSION = 0x00010814
>     
> def ckresult(ERRCODE):
> print("FMOD:", ERRCODE)
>     
> studio_lib = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libfmodstudioL.so.8.14")
> lowlevel_lib = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libfmodL.so.8.14")
>     
> studio = c_void_p()
> ckresult(studio_lib.FMOD_Studio_System_Create(byref(studio),VERSION))
>     
> lowlevel = c_void_p()
> ckresult(studio_lib.FMOD_Studio_System_GetLowLevelSystem(studio, byref(lowlevel)))
>     
> VERSION = c_int()
> ckresult(lowlevel_lib.FMOD_System_GetVersion(lowlevel, byref(VERSION)))
> print("VERSION", VERSION.value)
> 
> ```
> 
> gives me:
> 
> ```
> [LOG] System::create : Header version = 1.08.14. Current version = 1.08.14.
> FMOD: 0
> FMOD: 0
> FMOD: 30 /// (FMOD_ERR_INVALID_HANDLE An invalid object handle was used.)
> VERSION 0 /// no version...
> 
> ```
> 
> any ideas? would be a milestone 😉 writing kind of a fmod wrapper at the moment…  
> Thank you!

I can only say is lowlevel\_lib valid? Is it non zero, if it looks like a normal address, then it would be weird, but if it was 0x00000000 for example that would make sense that it returns invalid handle.
