<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Hey,<br></div><div><br></div>Paul,
 the only clock I care about is the FPGA clock, so if I can tell JACK to
 use my clock and just ignore ALSA, that would be fine.<br></div>But that probably involves writing a JACK backend, which is probably not much easier than writing an ASLA driver.<br><br></div>Chris, I was unaware of I2S, it seems perfect for our purpose!<br></div>Thank you! That probably saves me a ton of trouble.<br><br></div>I looked into I2S support on the Raspi and the BBB a bit, and found surprisingly little.<br></div>For
 the Raspi there seem to be some device tree overlays for specific ADC 
and DAC boards, but it's unclear how to use for our custom FPGA.<br></div>For BBB it seems to be supported somehow, but not much info on how to actually use it.<br><br></div>My main concern is that I need more than two input channels and at least one output channel.<br></div>I'm unable to find out if either board supports more than one I2S device (each device can be stereo it seems)<br><br></div>Regards,<br></div>Pepijn<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 11, 2018 at 2:45 PM, Chris Obbard <span dir="ltr"><<a href="mailto:chris@64studio.com" target="_blank">chris@64studio.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">Hi Pepijn,</div><div dir="auto">Why not make the FPGA talk i2S to the Raspberry Pi?</div><div dir="auto">There is already a neat SoC driver there that can do a couple of channels.</div><div dir="auto">The beagle bone I2S is a lot more comprehensive.</div><div dir="auto"><br></div><div dir="auto">Why reinvent the wheel?</div><div dir="auto"><br></div><div dir="auto">Cheers!</div><div dir="auto">Chris</div><br><div class="gmail_quote"><div><div class="h5"><div>On Sun, 11 Mar 2018 at 13:36, pepijn de vos <<a href="mailto:pepijndevos@gmail.com" target="_blank">pepijndevos@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>For a university project we're building a custom audio system with our own input and amplifier.<br></div>We will most likely use an FPGA that communicates sound data over SPI to a Raspberry Pi.<br></div>On the Raspberry Pi the sound can be further processed by for example Sonic Pi.<br><br></div>Sonic Pi uses SuperCollider which uses JACK which uses ALSA.<br></div>At some point in this chain we need to be able to interface with our FPGA.<br><br></div>Initially I thought it would be easy to write a JACK client, and it is.<br></div>The problem with that seems to be that JACK is in control of the sampling rate.<br></div>So if I read data from the FPGA into a buffer and the clocks drift, I get overruns or underruns.<br><br></div>I found a few potential solutions.<br>What alsa_in and alsa_out do is resample between the two clocks. Maybe a bit of work, but definitely works.<br></div>There is some business about clockmaster in JACK, which seems to be something different, but maybe I don't understand it.<br></div>There
 is a freerunning mode, which makes it OK to do IO in the callback. I'm 
not sure if this plays well with SuperCollider. It seems that in this 
case the processing is directly driven by how fast I get data from the 
FPGA, which is what I want.<br><br></div>If all of the above turns out to be bad ideas, I need to look at a different location in the chain.<br></div>It would make sense to write an ALSA driver for what is pretty much a custom sound card.<br></div>However, it seems that writing an ALSA driver is orders of magnitudes more complex than registering a callback with JACK.<br><br></div>Any ideas what would be the easiest way to get sound from our FPGA into SuperCollider and back?<br><br></div>Regards,<br></div>Pepijn de Vos<br></div></div></div><span class="">
______________________________<wbr>_________________<br>
Linux-audio-user mailing list<br>
<a href="mailto:Linux-audio-user@lists.linuxaudio.org" target="_blank">Linux-audio-user@lists.<wbr>linuxaudio.org</a><br>
<a href="https://lists.linuxaudio.org/listinfo/linux-audio-user" rel="noreferrer" target="_blank">https://lists.linuxaudio.org/<wbr>listinfo/linux-audio-user</a><br>
</span></blockquote></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr" class="m_7325005814382532864gmail_signature" data-smartmail="gmail_signature">Thanks,<br><br>Christopher Obbard<br>64 Studio Ltd.</div>
</font></span></blockquote></div><br></div>