MacOS Audio not fit for purpose!

About Monkey 2 Forums Monkey 2 Development MacOS Audio not fit for purpose!

This topic contains 14 replies, has 3 voices, and was last updated by  AdamStrange 1 year, 7 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #10483

    AdamStrange
    Participant

    Just been doing some audio stuff and getting really unhappy about the continued audio problems on MacOS

    This is in regard to ALL loaded samples having the beginning few microseconds being cut off before playing.

    So playing a drum sound will miss the first few milliseconds of playback and thus clip the sound at the beginning resulting in sound not being played correctly.

    Until this is properly fixed I can NO recommend Monkey2 sound as fit for purpose (on MacOS)

    Mark – you already know about this issue. are you actually going to address it?

    #10492

    Mark Sibly
    Keymaster

    Can you post a sample you are having problems with?

    This is playing something that sounds a lot like a sine wave, which would suggest it’s not actually a playback problem:

    #10493

    Mark Sibly
    Keymaster

    …also works fine with 44100hz, even short sample data lengths such as 32.

    I had assumed this was a macos openal bug, looks like I was wrong.

    #10495

    Simon Armstrong
    Participant

    .

    #10496

    Simon Armstrong
    Participant

    even more odd, changing n to 8192 produces a bit of noise, silence and then a wallop for each sound.Play

    #10497

    Mark Sibly
    Keymaster

    But you can still hear something? I’m stuck with crappy monitor HDMI audio (through a KVM!) and with 64 samples I can hear a noticeable ‘click’ here, which I don’t find particularly surprising as the sound is only playing for 1/11025*64, ie: ~6ms!

    Not quite sure what everyone’s expecting here…

    #10498

    Mark Sibly
    Keymaster

    Updated my sine wave code so you can try different lengths. Like how stereo is definitely louder than mono!

    Do you hear a steady sine wave with n=8192?

    As for your code, not sure you can just throw some numbers at audio and then say ‘thats wrong’ (well, with my level of experience anyway). I just noticed that setting data to ‘0’ produces a noticeable click when it stops. I assume this is because 128 is really 0 as mono8 is unsigned – changing 0 to 128 prevents this click. I guess it’s the transitions that count with audio.

    I am still not convinced there’s actually any problem as yet.

    #10499

    Mark Sibly
    Keymaster

    What’s a ‘wallop’? Pehaps the 0->128 click at the end?

    #10500

    Simon Armstrong
    Participant

    Ignore me and my dumb posts, forgot it was unsigned. 🙁

     

    The numbers were suppose to generate a short burst of a 440hz sawtooth then silence which I was thinking would be louder / easier to hear than sin wave for very short durations.

    #10509

    AdamStrange
    Participant

    I am using loaded audio, not generated.

    mono, 16 bit

    Here’s a demo app showing exactly what is going on…

    #10510

    AdamStrange
    Participant

    here’s the zip file with the two different samples

    Attachments:
    1. audiotest.zip
    #10520

    Mark Sibly
    Keymaster

    Ok, I can reproduce this, but I have no idea what’s up, except that it doesn’t seem to be in monkey2 code.

    Openal (and quick time) don’t seem to like the sample at all. I get very much the same problem if I play it with quicktime, except it works first time. Also, playing in Ted works sometimes when you loop it or repeat it, sometimes not.

    If I blast over the first N bytes of the sample with a sine wave, the sine wav plays OK so it’s not that the audio driver isn’t playing the first N bytes, it’s just playing them wrong!

    I will keep looking into this, but to be honest it may be a while before there’s a solution as it may involve writing a completely new driver from scratch, so go ahead and tell everyone monkey2 sucks on macos in the meantime! There are no such problems on windows anyway.

    Perhaps try a different sample?

    #10521

    Mark Sibly
    Keymaster

    Success!

    I tried a 3rd party openal.dylib instead of the system openal framework and it fixed the kick.wav issue!

    Will add this for the next release, mx2cc needs some changes too to be able to import dylibs properly.

    #10523

    AdamStrange
    Participant

    Brilliant 🙂 🙂 :}

    just so you know. the sample used was just picked by random. all other samples exhibit the same issues. also the same when creating sounds from imported AudioData too

    #10525

    AdamStrange
    Participant

    Mark, heres a thought…

    If you are going to make some changes to support dylibs. would it be possible to support dylib creation within monkey2?

    That way, we could compile and recompile the openal dylib directly and also possibly sort out future stuff like effects?

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

You must be logged in to reply to this topic.