Networked music player using the mini - Page 4 - Project Showcase - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Networked music player using the mini


  • Please log in to reply
71 replies to this topic

#61 piwi

piwi

    Advanced Member

  • Members
  • PipPipPip
  • 114 posts
  • LocationGermany

Posted 09 February 2013 - 06:08 PM

well, that's quite a surprise indeed. And I can only concur with your conclusions.

 

I'm currently listening to CBR 320 with a CLASS 2 2GB SD card and it plays very nicely and without any interruptions on P2.

 

Trying to figure out how to flash the VS1053, since a new patch has been released on http://www.vlsi.fi/e...0xxpatches.html and should be capable of playing FLAC see if that brings any hearable differences. The VS1063 does play FLAC by default but has no MIDI though. Sparkfun has a new bob for the vs1063

 

https://www.sparkfun.../products/11684

 

... in case the patches breaks the vs1053b



#62 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 09 February 2013 - 07:48 PM

You don't flash it instead you upload the patch runtime by writing the binary to wram. There's an example C program at VLSI that shows how to do that. To my knowledge, you have to fepeat this process after each reset or powerdown.

#63 piwi

piwi

    Advanced Member

  • Members
  • PipPipPip
  • 114 posts
  • LocationGermany

Posted 09 February 2013 - 09:07 PM

Yep, you're perfectly right ... no flashy stuff, it has to be loaded every time .... it's a plugin ...

 

Well it is playing the FLAC allright ..... but the chopping is back again .... and the deployer is reporting it could only allocate part of the memory available, so I guess for FLAC play, the P2 has too little of resources as well. It even freezes up completely you have to pull the usb plug to be able to redeploy.

 

From the bright side, at least the patch/plugin for flac did work and the VS1053b did play it, kind of.

 

Have to drag in the heavy artilary ...

 

See if I get it running on the PI, have to study though, never played with linux b4. At least the cpu (700 mhz) and the ram should suffice (256 MB SDRAM) ...

 

For know returned to play MP3 CBR 320 kbps and that quite nice.

 

Thanks 4 all UR help in this ....



#64 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 09 February 2013 - 10:44 PM

Yeah, Flac requires more bandwidth since it's a non-lossy format. it's compressed allright but just like ziv lempel, the decoder restores it to its original. The fact that you're playing Flac files should not affect the memory footprint on the host MCU, it's the patch taking up the extra memory space. The Raspi should be able to do the decoding itself without the need for a slave device even though I've actually heard its too slow. The Broadcom CPU is more of a GPU than of an application CPU. Bear in mind that the Broadcom is based on almost 10 year old processor architecture. To be frank, I find the Raspi is both underpowered and overrated with modern standards. Compare it with the mk808b and you'll see what I mean. What does P2 mean, is it the Panda 2?

#65 piwi

piwi

    Advanced Member

  • Members
  • PipPipPip
  • 114 posts
  • LocationGermany

Posted 10 February 2013 - 01:56 PM

yep the P2 is the Panda 2...

 

played all night long, when I came back this morning and turned on the speakers it was still playing properly. So this is quite a stable setup.

 

Shame it doesn't work for the N+ maybe the N2(+) can cope with it. Maybe a change to have the patch/plug-in on the SD-Card and then stream it in, destroy the used memory and then start playing the music but that's only if i'd want to play flacs and probably will only work on more powerfull boards ... by the way my PI has got something of an ARM11 700 MHz CPU included on the broadcom SOC they just share the not expandable 512 MB RAM, should suffice for the flac play .... and in theory should do for blu-ray play .... we'll see .... time will tell ...

 

Maybe time to get the N2+ it has more than tripple the clock speed, appx 5x times the code space and more than doubled the RAM but that is on the cerb40 (like the mini on a 40 pins dil sized board) as well and that for less than half the price ... Chris shouldn't wait that long for new mini though .... aahh, discissions, discissions ....

 

BTW. There will be a maker fair in Hanover, Germany .... http://www.heise.de/...re-1783042.html



