diambra / arena

DIAMBRA Arena: a New Reinforcement Learning Platform for Research and Experimentation
https://docs.diambra.ai
Other
307 stars 22 forks source link

Unable to enable sound via --engine.sound #76

Closed amit-gshe closed 2 months ago

amit-gshe commented 1 year ago

Hello, When I tested the trained agent, the sound didn't work.

Command:

diambra run -l -g --engine.sound -n -d python3 kof_test.py

and I get an error from the log:ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf

Is there something missing here?

alexpalms commented 1 year ago

@amit-gshe thanks for reaching out. I can confirm I have the same issue locally in my tests, while I am pretty convinced this was working in the recent past.

I also confirm I am seeing multiple errors as the one you mentioned:

🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) (0)Setting difficulty = 3
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) ALSA lib conf.c:4553:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
🏟️ (6f39) (0)Player starting side = P2

@discordianfish do you have any idea? Can be a missing package installation in the docker container? The file mentioned in the error is in fact not there, maybe is not installed at all?

alexpalms commented 1 year ago

For additional context, adding the installation of the pulse/alsa libraries makes the previous error disappear but new ones appeared, as shown by the following snippet

🏟️ (994e) ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

as if the docker container does not see the sound card, I believe this is related to priviledges of the container. We will address this in the coming weeks

alexpalms commented 3 months ago

@discordianfish I can confirm the sound is still not working, so this issue is still applicable.

In the past it was working, do you have any idea on what can be missing?

alexpalms commented 3 months ago

@discordianfish after a couple of more tests, since locally (outside the container) it works, I believe is either because:

It was working in the past so should be "easily" doable/supported (for linux).

shashank3959 commented 3 months ago

Observing the same issue as reported in this thread, using diambra/engine:v2.2

discordianfish commented 3 months ago

It doesn't seem like we're passing in the sound device. I thought we had this working before. I'll need to have a closer look what is going on.

alexpalms commented 3 months ago

Yes I also remember that at some point it was working, not 100% sure but almost. Thanks @discordianfish!

discordianfish commented 2 months ago

@amit-gshe @shashank3959 Can you try the new CLI version here? https://github.com/diambra/cli/actions/runs/9398811568/artifacts/1574536593

For that sound should work, if it works for you I'll cut a new release.

alexpalms commented 2 months ago

@discordianfish I tested in on my end and it works like a charm!