We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3899 - playmus doesn't play certain wav files
Summary: playmus doesn't play certain wav files
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-21 09:49 UTC by Ozkan Sezer
Modified: 2017-10-21 11:02 UTC (History)
0 users

See Also:


Attachments
sample2.wav (170.72 KB, audio/x-wav)
2017-10-21 09:49 UTC, Ozkan Sezer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2017-10-21 09:49:04 UTC
Created attachment 3021 [details]
sample2.wav

Attached sample2.wav was resampled from SDL2/test/sample.wav
in the following way:

$ ./testresample sample.wav sample2.wav 8000 1
$ file sample2.wav
sample2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

The playmus example program doesn't play this 8KHz mono wav
properly:  I hear about half a second output and then it quits.
playwave is OK with it, though.
Comment 1 Sam Lantinga 2017-10-21 09:54:59 UTC
This is fixed in Mercurial, thanks!
Comment 2 Ozkan Sezer 2017-10-21 10:16:08 UTC
> This is fixed in Mercurial, thanks!

No, it is not:

INFO: Opened audio at 22050 Hz 16 bit stereo 4096 bytes audio buffer
==13236== Invalid read of size 4
==13236==    at 0x405B3CA: SDL_ReadLE32_REAL (SDL_rwops.c:788)
==13236==    by 0x4042BBD: SDL_ReadLE32 (SDL_dynapi_procs.h:390)
==13236==    by 0x401A8EF: WAV_CreateFromRW (music_wav.c:436)
==13236==    by 0x40162D6: Mix_LoadMUSType_RW (music.c:517)
==13236==    by 0x40165D2: Mix_LoadMUS (music.c:477)
==13236==    by 0x8049254: main (playmus.c:210)
==13236==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==13236== 
==13236== Process terminating with default action of signal 11 (SIGSEGV)
==13236==  Access not within mapped region at address 0x8
==13236==    at 0x405B3CA: SDL_ReadLE32_REAL (SDL_rwops.c:788)
==13236==    by 0x4042BBD: SDL_ReadLE32 (SDL_dynapi_procs.h:390)
==13236==    by 0x401A8EF: WAV_CreateFromRW (music_wav.c:436)
==13236==    by 0x40162D6: Mix_LoadMUSType_RW (music.c:517)
==13236==    by 0x40165D2: Mix_LoadMUS (music.c:477)
==13236==    by 0x8049254: main (playmus.c:210)
==13236== 
==13236== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 71 from 1)
==13236== malloc/free: in use at exit: 207,906 bytes in 809 blocks.
==13236== malloc/free: 835 allocs, 26 frees, 210,451 bytes allocated.
==13236== For counts of detected errors, rerun with: -v
==13236== searching for pointers to 809 not-freed blocks.
==13236== checked 10,955,900 bytes.
==13236== 
==13236== LEAK SUMMARY:
==13236==    definitely lost: 0 bytes in 0 blocks.
==13236==      possibly lost: 136 bytes in 1 blocks.
==13236==    still reachable: 207,770 bytes in 808 blocks.
==13236==         suppressed: 0 bytes in 0 blocks.
==13236== Rerun with --leak-check=full to see details of leaked memory.

In fact other wav files fail the same way too.

hg tip seems broken in other ways too: e.g. mp3 files don't play.

SDL_mixer configured like:  --disable-music-mod-modplug \
   --enable-music-mp3-mad-gpl --enable-music-mod-mikmod
Comment 3 Sam Lantinga 2017-10-21 10:52:06 UTC
The crash is fixed here:
https://hg.libsdl.org/SDL_mixer/rev/0a0a27bbfdb1
Comment 4 Ozkan Sezer 2017-10-21 10:56:02 UTC
> The crash is fixed here:
> https://hg.libsdl.org/SDL_mixer/rev/0a0a27bbfdb1

Thanks, it is fixed.

Now remains the issue of mp3 files not playing (mad backend.)
Comment 5 Sam Lantinga 2017-10-21 11:02:15 UTC
MP3 playback is fixed here:
https://hg.libsdl.org/SDL_mixer/rev/cac4c0288bbd

If you see other issues that aren't related to the WAVE playback, please report them separately.

Thanks!