#66 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 10 February 2013 - 07:03 PM

I actually got a couple of Cerb40s on my desk waiting for me to do something with them. I want to see how the player performs on it and every now and then I think, tonight I'll try it but so far something has always come between. Maybe you'll beat me to it though - then you could serve me the code on a silver platter :-)

 

Would love to go to Hannover (went to Cebit a few years ago) but it's a pretty long way there. Be sure to have a cold one for me in the Münchener Halle:-)



#67 NightTinkerer

NightTinkerer

    New Member

  • Members
  • Pip
  • 2 posts

Posted 05 February 2014 - 10:05 PM

hanzibal, I wanted to say thanks for posting your code and information. I was working on a project to make an old radio into an mp3 player and your code was a perfect starting point for what I was trying to do. I provided a link in my project to this information, hopefully others will find it as helpful in the future. Here is a link: http://www.hippreality.com/ it is all up and running now, thanks!

 

Great forum!



#68 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 19 February 2014 - 12:15 PM

Great, that you found it useful! I saw your antique radio project and I really love the mix of new and old that you get from putting new internals in old machines. My late mother used to have one similar to yours, you'd have to wait for like 15 minutes for it to get warm before you could use it. Sadly, we didn't keep it. Cheers!

#69 newone

newone

    New Member

  • Members
  • Pip
  • 2 posts

Posted 02 May 2014 - 04:22 PM

This was a lot of help. I got an cheap vs1053 board online and everything worked. I am still looking at ways to add a pot for volume adjustment. I just cant get it to work though. 

 

 SCI_VOL = 0x2424 ! both left and right volumes are 0x24 * -0.5 = -18.0 dB

 

 How do I set it? 



#70 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 04 May 2014 - 06:17 PM

SCI_VOL is a h/w register of the vs1053b chip, so you need to write the value 0x2424 to the register. You do this using the serial command interface (hence the "SCI" prefix) over SPI.

    // Write to an  SCI register
    private void WriteRegister(byte address, ushort data, bool waitForDREQ = true)
    {
        wr_buff[0] = 2;                    // write command
        wr_buff[1] = address;              // register
        wr_buff[2] = (byte)(data >> 8);    // high byte
        wr_buff[3] = (byte)(data & 0xff);  // low byte

        SelectCommand();                   // select SCI
        if (waitForDREQ) AwaitDREQ();      // wait for dreq to go high
        spip.Write(wr_buff);
    }

    // example of setting volume
    WriteRegister(REG_SCI_VOL, 0x2424);

The code snippet above is taken from my source code (puplished earlier).

 

I would use a rotary encoder but if you want to use a potentiometer, you can set it up as a simple voltage divider GND - 3.3V and then read the voltage of the wiper using a Netduino analogue pin. You would then need to add software to continuously poll the analogue pin for any changes in voltage, executing the corresponding volume adjustments.



#71 newone

newone

    New Member

  • Members
  • Pip
  • 2 posts

Posted 09 May 2014 - 07:26 PM

Thanks Hanzibal. The problem for me is that SCI_VOL sets volume for both left and right audio out. The register can be set from 0 to 65278. Now what I use from the MP3Radio code.

static SecretLabs.NETMF.Hardware.AnalogInput pot = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A4);
pot.SetRange(0, 65278);

So what I get is a number between 0 and 65278, and when I use that to set SCI_VOL it means Left or Right volume is high and opposite side is low, So its kind of mono output.

I think the simplest solution will be to use 2 buttons. One for volume up and another for volume down. And set SCI_VOL using predefined numbers that set both left and right channel to equal volume. What do you think?



#72 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 12 May 2014 - 06:36 PM

The 16 bit register is divided into two bytes of 8 bits (256 steps) each, you need to set the two bytes separtely like so:

byte left_vol = 45;
byte right_vol = 90;

ushort vol = (left_vol << 8) + right_vol;

WriteRegister(REG_SCI_VOL, vol);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.