This topic contains 10 replies, has 0 voices, and was last updated by  Chomsky 13 years, 6 months ago.

  • Author
    Posts
  • #2642

    cbx550f
    Participant

    Recently installed S3D, and I must say it’s horrifyingly addictive. The sound is working like crap – but I keep on playing it! 😉

    Not sure how to describe the sound issue, but it sounds very, er, VIC-20…. quite broken with bad “digital distortion”.

    Recompiled sdllib and sdl-mixer – no change, recompiling S3d now… just was watching the configure script run, and saw this:

    checking for SDL - version >= 1.2.5... yes
    checking for SDL_mixer lib... yes
    checking for SDL_net lib... yes
    checking for beer in -lfridge... no
    Warning: No beer found in fridge!
    We highly suggest that you rectify this situation immediately.
    checking for OpenGL support... yes

    ROTFL! – going to get beer when done this post.

    Anyway, I’m running:
    Gentoo, 2.6.6 Kernel
    oss sound, sdl 1.2.7
    Celeron 1.3 GHz, 1/2 Gig RAM
    C-Media CM8738 Audio
    GF4-MX440

    Any thoughts?

    I get about 30-40 fps with everything cranked – a bit jerky during major action, but looks great!

    cbx

    [edit] Also, I played the wavs in another player – they work perfectly [/edit]

    #11819

    imported_gcamp
    Participant

    If you are compiling yourself you could try editing the file src/common/Sound.cpp
    and changing the
    Mix_OpenAudio(11025, AUDIO_U8, 1, 512) line
    to
    Mix_OpenAudio(11025, AUDIO_U8, 1, 2048)

    or something like that and see how it goes.

    #11820

    DeVice
    Participant

    This seems to be a system dependent problem with sdl_mixer.

    Using the patch gavin recommended, you can try all the powers of 2 values, the lower the better because higher values would delay sound playing.

    I mean, if 1024 stops the sound from being choppy, don’t go to 2048.

    #11821

    imported_gcamp
    Participant

    I will make this configurable via the display.xml file.

    #11822

    cbx550f
    Participant

    Okay, I finally got it to go – I tried your suggestions, but they didn’t do it – VERY close however. I took a look at the sound files, and found that they are 16 bit samples – changed the aforementioned line to:

    if ( Mix_OpenAudio(11025, AUDIO_S16SYS, 1, 512) < 0 )

    And it sounds great!

    Thanks for the help, and from the little bit I have looked at the source, it is very clear and easy to read. Good work!

    cbx

    #11823

    Anonymous
    Participant

    Ah interesting, thanks for the report, i’ll give that fix a try for FreeBSD too.

    #11824

    imported_gcamp
    Participant

    By jingo your right, I did change all the wavs to 16 bit, cheers.

    #11825

    cbx550f
    Participant

    Thanks for the help, Gavin.

    Really enjoying the game – appreciate the work. 🙂

    /cbx

    #11826

    DeVice
    Participant

    Your fix (using AUDIO_S16SYS) remove the need for the previous solution we were using (upping 512 size to 2048) for FreeBSD.

    I think it is the best fix, Gavin will prolly want to use that one.

    Thanks again cbx 🙂

    #11827

    cbx550f
    Participant

    Very happy to have helped, Dev.

    I’m still wondering about one thing, should it be “S16SYS” or “S16LSB”? I’m *thinking* that “S16SYS” should be the way to go, as in SDL_audio.h it figures out whether to use “S16MSB” or “S16LSB” depending on the endianness of the architecture:

    /* Native audio byte ordering */
    #if SDL_BYTEORDER == SDL_LIL_ENDIAN
    #define AUDIO_U16SYS AUDIO_U16LSB
    #define AUDIO_S16SYS AUDIO_S16LSB
    #else
    #define AUDIO_U16SYS AUDIO_U16MSB
    #define AUDIO_S16SYS AUDIO_S16MSB
    #endif

    I know “S16LSB” works on my x86 (I tested it), but not 100% sure which is right for Sparc or Mac, which are big-endian.

    I can test it on my UltraSparc, but not for a day or so (just started a re-install)

    Cheers!

    cbx

    #11828

    imported_gcamp
    Participant

    Yeah I am not sure about this.

    It does say in the docs that the default format is AUDIO_S16SYS so perhaps we should just stick with that. I can test the audio on my solaris box if I remember 🙂

    #11829

    Chomsky
    Participant

    Great fix, cbx!
    😀

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.