Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Micromite eXtreme: HD Audio - PLAY FLAC Post ReplyPost New Topic
Page of 2 Next >>
Author
Message << Prev Topic | Next Topic >>
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2855
Posted: 03 March 2017 at 2:56pm | IP Logged Copy link to clipboard   Quote matherp



Release 5.3.10 for the 64, 100 and 144-pin MZs now supports FLAC playback over I2S

Supported frequencies are:

44100Hz 16-bit(CD quality) and 24-bit
48000Hz 16-bit and 24-bit
88200Hz 16-bit and 24-bit
96000Hz 24-bit
192000Hz 24-bit (252MHz only)

I2S Dacs are cheap and readily available. In the picture I'm using this one

Other versions include this and this

The command syntax is simplicity itself

PLAY FLAC "flacfilename" [,interruptwhenfinished]

so exactly the same as "PLAY WAV". The command is non-blocking and

PLAY PAUSE, PLAY RESUME, and PLAY STOP work as expected

Volume control is not available on FLAC files. With high definition audio volume should really only be controlled at the analogue stage.

Connections to the DAC are as follows:

MCLK - SPI3-IN (this is re-configured as an output of the clock signal and runs at 128 to 512 times the frame clock depending on the frequency allowing the DAC to oversample.
DATA - SPI3-OUT
SCK (Bit-Clock) - SPI3-CLK
LRCK (Frame-Clock) - pin-97 on the 144-pin, pin 68 on the 100-pin

All these pins are available on the SPI3 header on the Backpack144

Connections for the 64-pin chip are as follows:

MCLK - Pin-13
DATA - Pin-45
LRCK - Pin-30
SCK - Pin-29

For DACs with an inbuilt MCLK this connection can be omitted.

The functionality on the 64-pin chip would allow a very nice HD-audio touchscreen MMX-pod to be built

For anyone not familiar with the FLAC music format see wikipedia. FLAC is MP3 done properly

The FLAC codec was ported from the work of David Reid to whom great thanks are due

Edited by matherp on 03 March 2017 at 5:57pm



Back to Top View matherp's Profile Search for other posts by matherp
 
plasma
Guru
Guru


Joined: 08 April 2012
Location: Germany
Online Status: Offline
Posts: 437
Posted: 03 March 2017 at 9:25pm | IP Logged Copy link to clipboard   Quote plasma

great Matherp, thx a lot.

is it possible to get support for mp3 and wav even over i2s , to get only one audio way?
Back to Top View plasma's Profile Search for other posts by plasma
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2855
Posted: 03 March 2017 at 10:37pm | IP Logged Copy link to clipboard   Quote matherp

Quote:
is it possible to get support for mp3 and wav even over i2s , to get only one audio way?


mp3 no: too much code and tables to support all the variants
wav: doable but why? easy to convert to flac which is also lossless on the source device
Back to Top View matherp's Profile Search for other posts by matherp
 
Zonker
Guru
Guru
Avatar

Joined: 18 August 2012
Location: United States
Online Status: Offline
Posts: 708
Posted: 04 March 2017 at 3:00am | IP Logged Copy link to clipboard   Quote Zonker

Wow..! I didn't know you could put that kind of stream rate down the I2C hole..!
So, we can not write a player "front end" for this.. (sweet)..
Back to Top View Zonker's Profile Search for other posts by Zonker
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6774
Posted: 04 March 2017 at 3:22am | IP Logged Copy link to clipboard   Quote Grogster

Wow......

That is awesome - I will HAVE to play with that. Pun intended.

matherp wrote:
For anyone not familiar with the FLAC music format see wikipedia. FLAC is MP3 done properly


LOL!

Dammit.
Does that mean I have to re-encode all my CD's to FLAC?!

Joking aside, that is probably not a BAD idea, frankly.
They are all mostly as 128kb MP3, which is lossy as hell with the HF.
As I understand it, even 320kb MP3 is still not totally lossless as FLAC is, so perhaps now is the time to re-encode my entire library.....

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 920
Posted: 04 March 2017 at 6:17am | IP Logged Copy link to clipboard   Quote CaptainBoing

Grogster wrote:

... so perhaps now is the time to re-encode my entire library.

that really won't be as much fun as it sounds... I did this a couple of years ago... thinking "yeah that'll be great to go through all my old stuff again"

It gets old really quickly

Got about a third in and still needs finishing


Edited by CaptainBoing on 04 March 2017 at 6:18am
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6774
Posted: 04 March 2017 at 7:36am | IP Logged Copy link to clipboard   Quote Grogster

Heh, heh!

Yeah, I hear that.

I have a few hundred CD's, so it probably would get old very quickly as you say.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
bigmik
Guru
Guru
Avatar

Joined: 20 June 2011
Location: Australia
Online Status: Offline
Posts: 2172
Posted: 04 March 2017 at 8:06am | IP Logged Copy link to clipboard   Quote bigmik

GDay Zonker,

Zonker wrote:
Wow..! I didn't know you could put that kind of stream rate down the I2C hole..!


It is actually I2S not I2C.. Yeah I had to look it up as well

Details of I2C and I2S HERE!!

@Peter,
Fantastic work... Do you not ever sleep?

Regards,

Mick

__________________
Mick's uMite Stuff can be found HERE

Back to Top View bigmik's Profile Search for other posts by bigmik
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2855
Posted: 04 March 2017 at 9:19am | IP Logged Copy link to clipboard   Quote matherp

Quote:
Does that mean I have to re-encode all my CD's to FLAC?!


FLAC or ALAC : that way you are future proof. I hate mp3 with a passion: invented by computer scientists who clearly don't understand music.

Couple of notes on the DAC I'm using pictured above.
On mine the red and black wires on the power connector were reversed, the silk-screening is correct.
The DAC has a 50MHz oscillator for MCLK connected via a 100R resistor next to the oscillator. I removed the resistor to use my MMX generated clock. I haven't tested with the on-board oscillator. It seems more sensible to have all three clocks fully synchronous.
The sound quality though my good amp/speakers is outstanding - certainly better than playing from the source CD with my CD player. All of the clock generation in the MMX is done in hardware directly from the 24MHz oscillator and looks totally jitter free on the scope. I personally can't hear a difference between 96KHz and 192KHz but that may be because of the sample FLAC files I've found on the web and downloaded.

Edited by matherp on 04 March 2017 at 10:57am
Back to Top View matherp's Profile Search for other posts by matherp
 
Zonker
Guru
Guru
Avatar

Joined: 18 August 2012
Location: United States
Online Status: Offline
Posts: 708
Posted: 04 March 2017 at 2:28pm | IP Logged Copy link to clipboard   Quote Zonker

Oh.. Thanks, Mick..

I thought it was a typo..!!

Very interesting... As usual, my ignorance is showing..

Awesome work Gent's..! I love this stuff..
Back to Top View Zonker's Profile Search for other posts by Zonker
 
WhiteWizzard
Guru
Guru


Joined: 05 April 2013
Location: United Kingdom
Online Status: Offline
Posts: 2739
Posted: 06 March 2017 at 12:24pm | IP Logged Copy link to clipboard   Quote WhiteWizzard

Just got this working through a Raspberry Pi DAC and it sounds AMAZING.

Now to convert my entire collection from Apple lossless . . . . .

@Peter - three things

1> With the FAT_FS, what is the maximum capacity uSD that should work? I need maximum storage space for FLAC files

2> I have noticed that after the FLAC plays, the MMX hangs. And possibly this is linked: the file seems to stop part way through (hung). Reset works fine but not had a file completely play 'successfully' without hanging.

Have tried sound files lasting several minutes rather than just a few seconds - so this may be the reason? Also typing: PLAY FLAC "filename i.e. with no closing bracket or interrupt 'sub'

3> When the PLAY FLAC command is issued, it returns some 'feedback' regarding the file - can this be switched off (optionally?)

WW

EDIT: On MMX144 @ 252MHz, v5.03.11
EDIT2: No MCLK. 192KHz, 88KHz, and 48KHz all 24bit

Edited by WhiteWizzard on 06 March 2017 at 12:31pm


__________________
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.org
Back to Top View WhiteWizzard's Profile Search for other posts by WhiteWizzard Visit WhiteWizzard's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2855
Posted: 06 March 2017 at 12:35pm | IP Logged Copy link to clipboard   Quote matherp

Quote:
With the FAT_FS, what is the maximum capacity uSD that should work? I need maximum storage space for FLAC file


In theory FatFs can go above 32Gb using exFat but I haven't got a card > 16Gb so this is untested.

Quote:
I have noticed that after the FLAC plays, the MMX hangs. And possibly this is linked: the file seems to stop part way through (hung). Reset works fine but not had a file completely play 'successfully' without hanging.


This sounds like another WW funny. It works perfectly for me playing long files. There is an errata on using the reference oscillator in the MZ in the way I do but I haven't seen any affect of this. I'll post an update that uses the recommended workround for the errata. Make sure you are using a reasonably fast SDcard.

Quote:
When the PLAY FLAC command is issued, it returns some 'feedback' regarding the file - can this be switched off (optionally?)


I'll remove this in the update
Back to Top View matherp's Profile Search for other posts by matherp
 


Page of 2 Next >>
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1719 seconds.
Privacy Policy     Process times : 0, 0.02, 0, 0.16