Jump to content

Recommended Posts

Hi!
I use Cubietruck. I want to listen to music with its help. I have external DAC connected on SPDIF/Toslink.
I establish on Cubietruck Armbian Wheezy Legacy kernel

root@cubietruck:/home/setupini$ uname -a
Linux cubietruck 3.4.109-sunxi #4 SMP PREEMPT Wed Sep 30 13:44:47 CEST 2015 armv7l GNU/Linux

I have information that this distribution kit supports SPDIF:

http://www.armbian.com/cubietruck/

 

Enabled audio devices: analog, HDMI, spdif and I2S (if wired and enabled in HW configuration)

http://www.cubieforums.com/index.php/topic,1275.0.html

 

– added Nikkov SPDIF / I2S recent patch (legacy)

 

For audio I use MOCP

On an analog output there is a sound, at the exit of SPDIF it isn't present.

I learned that for work of an exit of SPDIF it is necessary to turn on 4 modules in a kernel:

http://www.cubieforums.com/index.php/topic,1074.0.html

 

All I needed was loading 4 modules: "sndspdif", "sunxi-sndspdif", "sunxi-spdif" and "sunxi-spdma". Now SPDIF output is working.

I try to turn on these modules, but when loading modules aren't installed:

root@cubietruck:/home/setupini$ modprobe sndspdif
root@cubietruck:/home/setupini$ lsmod
Module                  Size  Used by
cpufreq_userspace       3524  0 
bnep                   14462  2 
bcmdhd                539724  0 
sunxi_ir                4037  0 
hidp                   17640  0 
rfcomm                 58686  0 
bt_gpio                 2741  0 
wifi_gpio               6375  2 bcmdhd,bt_gpio
hci_uart               25000  0 
bluetooth             264185  12 bnep,hidp,hci_uart,rfcomm

I tried to find these modules separately, but the format of the found modules doesn't conform to requirements of system:

root@cubietruck:/home/setupini$ insmod /lib/modules/3.4.109-sunxi/kernel/sound/soc/spdif/sunxi_spdif.ko 
Error: could not insert module /lib/modules/3.4.109-sunxi/kernel/sound/soc/spdif/sunxi_spdif.ko: Invalid module format

DAC works at other device.

 

Devices are present at system:

root@cubietruck:/home/setupini$ 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
card 2: sunxisndi2s [sunxi-sndi2s], device 0: SUNXI-I2S sndi2s-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

How to me to include SPDIF that the sound was present on an entrance to DAC?

 

I will be grateful for any help.

Link to comment
Share on other sites

You don't find modules because they don't exists. Support is build into kernel. That's why you see those devices.

 

With kernel which you use it was confirmed as working. On new one, linux-sun7i, there were some changes in this driver.

 

I don't have proper equipment at my reach to test and confirm.

Link to comment
Share on other sites

Hi, Igor! I thank you for the prompt and substantial reply. On the basis of information received from you I understood the system.

For a start I downloaded a distribution kit of Volumio which is intended for listening of audio.

The distribution kit was pleasant absolutely, inconvenient management and a mpd player do it inconvenient for me. But Volumio allowed me to check the SPDIF an exit, I was convinced that it works. Illumination of a red light-emitting diode in the Toslink socket in SPDIF operating time can be an indirect sign.

I disconnected mpd, established mocp, switched off web management and began to deal with audio outs.
It was necessary to understand long, but the result was reached.

In your assembly all exits are included, all modules are united in a kernel therefore it is only necessary to make the following actions for switching:

# cat /proc/asound/cards

The list of the cards existing in system will be output. In rectangular brackets you will see short names of cards:

 0 [sunxicodec     ]: sunxi-CODEC - sunxi-CODEC
                      sunxi-CODEC  Audio Codec
 1 [sunxisndspdif  ]: sunxi-sndspdif - sunxi-sndspdif
                      sunxi-sndspdif
 2 [sunxisndi2s    ]: sunxi-sndi2s - sunxi-sndi2s
                      sunxi-sndi2s

It is necessary to remember or write down the name of the necessary card

# nano /etc/asound.conf

To insert the next lines (or to enter other name of the card by default from the previous listing):

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

sunxisndspdif it is SPDIF-out

 

After that ALSA should reboot:

# /etc/init.d/alsa-utils reset

From this point the sound will be directed on the way specified by you. Perhaps the way not absolutely correct, but it with guarantee works.
If time allows, I for myself will write a script on switching or I use ncurses

 

For test I loaded 2 types of audio of files into a player: 16 bits 44,1 kHz and 24 bits 192 kHz. Then I switched audio to I2S and I removed oscillograms from a R186 resistor entrance - LRCK. I attach oscillograms.

abeb5f7df428.png

 

c8e262d67e37.png

 

However at reproduction of the file of 24 bits 192 kHz shows the following:

# cat /proc/asound/card1/pcm0p/sub0/hw_params 
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 8192
buffer_size: 32768

I should continue to understand.

Igor, can be it is worth including in your assemblies file/etc/asound.conf and/or a script for switching of audio of streams? I take an opportunity and I thank you for fine work :thumbup:

Link to comment
Share on other sites

Hello

 

In my system SPDIF out working very well, now i have problem with SDPIF input.

I have fex cofigured

[spdif_para]
spdif_used = 1
spdif_mclk = 
spdif_dout = port:PB13<4><1><default><default>
spdif_din = port:PB12<4><1><default><default>

unfortunetly i can't hear any audio.

 

Hardware looking ok - i have MAX485 as a AES/EBU to spdif ttl converter.

i see data on PB12 input.

 

I am not sure about 

spdif_mclk = 

but this is optional for SPDIF ?

 

Ofcourse i see SPDIF card on system

One question:

 

Card 0 (analog) working good as a input and output - tested

Card 1 (spdif) working good as a output - input not working

Card 2 (I2S) working good as a output - input not tested - i haven't external A/D

 

i have enable modules for digital audio.

sndspdif 
sunxi-sndspdif 
sunxi-spdif  
sunxi-spdma 

maybe i must enable other modules for spdif input??

 

Robert

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines