Raspberry Pi -A New DIY'ers Digital Hub? - Page 5 - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 29th August 2012, 06:15 PM   #41
diyAudio Member
 
Join Date: Nov 2006
I made simple WAV file player on Raspberry Pi, using GPIO / external FIFO / 11.2896MHz clock / some 74HCs.
I'm not using any PLL or internal clock.

(1) read wav file into memory. (Free memory is around 180MB)
(2) set up GPIO, fill some 0 to FIFO
(3) generate I2S bit stream from PCM signal
(4) FIFO accepts 2 bits, LRCK and SDATA, 72V05 = 8K samples = 23msec. 72V06 is 16K samples.
(5) external 11.2896MHz and 74HCs "pulls" each I2S signal bit.

#makefile
CFLAGS += -O3
LDFLAGS += -lm
all: RaspWav01

to run
sudo ./RaspWav01 ../WAV/01.wav

reference
Code and Life Benchmarking Raspberry Pi GPIO Speed
RPi Low-level peripherals - eLinux.org

maybe with some modification, I can make Raspberry Pi Jukebox.
(a) USB storage, has wav file folders, or NAS.
(b) LCD display
(c) Buttons; Play-Pause / Stop / Prev / Next, Next-folder, Prev-Folder
(d) program, auto start then wait loop for buttons, search folders

for 48 or 88.1 or 96kHz, more external logic and clock switching required.
I'm not sure GPIO is fast enough to process 96kHz bit by bit. if not fast enough, external parallel - serial (74HC165) or FPGA can help.
Attached Images
File Type: png Simple_GPIO_FIFO_I2S.PNG (129.3 KB, 829 views)
File Type: jpg P8280114s.jpg (359.6 KB, 770 views)
Attached Files
File Type: txt RaspWav01.c.txt (8.6 KB, 42 views)
  Reply With Quote
Old 29th August 2012, 06:30 PM   #42
diyAudio Member
 
Join Date: Nov 2006
If Raspberry Pi has dual core, continuous playback (FLAC, APE etc conversion + PCM playback) will work but Raspberry Pi has single core.
  Reply With Quote
Old 29th August 2012, 07:23 PM   #43
diyAudio Member
 
linuxworks's Avatar
 
Join Date: Jul 2008
Location: santa clara, CA
I have one board here and one on the way.

but usb has that 'elephant' bug and so its a show-stopper for most of us until it gets fixed.

