advertisement


Raspberry Pi as headless streamer

One friend with his MDAC will visit me soon, than i can report.

Has this happened yet?

I've ordered a Pi board from RS anyway - its out of stock at the moment, but when it arrives I will build up as PiCore, but as a complete novice, if it doesn't work, it may be my build, rather than the MDAC interface. I use an isolator and a USB2 hub with my SBT, but would like to redeploy the SBT to my bedroom, as I've had two jogglers die since xmas.
 
I've bitten the bullet and bought a Pi, installed PiCorePlayer, and it works via HDMI, and analogue out.
So, I've now tried to get it to work with my MDAC. I've got this when I asked it about ALSA output devices:

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

That seems to be a lot of MDAC options, several of which the MDAC doesn't support?
At this point I started to realise I didn't know what I was doing:

I've inserted the string 'sysdefault:CARD=MDAC' (without the quotes)
into Output Settings
BUT all I get is lots of crackles... so I think I need to change some setting... but what?

can anyone advise?
 
JH,

Did you find the right output string for your MDAC? I would try

iec958:CARD=MDAC,DEV=0 or front:CARD=MDAC,DEV=0

If that fails, then test these strings: hw:CARD=MDAC,DEV=0 & plughw:CARD=MDAC,DEV=0
 
JH,

Did you find the right output string for your MDAC? I would try

iec958:CARD=MDAC,DEV=0 or front:CARD=MDAC,DEV=0

If that fails, then test these strings: hw:CARD=MDAC,DEV=0 & plughw:CARD=MDAC,DEV=0

Thanks... I'll give these a try when I get in from work...
 
Thanks... I'll give these a try when I get in from work...

If I use sysdefault:CARD=MDAC I get some sound that does seem to be a bit like music, but very broken up. I note on the picoreplayer website that for the Audiolab 8200DQ (presumably the same USB interface?) they modify cmdline.txt with smsc95xx.turbo_mode=n dwc_org.speed=1 which:
a. means nothing to me...
and
b. no idea where to fine cmdline.txt and how to edit it!
 
Correction. Just realised your using PiCorePlayer, so it doesn't have a standard RPi image layout. So I don't know have you change cmdline.txt contents other than through the picoplayer web interface.
 
If I use sysdefault:CARD=MDAC I get some sound that does seem to be a bit like music, but very broken up. I note on the picoreplayer website that for the Audiolab 8200DQ (presumably the same USB interface?) they modify cmdline.txt with smsc95xx.turbo_mode=n dwc_org.speed=1 which:
a. means nothing to me...
and
b. no idea where to fine cmdline.txt and how to edit it!

Finally found out how! Take SD card out of Pi. Insert into laptop, and edit the file that is found in \boot\ - obvious... when you know. Changed the parameters, but a bit late to put into the system to test... maybe tomorrow.
 
I've bitten the bullet and bought a Pi, installed PiCorePlayer, and it works via HDMI, and analogue out.
So, I've now tried to get it to work with my MDAC. I've got this when I asked it about ALSA output devices:

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

That seems to be a lot of MDAC options, several of which the MDAC doesn't support?
At this point I started to realise I didn't know what I was doing:

I've inserted the string 'sysdefault:CARD=MDAC' (without the quotes)
into Output Settings
BUT all I get is lots of crackles... so I think I need to change some setting... but what?

can anyone advise?
The list doesn't really say anything about what you can use with ALSA. To get a better idea of available cards, see "cat /proc/asound/cards".
Use
Code:
plughw:CARD=MDAC,DEV=0
for starters. This will get you "bit perfect" playback, without using a software mixer.

I get some sound that does seem to be a bit like music, but very broken up
That can be caused by several factors. It basically boils down to
  • hardware - nonexistent EHCI on many ARM boards, various USB3 issues, ...
  • software - mainly timing-related
There have been quite a few changes in Intel's ehci-sched.c in recent (3.x) linux kernels, which might have gotten into the custom EHCI RPi driver, so it would be good to know your kernel version, "uname -r" should do.
Perhaps the distribution you're using doesn't use the custom RPi kernel. If it does, then the speed=1 kernel cmdline thing might work as it forces the driver to use USB1.1 (full speed) instead of USB2.0 (high speed) with split transactions.

