Giter Site home page Giter Site logo

Comments (7)

r-lyeh-archived avatar r-lyeh-archived commented on May 16, 2024 1

Another PD licensed solution here https://github.com/dr-soft/mini_al

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

I'll try implementing this today, assuming I can successfully use WSL on Windows to test it out.

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

Hmm, looks like ALSA is not supported with WSL. I'll try virtual box then.

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

@r-lyeh Alright, I've got a basic port going. Though there are some problems.

  1. When I first boot up my machine and run the ALSA demo, there's a segfault. I have no idea why. It only happens the first time the program is run after a machine restart. Which makes it very annoying to debug. And unfortunately the segfault occurs after some audio starts playing.
  2. Timing is all weird. I have no idea why. This could be because of usleep, or because I have a low-end machine in my virtual box, or because the ALSA handling is poor. I really am not sure. I don't currently understand very well how timings with ALSA work, in terms of feeding in the correct number of samples over a period of time. I fear I might be mixing in too much silence when no audio is playing, causing a time warp effect where silence can be really long or shorter randomly.

Anyways, I'm going to call it good enough for now. Maybe someone else will have a little more knowledge about ALSA and comment here, by the time I take another look.

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

My main reference for implementation came from SDL: https://github.com/spurious/SDL-mirror/blob/17af4584cb28cdb3c2feba17e7d989a806007d9f/src/audio/alsa/SDL_alsa_audio.c

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

Hmm, looks like there's a callback API I completely missed. ALSA can probably be setup just like CoreAudio and SDL, which might be a lot easier than the current strategy. I found a nice page to reference for this: https://alsa.opensrc.org/Asynchronous_Playback_(Howto)#Initializing_the_Callback

from cute_headers.

RandyGaul avatar RandyGaul commented on May 16, 2024

Going to nix this and just stick with SDL2 backend for Linux.

from cute_headers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.