S/PDIF output

Everything relating to hacking, expanding and modifying the Joggler hardware.
Post Reply
brycheiniog
Posts: 3
Joined: Wed Apr 13, 2011 2:14 pm

S/PDIF output

Post by brycheiniog »

Hi,
Has anybody tried adding an S/PDIF output connector hung of the STAC9202? I want to use the joggler as a Squeezebox player and a digital connection to an external amp would improve the audio quality significantly. Looking at the schematics for the reference STAC9202 board it looks like quite an easy mod to make...

http://www.idt.com/?genID=STAC9202#

Before I get the soldering iron I was wondering if anybody else had gone down this path?

Thanks

Jonathan
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

I use a USB soundcard that has SPDIF out. No soldering required. It requires a modified /etc/asound.conf file and the sound preferences need to be changed to the USB card output rather than the default internal chip.

I think the asound.conf file works without further tweaking on the native OS but the sound preferences need to be changed on Ubuntu/JoliOS/Mint.
brycheiniog
Posts: 3
Joined: Wed Apr 13, 2011 2:14 pm

Re: S/PDIF output

Post by brycheiniog »

Yeah, that is my fallback plan, but it would be better to keep everything internal :).

Jonathan
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

brycheiniog wrote:Yeah, that is my fallback plan, but it would be better to keep everything internal :).

Jonathan
Gulp! We must be cut from different cloth. You must be pretty brave to want to mess with the guts of your Joggler. I'd never describe a safe non-invasive method as a "fallback". Good luck - and let us know how you get on.
nick20000
Posts: 4
Joined: Tue Apr 19, 2011 2:53 am

Re: S/PDIF output

Post by nick20000 »

gegs wrote:I use a USB soundcard that has SPDIF out. No soldering required. It requires a modified /etc/asound.conf file and the sound preferences need to be changed to the USB card output rather than the default internal chip.

I think the asound.conf file works without further tweaking on the native OS but the sound preferences need to be changed on Ubuntu/JoliOS/Mint.
Would you please let me know which soundcard has SPDIF on Native OS ?
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

USB sound only works on native OS when you use a modified asound.conf file that tells the device to use USB sound output. Luckily the process has been simplified by the newest version of Plug'n'Pimp which has a switch to use a USB soundcard with or without mixer (use the one that works for you).

The card I've got is ancient and I couldn't find it doing a Google search. Basically it's a very cheap C-Media chip USB soundcard that also has a VOIP handset attached. It has 3.5mm mic input, a 3.5mm audio out socket and one SPDIF output. No model number I'm afraid.

There are lots of USB soundcards on eBay with SPDIF but I can't really vouch for them because I've not used them. Anything with a C-Media chip should be well supported in linux but I'm not promising.

The following card has a C-Media chip and SPDIF in/out:

http://cgi.ebay.co.uk/Asonic-External-U ... 4155c16105

Please note: the above link is an example, not a recommendation to buy; I have no idea if it will work for you. If anybody has had success with this or similar USB soundcards, please share your experiences with the forum.
nick20000
Posts: 4
Joined: Tue Apr 19, 2011 2:53 am

Re: S/PDIF output

Post by nick20000 »

thank for your information,I have tried to use my Creative Xi-Fi HD link to Joggler,It works normally(have sound out)
let Joggler became a very cheap Logixxxx Squeezebox touch^^
I plan my HIFI system will be Joggler=>USB to SPDIF=>DAC=>AMP=>speaker
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

Why do you need SPDIF out to a DAC? You would need an intermediate device - i.e. the USB soundcard - between USB (out from the Joggler) and SPDIF (into the DAC). You might be better to skip the SPDIF conversion part and use a USB DAC like this one:

http://www.russandrews.com/product-Fuba ... I-4588.htm

At the cheaper end there is:

http://cgi.ebay.co.uk/USB-DAC-SPDIF-R-L ... 45f8fd55cd

