ccgauche/ytermusic

Not starting under WSL

Closed this issue · 12 comments

I assume this is an issue with sound under WSL.

After following the steps I get:

michael@Michaels-PC:~/ytermusic$ sudo ./ytermusic
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 confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0
panicked at 'called `Option::unwrap()` on a `None` value', src/systems/player.rs:78:29

Isn't strange I've used WSL in the past with Ytermusic and it worked. Seems alsa related were you using WSL 1 or 2?
Anyways this apps supports windows natively so WSL is not my main concern.

I was using WSL2, I didn't know this works on windows, will have to try =)

Could you possibly add windows exes to releases?
Or do I need to build from src?

I don't personally use windows so I don't have a build that I can trust enough to distribute it rn. Some of my friends use it on windows so I know it works. I'll install a VM and get you a build tonight if you want.

I don't want to bother you with building it just for me =)
I've installed Rust and built myself.
I couldn't not notice the slow build time though, this seems strange for such a cli project, is this a Rust thing?
Finished `release` profile [optimized + debuginfo] target(s) in 14m 58s
I first tried to build with a non nightly build and thought it's stuck because of the slow build time with nothing changing in the terminal (it looked stuck because it was building the same main file), maybe add a disclaimer in the README that slow build time is normal if nothing can be done about it.

The .exe crashes when I launch, could this be related to the cookie in headers.txt?
I believe I got the correct value
I got a .pdb file. But I don't see any error log.

Ah, I'm an idiot, I didn't have explorer file extensions enabled on this machine so my file name was headers.txt.txt.
Maybe add an error message if headers.txt doesn't exist, or create it automatically if it doesn't exist.

The message does exists, the issue is, on windows: when an app is double clicked it spawns a terminal and opens it but it the case of a crash the app or error stops so windows kills the terminal and you can't see the error being printed.
The building process is slow because I use lto which improve performance by ~10% but are notoriously extreeeemely slow to build even for my 7950XT machine. :/ I could disable them but should I really just make the app 10% slower because I am lazy...

I can probably fix that with a PR, quick question, does the app still rely on a rust nightly?

Seems like it doesn't rely on nightly, I built with standard tool-chain on windows and everything seems to work.

If it works on stable that's very nice. But that's not my main goal for now. The codebase is very old and messy so I'm improving it quite a bit. It also required some forking of rodio, cpal... So I need to update those libs too.

Gotcha, I added a pull request to prevent the console window from closing on windows: #77

You can close this issue, there's no need for WSL support since the windows build works.