almost any way into the board or out of it is via usb. I think even networking is over usb (or behind usb). and usb is losing packets or something (I don't know the details). its not reliable yet.

until they fix that, I can't spend any time on this board. I hope they fix it soon!
__________________
My Photostream:http://www.flickr.com/photos/linux-works/
  Reply With Quote
Old 2nd September 2012, 12:51 AM   #44
diyAudio Member
 
Join Date: Nov 2006
I modified source code to use interrupt. more stable than before.
WriterThread does
(1) make bit stream from PCM
(2) output 1 bit
(3) check full flag. if full, stall until pin 24 rising edge. (more than half empty)

I think no more speed headroom for 88.1 or 96k PCM. when I add dummy GPIO read / wirte, buffer underrun occurs.
Maybe parallel GPIO output (8pins or more) and FPGA parallel - serial conversion can work for High resolution or DSD playback.

Anyway this method is very easy for your DIY, than dsPIC SDHC player.
The problems: Now I'm using CS4334, there are no "MUTE" pin so I can not stop glitch when FIFO is empty.

I'm waiting 'Humble Pi' add on for Raspberry Pi. when I get I will show more organized version.
Attached Images
File Type: png Simple_GPIO_FIFO_I2S(3).PNG (125.7 KB, 682 views)
Attached Files
File Type: txt IntRaspWav01.c.txt (12.3 KB, 17 views)
  Reply With Quote
Old 6th September 2012, 12:32 AM   #45
diyAudio Member
 
Join Date: Nov 2006
Default revision 2.0

Posted Today..
Upcoming board revision | Raspberry Pi
"PCM_CLK, PCM_FS, PCM_DIN, PCM_DOUT" will be available at RPi Rev 2.0.
From reference manual
"In clock slave mode (CLKM=1), the PCM_CLK is an input, supplied by some external clock source."
So we can supply external master clock to Pi. it should be 22M/24M selectable by other GPIO.
PCM module has 64x32bit TX FIFO, Interrupt, and DMA.
  Reply With Quote
Old 6th September 2012, 04:21 AM   #46
diyAudio Member
 
Join Date: Nov 2006
Default DSD Playback by Raspberry Pi

I used the same board here,
https://sites.google.com/site/koonau...layback-system

Now I try
DSD File Playback by Raspberry Pi -> (FTDI UM232H -> 22.4896MHz + FPGA DLP-HS-FPGA -> HC574) -> LPF -> small active speaker.

(1) Install
libusb-compat-0.1.4.tar.bz2
libftdi-0.20.tar.gz

(2) modify source code for libftdi
attached, read DSF file and make bit stream, then write to FTDI
#makefile
CFLAGS += -O3
LDFLAGS += -lm -lftdi
all: DSFPlayer01

(3) Hardware
I modified around UM232H for 5V power supply.
and I used CR LPF for DSD output to analog signal, then connected to active speaker.

(4) Playback
sudo ./DSFPlayer01 ../DSF/10.dsf

OK I success, it's easy

limitation: I can not read whole DSF file(over 200MB) into Raspberry Pi's memory(total 188MB), so now I only listen to leading 100MB.
Maybe multi-threading, (a) read and make bitstream (b) write to FTDI, with ping-pong buffering will work.
Attached Images
File Type: jpg P9050116.JPG (644.5 KB, 618 views)
File Type: jpg P9050117.JPG (607.3 KB, 602 views)
Attached Files
File Type: txt DSFPlayer01.c.txt (5.8 KB, 15 views)
  Reply With Quote
Old 7th September 2012, 05:18 AM   #47
diyAudio Member
 
Join Date: Nov 2006
Default DSD Playback by Raspberry Pi (2)

Attached, multi thread version
main() prepares buffer to send, then wait for signal
thread() copy buffer to local, then make signal, then send to FTDI

so main() is working to make next data while thread is writing to FTDI.
by top command, this program uses about 28% of CPU.
so DSD128 may work but DSD256 will spend too much CPU time.

I wonder FTDI's ARM driver can work faster than libftdi.
Attached Files
File Type: txt DSFPlayer02.c.txt (6.9 KB, 22 views)
  Reply With Quote
Old 7th September 2012, 05:58 AM   #48
zog666 is offline zog666  Australia
diyAudio Member
 
Join Date: May 2009
Quote:
Originally Posted by KOON3876 View Post
I made simple WAV file player on Raspberry Pi, using GPIO / external FIFO / 11.2896MHz clock / some 74HCs.
I'm not using any PLL or internal clock.
wow, thats great work!
mpd or similar linux jukebox system that supports external playback "plugins" could be adjusted to use it as an output mechanism.


Quote:
Originally Posted by linuxworks View Post
but usb has that 'elephant' bug and so its a show-stopper for most of us until it gets fixed.
At least the USB packet drop issue is partially fixable, with the addition of the fix at: https://github.com/raspberrypi/firmware/issues/19
.. although I've found this increases unreliability of the SDCARD.

I'm running with just "sdhci-bcm2708.missing_status=0" added to /boot/cmdline.txt and this seems OK.

.. still its been a lot of messing about to get it reliable, and it still leaves the power issues there, I've dropped drying to use a USB DAC and a wifi dongle at the same time.
__________________
audio project blog http://www.minirig.org.au/
  Reply With Quote
Old 7th September 2012, 06:44 AM   #49
diyAudio Member
 
Join Date: Nov 2006
Quote:
Originally Posted by zog666 View Post
wow, thats great work!
mpd or similar linux jukebox system that supports external playback "plugins" could be adjusted to use it as an output mechanism.
Hi thanks but this modification is useless for Rev2.0 board. omg.
Rev2.0 only requires external clock(22M/24M), HC08(and) + HC32(or) for clock selector, and HC574(reclock) for high quality I2S output.
  Reply With Quote
Old 7th September 2012, 09:02 AM   #50
vzs is offline vzs  Europe
diyAudio Member
 
Join Date: Dec 2005
Location: Cluj-Napoca, Romania
Quote:
Originally Posted by KOON3876 View Post
...Rev2.0 only requires external clock(22M/24M), HC08(and) + HC32(or) for clock selector, and HC574(reclock) for high quality I2S output.
Great work indeed!
KOON3876, do you think the Rev 2.0 board will be capable of streaming 384KHz stereo WAV (ideally FLAC) read from an external USB hard drive?
If yes, pairing it with Ian's async FIFO could make a great digital source for a PCM DAC. My goal is to offline oversample with SoX or alike to 352.8/384KHz and stream it to a classic multibit DAC.

I was looking for .Net FEZ boards or Vinculum-II from FTDI to stream 384KHz from external USB drive but none can handle the needed data rate.
Thanks!
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tractrix in 1*Pi and 2*Pi revintage Multi-Way 21 26th August 2011 10:37 PM
Headphone Hub?? baronofhell Headphone Systems 3 26th May 2007 01:37 PM
centering hub for cdpro skyraider Digital Source 0 1st July 2005 08:08 AM
what to do with that old lan hub karma Everything Else 25 27th May 2003 06:58 AM
Barcode around CD hub? Circlotron Digital Source 0 13th February 2003 01:34 AM


New To Site? Need Help?

All times are GMT. The time now is 01:35 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2