These will take digital USB in and output analogue through phono (if that's what you want). As before, not sure if these would work with the Joggler but they, or something similar, would negate the need for a conversion to optical. My reason for wanting SPDIF out was because my A/V amplifier has optical sound input and a built in DAC.

I realise you might have a DAC already with SPDIF inputs but a USB soundcard strikes me as an extra unnecessary box to add just to get the SPDIF signal when the USB signal from the Joggler is digital anyway.

-------------------EDIT----------------------

Although I can't make promises for USB DACs, support for USB sound has been part of the linux kernel since 2.4, they should therefore work perfectly because all they should need is USB digital input and the DAC will do the rest. Any "drivers" for USB DACs are usually just a switch to bypass any computer soundcard and output digital sound to USB, which Plug'n'Pimp's USB sound switch does anyway. The modified asound.conf file for Ubuntu/Mint/JoliOS does the same thing.

It would be very interesting to know what your final setup is and how it performs. I might just get a USB DAC myself having read that they process sound in a purer way than SPDIF (admittedly on the stereo-link website, a manufacturer of USB DACs - http://www.stereo-link.com/Static/1200FAQ.html)
speculatrix
Posts: 7
Joined: Wed May 04, 2011 11:35 pm
Location: Cambridge, England

Re: S/PDIF output

Post by speculatrix »

brycheiniog wrote:Hi,
Has anybody tried adding an S/PDIF output connector hung of the STAC9202?
Did you attempt this, and if so any chance of some photos and a write-up please?

I intend to use my joggler for precisely this purpose and googling for joggler s/pdif turned up this forum. I would much rather connect the joggler with a digital link to my yamaha a/v cinema amp than analogue.

I guess I could use a usb sound adaptor, and am contemplating doing the hardware hack to add more usb ports to the joggler.


My joggler is running ubuntu with x11vnc so I cam remote control it from laptop or android phone, rather than needing a cordless keyboard - I see on the vnc viewer what the joggler screen is showing which is ideal.

thanks
Paul
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

brycheiniog wrote:Hi,
I guess I could use a usb sound adaptor, and am contemplating doing the hardware hack to add more usb ports to the joggler.
How many ports do you need?

I use one of these hubs - http://bit.ly/m8gBjN - and run a USB speaker, cheap USB soundcard, a portable hard drive and a bluetooth receiver all at the same time. Hardware hack unnecessary.
ARJunior
Posts: 51
Joined: Fri Aug 05, 2011 2:28 pm

Re: S/PDIF output

Post by ARJunior »

Hi,

According to STAC9202 datasheet, SPDIF signal is available through pin 48 and 3.3V power supply from pin 9.
So I've soldered a spdif connector to my Joggler to test :)

These are devices available on our Joggler :

Code: Select all

# cat /proc/asound/devices
  2:        : timer
  3: [ 0- 1]: digital audio playback
  4: [ 0- 0]: digital audio playback
  5: [ 0- 0]: digital audio capture
  6: [ 0- 0]: hardware dependent
  7: [ 0]   : control
Card0 / Device1 is spdif digital output.
So I've edited /etc/asound.conf like this :

Code: Select all

pcm.!default {
   type hw
   card 0
   device 1
}
It's working perfectly on Ubuntu ! :P

However, it's not working on stock firmware and I don't know the reason...maybe this is due to old ALSA driver used or another file has to be modified to run perfectly...
Any idea ?

Regards,
ARJunior

EDIT :
Just for information, with Squeezeplay 7.6.2 installation, we have to edit usr/share/alsa/alsa.conf and set default device to "1" to use internal S/PDIF
Last edited by ARJunior on Mon Oct 24, 2011 6:48 pm, edited 1 time in total.
inzimam
Posts: 21
Joined: Wed Oct 05, 2011 12:04 pm

Re: S/PDIF output

Post by inzimam »

Hi

I'm just getting onto this Joggler thing after being so close to getting a squeezebox touch!

I'd really appreciate if someone could help answer this for me. I understand that to use an external USB soundcard we need to make changes to the /etc/asound.conf file if using JoliOS. My issues are two-part:

1) I will at some point want to disconnect the Joggler from my surround sound system as the file above would have been edited, is there any quick way to revert back to the built in speakers? Has someone written an app or something?

2) I want to connect it to co-ax input of my surround sound system, would a USB sound card like this do the trick:

http://www.ebay.co.uk/itm/USB-6-Channel ... 4aac5632aa

Thanks
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

I don't think anybody can vouch for USB soundcards that they haven't used, but the card you've linked to doesn't have any co-ax connections - only optical S/PDIF or analogue line input/output.

As for the sound switch, use Plug'n'Pimp. It has a set of tools, one of which changes the soundcard to/from internal sound to USB (with or without mixer).
inzimam
Posts: 21
Joined: Wed Oct 05, 2011 12:04 pm

Re: S/PDIF output

Post by inzimam »

HI gegs,

thanks for the reply.

I can connect s/pdif, but ideally want coax but I can't find a suitable usb hub for that.

In regard to the PnP switch, I wanted to run JoliOS and as far as I understand it, the PnP is for the native OS only?

Thanks
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

Sorry, I was focussed on how I use the Joggler in my hi-fi set up, not how you wanted to use it.

Best to save two versions of the file calling one something like asound.bak and the active one asound.conf. You just need to change the file extensions to change the behaviour. It's as quick a solution as I can think of.

I also have a Joggler attached to my hi-fi but it runs Squeezeplay on the native OS only. I find P'n'P useful for rebooting the device occasionally. I use my kitchen Joggler for any other stuff.
ARJunior
Posts: 51
Joined: Fri Aug 05, 2011 2:28 pm

Re: S/PDIF output

Post by ARJunior »

ARJunior wrote:Hi,

According to STAC9202 datasheet, SPDIF signal is available through pin 48 and 3.3V power supply from pin 9.
So I've soldered a spdif connector to my Joggler to test :)

