[Proposal] I2S interface for audio

Hello sailors!
In order to develop interfaces that are compatible with audio standards, I think an I2S interface would be desirable, either alongside or as a replacement for I2C or I3C.
Is anyone else interested in this topic apart from me, and do you think it should be discussed at a future community meeting?

I look forward to hearing from you!

8 Likes

I’m not sure there’s enough space to accommodate both interfaces, nor am I sure about the pin-out options for this one (as I’m not familiar with the daughterboard’s circuit diagrams).
But I imagine the audio functions could also be integrated via an internal USB-C port, if there’s a way to splitter that port.

In short, these are just a few ideas which, in my view, would be worth exploring! :slight_smile:

I thought iÂłc could transfer sound?

Turns out no it cannot.

But I got idea in the back of my head, what if you transfer music via i³c to MCU that then plays it via i²s? xd

6 Likes

Connecting the phone over i²s to a DAC with i²s, I like the idea.

1 Like

I am generally interested, although I am not sure if i2s over those pins will be possible. You need one more pin and they might be hardwired to do i3c. However it might be possible to put a small controller in between to “convert” i3c to i2s. There are a few, that speak both and could be coded to receive bytes over i3c, then output them over i2s, but it adds quite a bit of complexity.

https://www.microchip.com/en-us/product/dspic33ak256mps306#Overview for example.

4 Likes

Managing this type of component is indeed very complex, not to mention that we’d only be using a tiny fraction of its capabilities.

But that does seem like a likely solution…

I’m meeting a friend who’s an electronics developer in two days’ time (specialising in audiovisual and event communications, and who also runs a company developing audiophile hardware solutions); I think we’ll have some good discussions about this interface and the possibilities for data transfer via I3C or I2S.

From the initial information he’s sent me, it’s possible via I2C by repurposing the interface’s primary function, but the quality is absolutely dreadful. He hasn’t used I3C yet as it’s of little use for his needs.

Perhaps I3C could improve things – I imagine by encapsulating the audio stream and a clock signal, provided the data rates are significantly higher.

There are a multitude of I3C interfaces available and, depending on the standards, the bitrate can vary considerably.

We’ll have to see; I’ll keep you informed as soon as I know a bit more…

7 Likes

Maybe join forces with Idea: standard protocol for MCU-based TOHs ?

1 Like

Recommended reading, as it goes into important details that I initially glossed over.

Related, since I imagine USB and I3C share some challenges (like asynchronous transfer, buffering and clock skew). Anyone who knows what tricks make audio over USB possible, and if they would apply to I3C as well?

3 Likes

You forgot Bluetooth! :wink:

We are talking about a MCU or FPGA running specialised firmware, which translates between I3C and I2S. I suppose that during the start of an audio stream, the controller (Jolla Phone) would tell the target (I3C-to-I2S translator) which clock speed to use on the I2S side and then just blow the audio data itself via I3C into the buffer of the translator. Unless it receives a new command with a changed clock speed, the translator would then just blow the audio data from its buffer into the DAC on the I2S side using the clock speed specified at the start of the audio stream.

I guess that USB and Bluetooth do it in a similar way: “Use this clock speed for all following data, until I tell you to change the clock speed again.”

2 Likes

I2S is just a protocol over the same interface as I2C, using SDA/SCL. In general, I2S is just a driver but the interface layer I2C with sugar. I haven’t tried using the I2C bus AND I2S but suspect that’ll not work well. I have a number of boards (embedded mcu, esp/stm/pico) that utilize I2S and they are simple to operate. EDIT, clock is completely different in I2S drivers and sharing the bus while in theory possible, would be tricky. I found some custom (esp) implementations of I2C that are claimed to work with an I2S dac on the same bus (ie. SDA/SCL pins).

EDIT, I’m talking shit. While I position overlapping SDA/SCL pin usage for I2S and I2C (dac and a OLED display) there is, of course, a third pin used for I2S. Common definitions being. BCLK, LRCK. SDATA so it’s not in any case 1to1.

I should add that using I2S for an audio CODEC is the main application I’m interested in developing a TOH for. EDIT: so it doesn’t look like I2S will be possible with the pogo pins without an intermediary MCU. Not tragic, I guess, just more work.

