aviks / GameZero.jl

Zero overhead game development library for the Julia programming language
Other
184 stars 23 forks source link

ALSA bug #42

Closed cscherrer closed 3 years ago

cscherrer commented 3 years ago

Hi, I'm getting this error:

julia> go()
ALSA lib conf.c:4133:(snd_config_update_r) Cannot access file /workspace/destdir/share/alsa/alsa.conf
ALSA lib conf.c:4133:(snd_config_update_r) Cannot access file /workspace/destdir/share/alsa/alsa.conf
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
┌ Warning: No audio device available, sounds and music will not play.
│ ALSA: Couldn't open audio device: No such file or directory
└ @ GameZero ~/.julia/packages/GameZero/JN07Y/src/GameZero.jl:292
ALSA lib conf.c:4133:(snd_config_update_r) Cannot access file /workspace/destdir/share/alsa/alsa.conf
ALSA lib conf.c:4133:(snd_config_update_r) Cannot access file /workspace/destdir/share/alsa/alsa.conf

I don't understand how GZ connects to ALSA, but of course there's no /workspace directory on my system. Sound works fine outside of this. Here's my sound setup:

➤ inxi -xxA
Audio:     Device-1: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus-ID: 0a:00.3 chip-ID: 1022:1457 
           Device-2: NVIDIA TU102 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 41:00.1 
           chip-ID: 10de:10f7 
           Device-3: Logitech C922 Pro Stream Webcam type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-1:2 chip-ID: 046d:085c 
           Device-4: Logitech Blue Microphones type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-3:3 
           chip-ID: 046d:0ab7 
           Device-5: Valve Valve VR Radio type: USB driver: cdc_acm,hid-generic,usbhid bus-ID: 3-1.3.2:8 chip-ID: 28de:2102 
           Device-6: Valve Valve VR Radio & HMD Mic type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 3-1.3.3:9 
           chip-ID: 28de:2102 
           Sound Server-1: ALSA v: k5.10.49-1-MANJARO running: yes 
           Sound Server-2: sndio v: N/A running: no 
           Sound Server-3: JACK v: 1.9.18 running: no 
           Sound Server-4: PulseAudio v: 14.2 running: no 
           Sound Server-5: PipeWire v: 0.3.31 running: yes 
danilo-bc commented 3 years ago

This can probably be solved by having it direct to /usr/share/alsa/alsa.conf instead of /workspace/destdir

cscherrer commented 3 years ago

Would this be in GameZero itself, or somewhere else? I didn't set anything to /workspace/destdir, that just seems to be a default somewhere

danilo-bc commented 3 years ago

I clearly haven't looked deep into it, but from your error message, it spans from https://github.com/aviks/GameZero.jl/blob/ad4de5cd690aa16d23f94d034a843803fe6a2a3c/src/GameZero.jl#L290

which calls SDL2 to create a device, then fails. I'm not sure how everything it built together. Maybe it's a reference in SDL2, maybe it's some environment variable in GameZero.

Since the previous lines don't error out, my guesses are that either SDL is initiating improperly or the function call is not implemented generically. This call seems to be the same for any operational system (since I don't see any clear checks of operational system in the surroundings of the code), so some differences should happen in the lower layers of the API.

aviks commented 3 years ago

This is a bug in how we build and distribute sound libraries on linux. I've documented a manual workaround in this Yggdrasil isue: https://github.com/JuliaPackaging/Yggdrasil/issues/1432#issuecomment-851065063 . That issue discusses this in a lot of detail, so I'll close this here. Unfortunately, there is no clear solution in view yet.