Menu

#125 RFC on SDL speaker_on / off patch

Unstable_(example)
open
nobody
None
5
2014-04-21
2014-04-20
Andrew Bird
No

I'm hoping to remove the X dependency from the SDL plugin. This patch implements the SDL_speaker_on / off functions using the SDL audio API and moves one step closer to that goal, with the added benefit that the beep now works even when the Xserver does not have it configured by default.

Questions:
1/ I notice that the SDL audio is Opened, but in a Paused state. This patch wprks around that by saving the Pause state and restoring after speaker beep has finished. This may not be necessary.

2/ Currently the sound is set up to work with LSB endianness, does Dosemu run on ARM or other MSB platforms that we must cater for?

1 Attachments

Related

Patches: #125

Discussion

  • Stas Sergeev

    Stas Sergeev - 2014-04-20

    How about making this SDL-independent?
    I think we can have a config option to
    select either native or generated speaker,
    and put that into generic code. Then SDL
    will just turn on generated mode by default.
    The reason is that, for instance, xbell
    doesn't work right now, so the X mode
    will also benefit. Also, if someone hates
    (or doesn't have) pc-speaker, he will be
    able to configure generated speaker.


    speaker: default: "emulated", or "native" (console only) or "" (off)

    $_speaker = "emulated"


    Add also "generated"? Or what would be the
    good name?

     
  • Andrew Bird

    Andrew Bird - 2014-04-21

    Hi Stas,
    I'm not sure how it could be made generic, apart from the sine wave generation, since the stream mixing and playback are SDL specific?

    Sent from Samsung tablet

    -------- Original message --------
    From Stas Sergeev stsp@users.sf.net
    Date: 20/04/2014 22:22 (GMT+00:00)
    To "[dosemu:patches]" 125@patches.dosemu.p.re.sf.net
    Subject [dosemu:patches] #125 RFC on SDL speaker_on / off patch

    How about making this SDL-independent?
    I think we can have a config option to
    select either native or generated speaker,
    and put that into generic code. Then SDL
    will just turn on generated mode by default.
    The reason is that, for instance, xbell
    doesn't work right now, so the X mode
    will also benefit. Also, if someone hates
    (or doesn't have) pc-speaker, he will be
    able to configure generated speaker.

    speaker: default: "emulated", or "native" (console only) or "" (off)

    $_speaker = "emulated"

    Add also "generated"? Or what would be the
    good name?

    [patches:#125] RFC on SDL speaker_on / off patch

    Status: open
    Group: Unstable_(example)
    Created: Sun Apr 20, 2014 07:01 PM UTC by Andrew Bird
    Last Updated: Sun Apr 20, 2014 07:01 PM UTC
    Owner: nobody

    I'm hoping to remove the X dependency from the SDL plugin. This patch implements the SDL_speaker_on / off functions using the SDL audio API and moves one step closer to that goal, with the added benefit that the beep now works even when the Xserver does not have it configured by default.

    Questions:
    1/ I notice that the SDL audio is Opened, but in a Paused state. This patch wprks around that by saving the Pause state and restoring after speaker beep has finished. This may not be necessary.

    2/ Currently the sound is set up to work with LSB endianness, does Dosemu run on ARM or other MSB platforms that we must cater for?

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dosemu/patches/125/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #125

  • Stas Sergeev

    Stas Sergeev - 2014-04-21

    In your code it is SDL-specific.
    But it would be better not to call SDL
    functions directly. Dosemu has wrapper
    functions. pcm_allocate_stream(), then
    pcm_write_interleaved(). It will unpause
    SDL audio automatically and will do the
    rest, so there will be no need to intervent
    into dosemu event flow and unpause SDL by
    hands.
    There are usage examples all around the
    code, just grep for pcm_allocate_stream.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.