5 Likes

There is some kind of a working group for I3C audio. They have published a couple if specs, but a casual search for DAC or controller chips yielded nothing.

1 Like

Yeah, it’s also looking like TOH is not going to be an audio interface option. The amount of work on both the phone end and hardware end doesn’t really make sense. Back to the drawing board.

2 Likes

Having read through the various comments from each of you, I can see that you have the same information as I do.
Here is the audio developer’s response when the subject was raised:

  • I2S via I2C or I3C is not possible without a colossal amount of work. @Poetaster has summarised the problem well.
  • Audio via I2C or I3C is very difficult, with significant signal degradation and requiring substantial development resources too.

There are two more cost-effective solutions:

  • using USB + DAC. This is something many have already discussed. The issue of integration arises in the absence of an internal USB port, both in terms of functionality and form factor
    – using at least the AptX Bluetooth protocol to maintain the quality of the data stream. With this solution, which seems to me to be the simplest to implement (whilst retaining the use of the external USB port), there is the issue of the type of Bluetooth chip embedded in the phone; we do not have the details to know whether it supports AptX…
    But that might be a line of inquiry worth exploring! :blush:

After all, this person is human. Knowing him, he won’t spend 10 years (exaggerating, of course) developing something that will be of mediocre quality (by his standards – he has high expectations) and that wouldn’t be profitable. He clearly favours intermediate solutions, including Bluetooth transmission, which – for him, using at least aptX or even aptX Lossless – is an effective and easy-to-develop solution, and one whose quality is now perfectly acceptable.

Edit: the idea was to use I2S to create an interface for a 3.5mm jack; the answer is intended for this purpose

3 Likes

Using Bluetooth for solving this problem sounds interesting and indeed seems to be the most simple solution:

  • Since the source (Jolla Phone) and the sink (BT-to-DAC chip or BT-to-I2S chip) are physically close to each other, the transmitter power and receiver sensitivity can be significantly lowered. This not only saves energy, but should also make the whole thing work reliably even in busy environments with many other active Bluetooth devices around. Using a demanding protocol like aptX Lossless seems to be a logical consequence then - if the Bluetooth chip inside the Jolla Phone supports it.
  • I guess there are Bluetooth audio chips for either direct analogue output or digital I2S output available (or maybe even both at the same time). In the latter case, one can then connect a common DSP or DAC chip of their preference to the sink.
  • The I3C/I2C bus of the TOH still does all the detection and identification stuff. In addition, it can maybe also be used for automatically pairing the Bluetooth sink inside the TOH with the phone. Meaning: When the user attaches the TOH, the sink will automatically show up as a paired and active audio device in Settings. The user then just needs to enable Bluetooth from the Top Menu and is ready to play some tunes.
4 Likes

Here’s another take on the I3C audio problem. I’m assuming that the SCL comes from one of the phone SoC’s clock domains. How about setting it at a “good multiple” of the sample rate? Say 256x.

Then it just takes a counter in the TOH to derive a clock for the DAC and that clock is in lockstep with the phone side of things.

It still takes an audio driver that understands this arrangement, so some kernel work needed, I suppose.

256x is a bit on the too steep side. If your doing multi-track mastering you’ll probably use 192kHz for the headroom. For stereo, which is about as far as I’m going to go, 96kHz is more than enough. But the TOH should just be passing SCL through on the wire.

1 Like

I’m not so fond of the idea of using bluetooth, though that might be a way to go. I’m more inclined to using a USB to I2S bridge which is a bit more direct. EDIT, something like silicon labs cp2615 https://www.silabs.com/documents/public/application-notes/an1044-cp2615-customization-user-guide.pdf EDIT, EDIT, nope. That’s a dead end :slight_smile:

Yeah, I was just mulling over how to get around the clock skew problem we discussed before, and realized that we do have a clock available that emanates from the SoC. If it is kept at a convenient multiple of the sample rate, it would be easy to feed the DAC from a buffer.

1 Like

Depends on what you’d like to do with a TOH, of course. A TOH that provides a 3.5 mm jack by occupying the single USB connector? I’d probably just use a USB dongle then. OTOH a soundtoy TOH would be make sense.

1 Like