Results 1 to 7 of 7

Thread: Lowest latency audio out, and midi in under linux for FPC?

  1. #1

    Lowest latency audio out, and midi in under linux for FPC?

    Any API recommendations on this -- I need ASIO style latency (50ms or less), in a API that will work under Raspbian or a similar RPi distro. I've tried SDL, and it's not even CLOSE to what I need on the Pi... to get down where I need the buffer size has to be around 128 bytes, which the pi just can't keep up with. I'd like to use Jack, but I can't find any decent API bindings for it and lack the time or ambition to write one... and I'd really prefer NOT to switch to C++... though again, I may end up having to.

    ... and MIDI under Linux I can kind-of do, but looking for a better way to do it -- and does anyone have any experience/advice when it comes to MIDI over USB on Linux? MIDI on Linux is poorly documented to begin with -- I can't find anything about MIDI over USB at all.

    BTW, this would be a command line app, so if you point at something that needs X11 up and running... uhm, no.
    The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure

  2. #2
    Bah, looks like I'm going to end up using GCC and ALSA... I hate C. Hell, the re-re example code for enumerating sound devices in ALSA alone shows why I hate C programmers... and to think most of them have the cojones to say BASIC makes spaghetti code.
    The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure

  3. #3

  4. #4
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    JackD is a low latency audio mixing framework, kind of like a mixing desk for audio applications. It's not a hardware interface but does itself use ALSA etc

    It's a kicker because I actually wrote full Jack headers for pascal last year and then lost them when decided to try a new linux distro one day. (they're actually tiny, only took a day or two)

    ALSA as far as I'm currently aware has pascal headers in the form of ALSAPAS. They've not been update for a while so you may find some more exotic functionality missing (perhaps with midi etc) but the basic functionality - Audio Buffer cycle etc should be fine.

    You're highly unlikely to get ASIO like performance or anywhere near on a raspberry PI. It does however depend on many factors, primary in your case will be the audio chip the PI comes with. inbetween you and the sound-card there are a number of buffers, your apps, ALSA, the hardware etc.

    The final latency being a combination of these three, you might have a limit you can't change or you might find that the CPU simply can't process the audio frames quickly enough.

    ASIO (to my current limited understanding) is capable of such low latency because A) you're writing directly into the hardware buffer or as close as the drivers will let you B) is set up in such a way that you're writing new data on a knife edge with no OS imposed delays etc note that ALSA, WaveOut, DirectSound etc are designed to provide smooth audio output on a wide range of performance profiles where as ASIO is studio-grade stuff that assumes a fairly quick CPU.

    --

    All that said it still may be possible, but I should imagine it's going to be some hardcore direct interface with the sound chip or some special ALSA/Kernel functionality I'm not aware of.

    The PI is a popular piece of kit, I should imagine that audio-processing is being pursued by many people so you're definitive answer one way or the other is probably out there by now.
    Last edited by phibermon; 28-08-2012 at 05:12 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  5. #5
    I ended up finally finding an up to date ASLA translation
    http://fpalsa.sourceforge.net/

    Probably going to test it on the pi this coming week... Right now I'm knee deep in woodworking a case for a project based around a teensy++

    First version is just getting a teensy, the second version is probably going to use a teensy and the pi. I'll be posting up details on said project soon enough.
    The accessibility of a website from time to time must be refreshed with the blood of designers and owners. It is its natural manure

  6. #6
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Nice find there with fpalsa deathshadow. Been looking for something of the sort for all eternity so thanks a ton
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  7. #7
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    nice find on the updated headers, thank you! I might do the jack headers again one of the days so I'll post if I do.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •