I2S Encoder Empfehlung

Gast #4422099
Lesenswert?
• ▲
▼
Guten Morgen zusammen,

ich brauche einen Rat für die Auswahl eines I2S Encoders, der folgendes 
können muss:

Es muss ein Soundsample permanenet und ohne Unterbrechung abgespielet 
warden.
Zudem muss ein Soundsample in vorgegebenen Zeitabständen zusätzlich 
abgespeielt warden können. Hier muss ich die Möglichkeit haben zu sagen, 
in welchem Abstand das abgespielt warden muss.

Grüße,
Franz
#4422763
Lesenswert?
• ▲
▼
@  Franz (Gast)

>Ich hatte vergessen zu erwähnen, das ich einen Mono Ausgang benötige.
>Kann ich die beiden Ausgänge einfach zusammenschalten?

>Die Ausgänge vom I2S Encoder

>geht das mit dem zusammenschließen der Ausgänge?

MOMENT! Was brauchst du denn WIRKLICH? Einen ominösen I2S Encoder gibt 
es so gar nicht. Es gibt ICs, die I2S Datenströme erzeugen/ausgeben 
können und welche die eben diese annehmen können. Kodiert wird da 
praktisch nix, es werden nur die Daten im passenden Takt/Datenformat 
ausgegeben, relativ ähnlich zu SPI, nur eben ohne Pausen. Im 
Normalfall generiert ein uC/DSP einen I2S Datenstrom und gibt den an 
einen I2S DAC, der daraus ein Stereo-Analogsignal macht. Hast du so 
einen DAC?
Wenn nein, brauchst du auch keinen I2S Encoder. Ein Sample dauerhaft 
abspielen und ab und an ein 2. Sample mit ausgeben kann auch ein 
passender uC allein und bei nicht allzu hohen Qualitätsansprüchen auch 
allein per PWM ausgeben. Damit kann man dann direkt auf einen 
Kopfhörer gehen.

Natürlich kann man die beiden Stereokanäle zu Mono addieren, dazu 
braucht man nur 2 passende Widerstände, welche die beiden Kanäle zum 
Monokanal verbinden.
Gast #4422839
Lesenswert?
• ▲
▼
hey guys, keep calm :-)

I'm talking about an I2C device as a DAC. That means: I'm creating an 
I2S stream with my Controller and sending that to my I2S DAC device.
my question here was how I could play two separately sound samples. One 
of them is a continuously sound and the other one is frequently.
The first hint form Falk gave me idea to use the Stereo functionality 
for that. This idea is amazing easy..I like that
But at the end. I'm connecting only one Speaker, that means I would have 
a Mono device. Therefore the question, whether I can mix both out lines 
from my I2S DAC to an one "out line"

cheers, Franz
#4422868
Lesenswert?
• ▲
▼
@  Franz (Gast)

>hey guys, keep calm :-)

we are!

>I'm talking about an I2C device as a DAC. That means: I'm creating an
>I2S stream with my Controller and sending that to my I2S DAC device.

So why do you ask for an I2S Encoder?

>my question here was how I could play two separately sound samples. One
>of them is a continuously sound and the other one is frequently.

So what you are REALLY looking for is a piece of SOFTWARE to play your 
samples! An encoder is much more, like a MP3 Encoder, that does really a 
lot of work.

>The first hint form Falk gave me idea to use the Stereo functionality
>for that. This idea is amazing easy..I like that

Good! Usually the I2S module inside the uC has DMA capability, so the 
Loop of the first sample is just initialized once and plays forever 
without any CPU workload. The second sample is similar, but must be 
retriggered by the CPU when a new sample is to be played.

>But at the end. I'm connecting only one Speaker, that means I would have
>a Mono device. Therefore the question, whether I can mix both out lines
>from my I2S DAC to an one "out line"

Yes, with just two resistors as mentioned before.

Regards
Falk
Gast #4422903
Lesenswert?
• ▲
▼
Hi Falk...thanks. I'm reaching more or less my target.
One question more. Is a I2S DAC available, where I can setup them to 
play a sound sample without to send him again he I2S stream?
What I mean is a (internal)buffer from where the I2S DAC is getting the 
data for one channel. I'm looking for this kind of I2S DAC's.
#4422929
Lesenswert?
• ▲
▼
Franz (Gast)