These are devices available on our Joggler :

Code: Select all

# cat /proc/asound/devices
  2:        : timer
  3: [ 0- 1]: digital audio playback
  4: [ 0- 0]: digital audio playback
  5: [ 0- 0]: digital audio capture
  6: [ 0- 0]: hardware dependent
  7: [ 0]   : control
Card0 / Device1 is spdif digital output.
So I've edited /etc/asound.conf like this :

Code: Select all

pcm.!default {
   type hw
   card 0
   device 1
}
It's working perfectly on Ubuntu ! :P

However, it's not working on stock firmware and I don't know the reason...maybe this is due to old ALSA driver used or another file has to be modified to run perfectly...
Any idea ?

Regards,
ARJunior

EDIT :
Just for information, with Squeezeplay 7.6.2 installation, we have to edit usr/share/alsa/alsa.conf and set default device to "1" to use internal S/PDIF
Until now, I didn't succeed to make working internal SPDIF with stock firmware :(
I'm waiting for advices to try to find the problem making different test...
Hope someone here could help in this !

Thanks.
Regards.
parody
Posts: 13
Joined: Thu Nov 10, 2011 1:24 am

Re: S/PDIF output

Post by parody »

Hi All

I have been searching for a while now and keep coming back to this post over and over again - so apoogies to resurrect a slightly old one but it seems relevant.

I have purchased a joggler with the intention of using as a squeezeplayer, via a USB soundcard with SPDIF out to my amp (standard CMedia affair as people reccomend. Tested in windows PC to be working.)

Everything is fine apart from the SPDIF output. So far I have, several times:

1) reflashed back to o2 stock firmware following this guide: http://birdslikewires.co.uk/articles/jogglerflash
2) Installed plug n pimp from her: http://www.gforums.de/juggler/download.html
3) Used p'n'p to install squeezeplayer and enable USB audio (with and without mixer, reboots in between, different order of install etc)

I get no sound from the USB soundcard. I can see it registered in /proc/asound/devices:

Content-Length
Content-Disposition attachment; filename=/proc/asound/devices; size=

2: : timer
3: [ 0- 1]: digital audio playback
4: [ 0- 0]: digital audio playback
5: [ 0- 0]: digital audio capture
6: [ 0- 0]: hardware dependent
7: [ 0] : control
8: [ 1- 0]: digital audio playback
9: [ 1- 0]: digital audio capture
10: [ 1] : control

I can see that /etc/asound.conf has been updated:

Content-Length
Content-Disposition attachment; filename=/etc/asound.conf; size=

pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}

But no output, from squeezeplayer or any native joggler apps. Its not my amp or anything, the usb sound card doesnt even power on as no red light can be seen on the toslink connector, despite obviously being detected.

In addition running cat /proc/asound/cards generates the following:

0 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xd01c0000 irq 11
1 [default ]: USB-Audio - USB Sound Device
USB Sound Device at usb-0000:00:1d.1-2, full speed

My only thought is to add "device 0" to asound.conf to be:

pcm.!default {
type hw
card 1
device 0
}
ctl.!default {
type hw
card 1
device 0
}

Any help greatly appreciated!
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: S/PDIF output

Post by gegs »

Maybe the Joggler's USB socket isn't supplying enough power to drive your card. I've got portable hard disks that fire up on the PC but won't work attached to the Joggler.

Have you tried running the soundcard through a powered hub?
parody
Posts: 13
Joined: Thu Nov 10, 2011 1:24 am

Re: S/PDIF output

Post by parody »

I haven't no, mainly because I don't have one! Will have to order one.

I would expect it not to be picked up at all if there was not enough power?
ARJunior
Posts: 51
Joined: Fri Aug 05, 2011 2:28 pm

Re: S/PDIF output

Post by ARJunior »

ARJunior wrote: Until now, I didn't succeed to make working internal SPDIF with stock firmware :(
I'm waiting for advices to try to find the problem making different test...
Hope someone here could help in this !

Thanks.
Regards.
Fixed !
Digital output is muted by default so we have to edit check_snd() function in /etc/init.d/boot.d/S07boot.loadmodules like this :

Code: Select all

check_snd()
{
  local LOG="/openpeak/tango/amixer.out"

  echo $* > ${LOG}
  (amixer -c 0 sget 'IEC958',0 | tail -2) >> ${LOG} 2>&1

  local IS_MUTED=`grep "off" ${LOG} | wc -l`

  if [ ${IS_MUTED} -gt 0 ]; then
    echo "Error: Muted Audio!" >> ${LOG}
    amixer -q -c 0 sset 'IEC958',0 unmute
	if [ $? -ne 0 ]; then
      echo "-- Failed to recover --" >> ${LOG}
    else
      echo "++ Recovered ++" >> ${LOG}
    fi
  fi
}
Internal SPDIF is now working perfectly on stock firmware too 8-)
Post Reply