December 09, 2019, 08:03:02 am

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


Activate SPDIF on CT with debian wheezy image

Started by nl1957, January 03, 2014, 02:24:48 pm

Previous topic - Next topic

nl1957

January 03, 2014, 02:24:48 pm Last Edit: January 03, 2014, 04:52:28 pm by nl1957
Is there somebody who could explain to a NEWBIE, how the spdif connector is activated.
I am running a Debian Wheezy image. I put the sndspdif.ko, sunxi_sndspdif.ko, sunxi_spdif.ko and the sunxi_dma.ko modules in /lib/modules/3.4.61+/kernel/sound/soc/sunxi/spdif and put them in /etc/modules under #snd. Than rebooted but no lights came out of the spdif connector.

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

cat /proc/asound/cards
0 [sunxicodec     ]: sunxi-CODEC - sunxi-CODEC
                      sunxi-CODEC  Audio Codec

cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1024
buffer_size: 8192
----------------------------------------------------------------------------------------------------------------
So I now have with aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sunxisndspdif [sunxi-sndspdif], device 0: SUNXI-SPDIF sndspdif-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

cat /proc/asound/cards
0 [sunxicodec     ]: sunxi-CODEC - sunxi-CODEC
                      sunxi-CODEC  Audio Codec
1 [sunxisndspdif  ]: sunxi-sndspdif - sunxi-sndspdif
                      sunxi-sndspdif

So how to get card 1 active instead card 0 ?

kevin

Unless you play the sound file thorough card1, you won't get any signal from spdif connector.
So if you want to play through card1, you should specify which cards to run on your sound application.
For example, if you use mpd, you can edit output device section like "hw:1,0" which means to use HW card1 sub-device 0 in /etc/mpd.conf file.

nl1957

Found the solution: start another daemon.
In a terminal type - gmediarender -f "CubieSPDIF" -d.
-f "CubieSPDIF" is for the name you will find in your controller app and -d is turning it into a daemon so gmediarender will not stop after 1 song.
You now have both the 3.5mm and SPDIF outlet working and you can switch between them.

Alex74

Hi! This is my config for parallel using  SPDIF and  3.5mm out

cat asound.conf
pcm.!default {
type plug
slave {
pcm "both"
}
}

pcm.both {
type route
slave {
pcm multi
channels 4
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}
type multi
slaves.a {
pcm "Optic"
channels 2
}
slaves.b {
pcm "analog"
channels 2
}
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1

bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}

pcm.Optic {
type hw
card 1
device 0
channels 2
}


pcm.analog {
type hw
card 0
device 0
channels 2
}


nhaskin

For audacious in Cubian.
Just add sndspdif.ko, sunxi_sndspdif.ko, sunxi_spdif.ko and sunxi_dma.ko to the text file /etc/modules . As above.
Reboot and $ cat /proc/asound/cards to prove that it worked. Then all I had to do was set audacious to use.
PCM device card=sunxisndspdif   
Mixer device hw:1 (sunxi-sndspdif)
Mixer element  (there is none) 
An error pops up about no mixer element, but if you select software mixer you get a volume slider in audacious. And it works just fine. No analog out of course.