facebookresearch / rlr-audio-propagation

Audio propagation engine - Meta Reality Labs Research.
Other
16 stars 5 forks source link

'habitat_sim._ext.habitat_sim_bindings.RLRAudioPropagationChannelLayout' object has no attribute 'channelType' #13

Closed sreeharshaparuchur1 closed 1 year ago

sreeharshaparuchur1 commented 1 year ago

Hi,

My use case for this project is with respect to the Soundspaces 2.0 simulator. As a result, I have followed the setup instructions present in the soundspaces readme.

I am able to run the example notebook and script given in the example section of the soundspaces repo successfully. However, in multiple places such as in habitat-labs test audio_agent script and (soundspaces' continuous simulator)[https://github.com/facebookresearch/sound-spaces/blob/main/soundspaces/continuous_simulator.py#L124], the below API call is made to create a channel layout object.

channel_layout = habitat_sim.sensor.RLRAudioPropagationChannelLayout() 

On calling the above method, we have to add a sensor object to the channelType attribute, but, this fails for me with my current setup and I get the aforementioned error. In order to provide an error log, I have run python scripts/interactive_demo.py CONTINUOUS True in my soundspaces 2.0 installation and get the following traceback:

Traceback (most recent call last):
  File "scripts/interactive_demo.py", line 245, in <module>
    main()
  File "scripts/interactive_demo.py", line 235, in main
    env = AudioNavRLEnv(config=config, dataset=dataset)
  File "/home/crashtappen/SoundSpaces20/sound-spaces/ss_baselines/common/environments.py", line 48, in __init__
    super().__init__(self._core_env_config, dataset)
  File "/home/crashtappen/SoundSpaces20/habitat-lab-0.2.2/habitat/core/env.py", line 374, in __init__
    self._env = Env(config, dataset)
  File "/home/crashtappen/SoundSpaces20/habitat-lab-0.2.2/habitat/core/env.py", line 105, in __init__
    id_sim=self._config.SIMULATOR.TYPE, config=self._config.SIMULATOR
  File "/home/crashtappen/SoundSpaces20/habitat-lab-0.2.2/habitat/sims/registration.py", line 19, in make_sim
    return _sim(**kwargs)
  File "/home/crashtappen/SoundSpaces20/sound-spaces/soundspaces/continuous_simulator.py", line 111, in __init__
    self.add_acoustic_config()
  File "/home/crashtappen/SoundSpaces20/sound-spaces/soundspaces/continuous_simulator.py", line 128, in add_acoustic_config
    channel_layout.channelType = habitat_sim.sensor.RLRAudioPropagationChannelLayoutType.Binaural
AttributeError: 'habitat_sim._ext.habitat_sim_bindings.RLRAudioPropagationChannelLayout' object has no attribute 'channelType'

Current workaround:

I am able to workaround this problem by directly adding the channel configuration to the audio as done in this example.

Since there is a workaround, this isn't a time critical error but it would help me and the community if you could either update the codes to use the workaround or fix the API.

Thank you

ChanganVR commented 1 year ago

@sreeharshaparuchur1 the APIs have been updated and I've updated a step-by-step installation guide, and you could also find examples for setting APIs in this file.

sreeharshaparuchur1 commented 1 year ago

@ChanganVR Thank you very much for taking the time out to update the APIs, that should fix this issue.

On going through the changes that you've made and the step-by-step installation guide, I have a doubt about what the line audio_sensor_spec.enableMaterials = False does to:

ChanganVR commented 1 year ago

@sreeharshaparuchur1 you are right, setting the parameter to not use materials leads to suboptimal performance. But for some environments, if the semantic annotations are faulty, using materials simply does not render and leads to crashing every time. If the semantic annotation issue can't be fixed, you could consider disabling using materials.