[Vm-dev] re: Mac OS Cocoa MIDI Plugin

Eliot Miranda eliot.miranda at gmail.com
Wed May 18 12:43:31 UTC 2016


Hi Craig,

> On May 18, 2016, at 2:28 AM, Craig Latta <craig at blackpagedigital.com> wrote:
> 
> 
> 
> Hi--
> 
>     Eliot writes:
> 
>> I'm a bit wary of using it on linux because it claims to be
>> implemented above ALSA and IME ALSA is poor, especially w.r.t.
>> signals. But it looks like a good solution for Mac and Win.
> 
>     Does this mean you would rather use OSS than ALSA? As far as I
> know, ALSA is the current supported audio device driver framework for
> Linux, supplanting OSS.

I just want things to work ;-). I remember the issue now.  First, Cog on Linux in 2010 had to use the itimer heartbeat because pthreads only supported one priority, and so the heartbeat couldn't be a thread. The itimer heartbeat works by delivering signals, and ALSA didn't cope with interrupted system calls.  Second, the X11 GUI and socket i/o depend on delivering SIGIO and ALSA interfered with signal delivery.  When ALSA loaded it installed its own SIGIO handler but didn't check for any previously installed handler and so broke the system.

To fix these two problems I had to maintain my own corrected version of the ALSA code, we were under time pressure and this was quicker than trying to engage the ALSA author(s) to correct the code.

So if ALSA is the only game in town I guess we must get the code fixed.  How is ALSA maintained and by whom?  Is the code still broken as described above?


> 
>     PulseAudio is not a device driver framework. It's a multi-platform
> sound server which processes audio as it passes between an application
> and device drivers (e.g., stream the audio over a network or to another
> local application). It does provide an abstract API for the host
> platform audio device driver frameworks it uses, but on Linux the audio
> device driver framework it uses is ALSA.
> 
>     I found an enlightening and sad summary of the Linux audio
> processing architecture[1] which, although written in 2010, seems to
> jibe with the current Wikipedia pages for ALSA[2], PulseAudio[3],
> JACK[4] (another sound server), and OSS[5], and with a similarly sad
> Linux MIDI summary[6].

Il try and find time to read this.  Care to summarize?

> 
>> Is there anything to stop you following Bert's suggestion of
>> reimplementing the MIDIPlugin's support in terms of PortMIDI?
> 
>     Indeed no, that's what I was suggesting.
> 
>     Tim writes:
> 
>> The latest release of Raspbian has added some support for bluetooth
>> sound and apparently this has some great cosmic fight with ALSA that
>> makes a Micheal Bay movie look like a Beatrix Potter story.
>> 
>> Let’s see if I can find a more coherent explanation (warning - I know
>> too little about most of this to really judge ‘coherent’ very well)
>> 
>> From Simon Long @ Pi central - "One thing that has been added to this
>> image is support for Bluetooth, which includes audio output over
>> Bluetooth. Unfortunately, the BlueZ stack does not support audio over
>> ALSA; the only way to get audio out to it is via PulseAudio, and it
>> is impractical for various reasons to move all our audio support
>> across to Pulse. This means that, for the time being, there is a
>> rather kludgey hack implemented (by me, to my eternal shame…) in the
>> LXPanel audio selector which starts PulseAudio when a Bluetooth
>> device is selected (which also breaks ALSA) and then kills PulseAudio
>> when a non-BT device is selected (which then unbreaks ALSA).
> 
>     This implies that Raspian's PulseAudio implementation is broken,
> and the cosmic fight between BlueZ and ALSA isn't a good excuse. :)  And
> of course BlueZ is broken as well.
> 
>> So would pulseaudio save us from all this?
> 
>     No. :)  I would just live with Simon's BlueZ hack for now.
> 
> 
> -C
> 
> [1] http://tuxradar.com/content/how-it-works-linux-audio-explained
> [2] https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture
> [3] https://en.wikipedia.org/wiki/PulseAudio
> [4] https://en.wikipedia.org/wiki/JACK_Audio_Connection_Kit
> [5] https://en.wikipedia.org/wiki/Open_Sound_System
> [6] http://www.tedfelix.com/linux/linux-midi.html
> 
> --
> Craig Latta
> Black Page Digital
> Amsterdam
> craig at blackpagedigital.com
> +31   6 2757 7177 (SMS ok)
> + 1 415  287 3547 (no SMS)


_,,,^..^,,,_ (phone)


More information about the Vm-dev mailing list