arena icon indicating copy to clipboard operation
arena copied to clipboard

Unable to enable sound via --engine.sound

Open amit-gshe opened this issue 1 year ago • 2 comments

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?

amit-gshe avatar Jun 21 '23 08:06 amit-gshe

@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 avatar Jun 22 '23 02:06 alexpalms

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 avatar Jun 24 '23 03:06 alexpalms

@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 avatar May 28 '24 13:05 alexpalms

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

  • The sound is not "forwarded" from the container to the host, maybe we are missing some parameters on how we launch the container?
  • The sound input option passed from the CLI to the docker is wrong, but I do not think this is the case.

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

alexpalms avatar May 28 '24 14:05 alexpalms

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

shashank3959 avatar May 28 '24 21:05 shashank3959

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.

discordianfish avatar May 29 '24 11:05 discordianfish

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

alexpalms avatar May 29 '24 12:05 alexpalms

@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.

discordianfish avatar Jun 06 '24 10:06 discordianfish

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

alexpalms avatar Jun 06 '24 18:06 alexpalms