Raspberry Pi -A New DIY'ers Digital Hub?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
So, have you tried fiddling with TXTHR? If your current results are with it set to 1, then 16 could give a big improvement. Assuming your driver code knows how to put in the right number of samples which will vary between 48 and almost 64.

I2S is just a synchronous serial interface with data, clock and word clock. SPI has data, clock and chip select. They are similar enough that many uCs have a serial peripheral flexible enough to do either. The lucky BCM2835 has one of each :)
 
Last edited:
It transpires that it interrupts on an empty FIFO, 16 left, 48 left, or if not full - depending how you set TXTHR.

Don't know if the sample refers to bytes, sample (one channel), or frame (both channels) but in any case there isn't a lot of permissible latency.

At 44100 samples/sec, 2 channels, 16 bits
48 bytes is 362 microsec
48 frames is 1.45 millisec.

Not much leeway for the OS.
 
Yes, I agree that 16 samples doesn't allow for much interrupt latency. I would want 512. I'm just trying to figure out how much interrupt latency philpoole has actually been using up until now. If the FIFO was set to interrupt on empty, then the OS would only have one sample's worth of time to respond to the interrupt. It would drop a lot of samples which would explain the "warbling" sound that was reported.
 
It would drop a lot of samples which would explain the "warbling" sound that was reported.
I think the only bugger was left and right channels were occasionally swapped. Maybe hang an LED or scope off a GPIO and light it if underflow bit set after interrupt. That would at least confirm underflow. But the cool thing is it basically works at 44.1/16 with a miniscule buffer and it is a legitimate driver. It's so tempting .. I've got some old TDA1543s somewhere.. humm but I also have so many unfinished projects..
 
Another report on my experience with the QNKTC USB DAC:

I got rid of the USB keyboard from my system. Instead I'm using some buttons connected to the GPIO port, with the "pikeyd" GPIO keyboard daemon by mmoller, and also the mpod remote app.

In this configuration, I get about one stutter per 5 minutes at 24/192. At 24/96 and below it seems fine. The project continues :)

The USB DAC contains a quite powerful microcontroller that is basically just converting USB to I2S, so it's not nearly as elegant (or cheap :) ) as using the Pi's own I2S port. However it is a working solution, and allows the Pi to be easily changed out for another single board computer later.
 
Last edited:
Thanks for the update and GPIO tests through pikeyd. I admit I'm a Luddite and have resisted the latest gadgets that could be used to interface to the RPi mpd. The QNKTC DAC must sound good driven through the RPi in lieu of direct I2S. At 44.1/16 the ALSA driver could almost sound good if the jitter is low.
 
I've got a rasperry pi with raspbian installed on it.

Thinking of setting up just a quick digital radio setup and dump my am/ fm radio.

I've only listened to a few AM stations anyways- what audio software would you guys recommend?

Hopefully it will recognize my tenor dac.

I'm using MPD as it not only streams my ripped FLAC of my CD's but you can also create steams to internet radio stations. Works good. I find a lot of streams that work using Discover free streaming radio stations from around the world. and for radio stations that stream I use Radio Stations Streaming on the Internet.

The only thing that stinks is while a lot are stream now a days, many use crappy flash or iheart radio to do so and figuring out the stream is a major PITA. Otherwise those that stream in mp3, asx, or ac3 work great!

As long as your tenor dac is supported under linux, there is a good chance it will work fine.
 
Squeezer

My Rpi project (dutch): forum.zelfbouwaudio.nl • Toon onderwerp - Squeezer: multiroom audio amplifier

It is going to be a raspberry pi, squeezeslave, dac and amp in one.

An externally hosted image should be here but it was not working when we last tested it.


An externally hosted image should be here but it was not working when we last tested it.


An externally hosted image should be here but it was not working when we last tested it.


The case it will be installed in:

An externally hosted image should be here but it was not working when we last tested it.


I'm stilling looking door a cheap DAC to begin with. Was looking for the PCM2704. Maybe later if I'm not satisfied, I can upgrade to a Sabre DAC or simular.
 
I'm stilling looking door a cheap DAC to begin with. Was looking for the PCM2704. Maybe later if I'm not satisfied, I can upgrade to a Sabre DAC or simular.

I've been pretty happy with that DAC. I have it tied into my home amplifier and the analog sound is very good. Eventually I tied into my home amplifier via a toslink and let my home amplifier's DAC do the conversion.

PCM2704 USB DAC USB* or ebay PCM2704 USB DAC USB

$T2eC16NHJI!E9qSO8GiEBQyZYrGczQ~~60_12.JPG


Looking forward to seeing your completed project!
 
Plug and play for me...mostly. Are you sure yours isn't being detect, but is configure for index 1 while the internal broadcom chip is at index 0? At a shell prompt what does the following show?
Code:
aplay -L #upper case
aplay -l #lower case

aplay -L (output)

null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
sysdefault:CARD=USB
WEILIANG 24BIT USB, USB Audio
Default Audio Device
front:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
Front speakers
surround40:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
WEILIANG 24BIT USB, USB Audio
IEC958 (S/PDIF) Digital Audio Output

aplay -l (output)

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: USB [WEILIANG 24BIT USB], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: USB [WEILIANG 24BIT USB], device 1: USB Audio [USB Audio #1]
Subdevices: 1/1
Subdevice #0: subdevice #0


ok, I guess it detected the usb - how do I output to the dac?
 
ok, I guess it detected the usb - how do I output to the dac?

"sudo nano /etc/modprobe.d/alsa-base.conf" and change/add the following line:
Code:
options snd-usb-audio index=0 nrpacks=1

Reboot, if you run the aplay -l command again, the USB DAC should be at index 0 and should be your default sound card now. BTW, not sure "nrpacks=1" is necessary, it was for the USB DAC I used.
 
Thanks. I'll give that a try.

hmm, two of the station I'd like to stream (590am & 640am in Toronto) use a flash plugin on their website.

Can a feed like that be picked up thru a general audio app (that picks up internet radio feeds?)

Not easy, sometimes you can view the web page source and find the RTMP stream. Other times you can use wireshark...but getting the stream out of a Flash player certainly ranks high on the PITA scale!!! In any case I believe the streams for the stations you are looking for are:

http://8303.live.streamtheworld.com/CFMJAMAAC #640AM
rtmp://cp80874.live.edgefcs.net/live/TOR590_AAC@26445 #590AM

You can play these using VLC, mplayer, or some other streaming software...MPD should be able to play these. Of course no guarantee that these streams are static and could change from day to day. This link provides some basics on pulling streams from flash players

video - How to find the stream behind a Flash player - Super User
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.