The thing is that while the RPi appears to be a "linux computer" for the userspace (web browsers, players, ...), the hardware is actually very different from a modern x86-based CPU+board.

more info (from 2012): http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=12097&start=575#p198809
 
plughw:CARD=MDAC,DEV=0

I *think* I've tried that one (must really write things down), but as yet I've not booted it with "dwc_org.speed=1" in the cmdline.txt

I'll try both of those when I get home tonight.
 
I read somewhere that the PI has issues with audio over USB because of the way the USB is implemented on the PI. In some cases it does work ok but for sure it won't work properly with an M-DAC due to the USB 1 interface.
 
That sounds VERY familiar... so what is it about the MDAC that makes it unhappy with the Pi?

Adrian Smith (aka Triode at the slimdevices forum) wrote the "squeezelite" app that picoplayer uses. His test with a M-DAC showed up several problems.

AFAIK the M-DAC implementation of async USB is not USB audo class 2 compliant, but shows up as something like this in Linux boot messages:

Code:
generic-usb 0003:0451:ADAC.0001: input,hiddev0,hidraw0: USB HID v1.11 Device [Lakewest Audio Audiolab M-DAC] on usb-0000:00:1d.0-1.1/input

USB ports on many ARM devices appear to lack certain hardware capabilities which in some cases can be cured by the use of a USB hub if your DAC is async USB 1.1 However, this seems not to be true for the M-DAC. Triode gave a more technical explanation on the slimdevices forum, but I neglected to bookmark his post.

Unfortunately the RPI and M-DAC do not appear to work well together. Perhaps this http://www.hifiberry.com/hbdigi might help.

A couple of other points. The list you posted is the output from the command "squeezelite -l", which lists output devices in a format which is the same as this command "aplay -L | grep CARD". Squeezelite derives the list directly from ALSA, it is the list of "ALSA defines" on your system. Doing a "cat /proc/asound/cards", is not going to tell anything different about the sound CARDS on your system. Your squeezelite list clearly shows two sound cards - RPI bcm2835 and your M_DAC. What is potentially confusing is that ALSA also generates additional "defines" whose use is not immediately obvious.

Using "plughw:CARD=MDAC,DEV=0", is not a guarantee of "bit perfect" playback. The ALSA "plughw" is a PCM interface which enables automatic sample format and sample rate conversion. It's often needed to get sample format conversion such a bit-padding (e.g. 16bit to 24 bit because an audio chip's internal format is 24bit) which is not harmful. But I wouldn't call any sample rate conversion "bit-perfect".
 
I tried picore player, and although it was easy to get up and running with my USB DAC, I couldn't get the WiFi to connect upon restart. Have reverted back to the old method (discussed at the beginning of the thread) with much better results, though the necessity of a controller app to shutdown before power off remains.

Anyone had any luck with retaining the wifi connection?
 
Using "plughw:CARD=MDAC,DEV=0", is not a guarantee of "bit perfect" playback. The ALSA "plughw" is a PCM interface which enables automatic sample format and sample rate conversion. It's often needed to get sample format conversion such a bit-padding (e.g. 16bit to 24 bit because an audio chip's internal format is 24bit) which is not harmful. But I wouldn't call any sample rate conversion "bit-perfect".
Right, I forgot to mention that it's "bit-perfect" only for sample rates supported by the card. In case of MDAC via USB, that's anything up to 24/96k. If one tries to play ie. a 24/192k file, it gets resampled down, to make it "just work", but it's not "bit-perfect".
One could use hw: instead, but anything that's not S24_3LE will then fail to play.
 
Like mentioned in page one, and afaik Raspberry Pi shares same HW bus with USB and network interface. That may lead to timing and reliability issues depending on the USB Dac used. Also playback frequency is a factor.

Solutions where the song is downloaded fully and then decoded+played from memory/sdcard might work better with some USB Dacs than continuous streaming where buffer is filled with data same time as the older buffer is played through USB port.

However, does Raspberry PI support hdmi audio? Hdmi is using different bus from USB and network. Could I use something like this...
http://www.amazon.co.uk/dp/B00AHS8LD8/?tag=pinkfishmedia-21
...with Rasberry and use the spdif from hdmi as audio interface?
 
This site contains affiliate links for which pink fish media may be compensated.


advertisement


Back
Top