niklasekstrom / a314

A314 is a family of expansions for Amiga computers that lets a Raspberry Pi (RPi) be used as a co-processor to the Amiga
Creative Commons Zero v1.0 Universal
255 stars 32 forks source link

Create an audio device in Linux (running on the RPi) that outputs sound via Paula #20

Closed niklasekstrom closed 5 years ago

niklasekstrom commented 5 years ago

I'm not sure how hard this would be, but if possible it could be nice to make a sound device for Linux, running on the RPi, that writes the sound samples to A314 memory and then sets it up on the Amiga side so that the sound is played by Paula. I'm guessing this would allocate two of the four Amiga audio channels.

aiobofh commented 5 years ago

This would be really cool. Kind of a channel-mixer outputting 14-bit sound!? :)

niklasekstrom commented 5 years ago

It seems like it may be possible to use the ALSA file (or shm) plugin (https://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html) to obtain samples in a format suitable to write to Amiga chip memory.

This is what I've got so far for .asoundrc:

pcm.amiga {
    type plug
    slave {
        pcm {
            type file
            format raw
            file "/tmp/snd_a314"
            slave.pcm sysdefault
        }
        format S8
        channels 2
        rate 16000
    }
    hint {
        description "Changes format to match Amiga"
    }
}