>One question more. Is a I2S DAC available, where I can setup them to
>play a sound sample without to send him again he I2S stream?

AFAIK no, those ICs are just "dumb" DACs.

>What I mean is a (internal)buffer from where the I2S DAC is getting the
>data for one channel. I'm looking for this kind of I2S DAC's.

I would'nt count on that.

>I would like to avoid to retriggering.

Why? This is just a simple, short function, that is called inside a 
timer ISR or similar place.

> It should be enough just to
>configure the period for the particular sound sample which has to be
>played by the DAC.

P S Why the hell are we writing in english?
Gast #4422932
Lesenswert?
• ▲
▼
>my question here was how I could play two separately sound samples. One
of them is a continuously sound and the other one is frequently.

You may store the first sample in a ring buffer and send it to the I2S 
DAC in a continuous loop. To mix it with the second intermittent sample 
just add it numerically sample by sample to the loop sample before 
sending it to the DAC. In this case, you can use either the left or 
right channel of the DAC without any need of combining the analog 
outputs.
#4422945
Lesenswert?
• ▲
▼
@ Mike (Gast)


>You may store the first sample in a ring buffer and send it to the I2S
>DAC in a continuous loop.

This is easy.

> To mix it with the second intermittent sample
>just add it numerically sample by sample to the loop sample before
>sending it to the DAC.

This takes a LOT of CPU power! Not recommended! The OP is even to lazy 
or shy or whatever to retrigger the second channel!

> In this case, you can use either the left or
>right channel of the DAC without any need of combining the analog
>outputs.

What do you yield from this? There is no refund for the unused stereo 
channel!
Gast #4422959
Lesenswert?
• ▲
▼
Ich möchte soweit wie möglich die CPU entlasten. Das ist der einzige 
Grund warum ich gerne einen Buffer im DAC device hätte, der nach 
vorgaben den Inhalt des Buffers "selbstständig" im vorgegebener Periode 
abspielt.
Ich denke das alleinige triggern und die Daten per DMA übertragen, 
dürfte doch nicht ein großer akt sein.

Danke für die infos.
#4422964
Lesenswert?
• ▲
▼
Aus welchem Grund wird jetzt hier plötzlich mit englischen Händen und 
Füßen kommuniziert?

Franz schrieb:
> Es muss ein Soundsample permanenet und ohne Unterbrechung abgespielet
> warden.

Ich vermute, das spielt dann im Loop.
Wie lange ist denn dieses Sample?

Franz schrieb:
> Zudem muss ein Soundsample in vorgegebenen Zeitabständen zusätzlich
> abgespeielt warden können.

In welchen Zeitabständen?

Muss es zu jedem beliebigen Zeitpunkt abspielbar sein, oder kann man es 
mit dem Hintergrund-Loop synchronisieren?

Dann bräuchtest du im Grunde nur 2 "vorgemischte" Samples:
- Hintergrundsound
- Hintergrundsound + zusätzliches Soundsample

Dann musst du auf der Hardware nicht mehr mischen.


Welche Audio-Qualität möchtest du denn erreichen?
Es gibt natürlich auch so Sound-Chips (Diktiergeräte-mässig), die 
selbstständig einmal einprogrammierte Sounds abspielen können.
Evtl. wäre soetwas ja geeignet.
#4423080
Lesenswert?
• ▲
▼
@ Franz (Gast)

>Ich möchte soweit wie möglich die CPU entlasten.

Prinzipiell immer ein guter Ansatz.

> Das ist der einzige
>Grund warum ich gerne einen Buffer im DAC device hätte, der nach
>vorgaben den Inhalt des Buffers "selbstständig" im vorgegebener Periode
>abspielt.

Gibt es nicht.

>Ich denke das alleinige triggern und die Daten per DMA übertragen,
>dürfte doch nicht ein großer akt sein.

Das ist ein Klacks! Die Funktion dauer auf einem 0815 uC vielleicht 
10us, ggf. weniger!

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.