Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
355 stars 55 forks source link

Can't load the music 'music/*.mid' #360

Open amstan opened 3 years ago

amstan commented 3 years ago

Describe the bug With a successfully installed wargus 3.0.0 (+ game data), none of the music plays. Despite the midis being unpacked properly (and playable with musescore).

I also tried to dump a TimGM6mb.sf2 in data.Wargus/music like someone said, didn't make a difference.

Command line

To Reproduce

  1. Install wargus
  2. Install game data
  3. ls ~/.stratagus/data.Wargus/music
    'Human Battle 1.mid'  'Human Battle 3.mid'  'Human Battle 5.mid'  'Human Defeat.mid'   "I'm a Medieval Man.mid"  'Orc Battle 1.mid'  'Orc Battle 3.mid'  'Orc Battle 5.mid'  'Orc Defeat.mid'
    'Human Battle 2.mid'  'Human Battle 4.mid'  'Human Briefing.mid'  'Human Victory.mid'  'Main Menu.mid'           'Orc Battle 2.mid'  'Orc Battle 4.mid'  'Orc Briefing.mid'  'Orc Victory.mid'
  4. Start wargus

Expected behavior Music plays

What actually happens No music playing:

alex@alex-desktop:/tmp/% wargus
Supported sound decoders: WAVE AIFF VOC MOD OGG OPUS MP3 FLAC
Supported music decoders: CMD WAVE FLAC OGG OPUS MPG123 MODPLUG MOD MP3
......snip.................

Can't open file 'videos/gameintro.ogv'
Can't load the music 'music/Orc Briefing.mid'
SetShader: none
Can't load the music 'music/Orc Briefing.mid'
Can't load the music 'music/Orc Briefing.mid'
Can't load the music 'music/Orc Briefing.mid'
Can't open file 'maps/skirmish/singleplayer/(2)blick-nach-oben.smp.gz': No such file or directory
Can't load the music 'music/Human Battle 3.mid'
Can't load the music 'music/Human Battle 4.mid'
Can't load the music 'music/Human Battle 2.mid'
Can't load the music 'music/Human Battle 5.mid'
Can't load the music 'music/Human Battle 1.mid'
Thanks for playing Stratagus.
78.73s real  18.03s user  0.99s system  24% cpu  240kB mem $ wargus

Screenshots and Logs

timfel commented 3 years ago

Hi, it seems your SDL2 installation cannot play midi files (it says in your output: "Supported music decoders: CMD WAVE FLAC OGG OPUS MPG123 MODPLUG MOD MP3")

I think you need to have timidity installed, but not sure.

timfel commented 3 years ago

Just checked, the debian package declares this as dependency: timgm6mb-soundfont | musescore-soundfont-gm. I'm pretty sure just either of those packages enabled MIDI play for me. You didn't say which distro you're on?

cyberconan commented 1 year ago

Hi! I'm having same issue with 3.3.1 version compiled from AUR in Archlinux. I setup old fluidsynth config file with a soundfont file and set environment variable SDL_SOUNDFONTS=/usr/share/soundfonts/FluidR3_GM.sf2 for new timidity but no luck.

timfel commented 1 year ago

If you have the same output as the original poster with Supported music decoders not containing MIDI, then I don't know, sorry. On Ubuntu it seems to work simply when timgm6mb-soundfont is installed. Note that the environment variable SDL_SOUNDFONTS is only supported with pretty new SDL_mixer versions, I don't know what AUR has, but Ubuntu's version is way older and iirc it does not support custom soundfonts at all, it only looks in the hardcoded path that the timgm6mb-soundfont package installs to.

This is the package content of timgm6mb-soundfont on Ubuntu. I'm pretty sure you need to have those exact paths for the cfg and the soundfont for SDL_mixer versions older than 2.6 to allow playing midi

/etc/timidity/timgm6mb.cfg
/usr/share/doc/timgm6mb-soundfont/changelog.Debian.gz
/usr/share/doc/timgm6mb-soundfont/copyright
/usr/share/sounds/sf2/TimGM6mb.sf2

There's always the option of converting the midi files manually to ogg and setting wargus.music_extension = ".ogg" in data.wargus/scripts/wc2-config.lua

cyberconan commented 1 year ago

Hi again! I have the solution in front of my eyes, launch in the same line: SDL_SOUNDFONTS=/usr/share/soundfonts/FluidR3_GM.sf2 wargus (or war1gus) But now I have another problem. When I start a map the sound goes choppy and need disable music and re-enable for everything goes well again.

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_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side 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_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave Expression 'ioctl( devHandle, SNDCTL_DSP_CHANNELS, &numChannels )' failed in 'src/hostapi/oss/pa_unix_oss.c', line: 414 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 Frames 1387, Slow frames 36 = 2% Gracias por jugar Stratagus.

I think than sdl_mixer is using all sound drivers except pulseaudio. I have found this but not solution by the moment. Any ideas about what can be?