Jump to content

SPDIF not active in 4.7.3-sunxi


martin-by

Recommended Posts

Hello,

 

I have installed MPD &  ALSA (pulseaudio is removed) on CUBIETRUCK.

 

Wtihin modules I added "sun4i_codec" & "sun4i_spdif" to get loaded.

 

 

With "aplay -l" I only get:

**** List of PLAYBACK Hardware Devices ****
card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 

LSMOD shows:

 

Module                  Size  Used by
bnep                   10570  2
hci_uart               17987  1
evdev                  12164  1
ir_lirc_codec           4920  0
lirc_dev                8310  1 ir_lirc_codec
sunxi_cir               3735  0
sun4i_ts                3990  0
nvmem_sunxi_sid         2159  0
nvmem_core              9078  1 nvmem_sunxi_sid
pwm_sun4i               4756  0
sun4i_codec            11391  3
rt2800usb              17554  0
rt2800lib              71796  1 rt2800usb
rt2x00usb               9007  1 rt2800usb
rt2x00lib              37097  3 rt2x00usb,rt2800lib,rt2800usb
mac80211              540722  3 rt2x00lib,rt2x00usb,rt2800lib
sun4i_ss               16066  0
cpufreq_dt              3432  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq
thermal_sys            58884  2 cpufreq_dt,sun4i_ts
sun4i_spdif             4440  0
snd_soc_core          130295  2 sun4i_codec,sun4i_spdif
snd_pcm_dmaengine       3455  1 snd_soc_core
snd_pcm                77587  2 snd_soc_core,snd_pcm_dmaengine
snd_timer              19477  1 snd_pcm
snd                    47687  3 snd_soc_core,snd_timer,snd_pcm
soundcore                922  1 snd
bonding               105270  0
hidp                   13614  0
rfcomm                 34041  0
bluetooth             330962  27 bnep,hidp,hci_uart,rfcomm
brcmfmac              184717  0
brcmutil                5661  1 brcmfmac
cfg80211              432700  3 brcmfmac,mac80211,rt2x00lib
rfkill                 10687  4 cfg80211,bluetooth
pwrseq_simple           2322  1
uas                    12903  1
realtek                 2775  0
 

 

Do you have any hint to get SPDIF active?

 

Best regards,

 

Martin

Link to comment
Share on other sites

Some kernel options were missing. This will be fixed in a new release, meanwhile you can try installing this prebuilt kernel: https://www.dropbox.com/sh/ztxjghmrthjf8nc/AADvh1QuxF8nbsfMnXuBWylSa?dl=0

New card is detected on my Cubietruck, but I don't have any SPDIF receivers to test the playback.

➜  ~  % aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SPDIF [On-board SPDIF], device 0: spdif-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
➜  ~  %
Link to comment
Share on other sites

So, after installing --and a reboot-- both files all other devices are gone (wifi, Bluetooth, ..) and none soundcard is detected.

This is my actual lsmod:

Module                       Size   Used by
pwrseq_simple           2322    1 
uas                             12903  1
realtek                        2775    0

 

Must be the /boot directory the same on mmcblk0p1 and my SSD (now my root directory)?

How to reset to old kernel?
 

Link to comment
Share on other sites

Here are the Infos:

 

http://sprunge.us/jTFG

 

root@cubietruck:/tmp/sdcard/boot# dpkg -l | grep armbian
ii  armbian-firmware                   5.20                                     armhf        Linux firmware
ii  armbian-tools-xenial               5.20                                     armhf        Armbian tools, temper, Cubie bt utils
ii  hostapd                            1:2.5~armbian5.21+1                      armhf        IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
ii  sunxi-tools                        1.3-1~armbian5.21+1                      armhf        tools for working with Allwinner (sunxi) ARM processors

UPDATE:

files on mmcblk0p1:

total 19M
drwxr-xr-x  4 root root 4.0K Oct 15 15:08 .
drwxr-xr-x 22 root root 4.0K Oct 15 10:35 ..
drwxr-xr-x  2 root root 4.0K Sep 15 00:41 bin
-rw-r--r--  1 root root 6.8K Sep 15 00:41 boot.bmp
-rw-r--r--  1 root root 2.8K Oct 15 15:08 boot.cmd
-rw-r--r--  1 root root 2.8K Oct 15 15:06 boot.cmd.bak
-rw-r--r--  1 root root 2.8K Oct 15 15:08 boot.scr
-rw-r--r--  1 root root 137K Sep 14 17:51 config-4.7.3-sunxi
lrwxrwxrwx  1 root root   15 Sep 15 00:41 dtb -> dtb-4.7.3-sunxi
drwxr-xr-x  2 root root 4.0K Sep 15 00:41 dtb-4.7.3-sunxi
-rw-r--r--  1 root root 5.0M Oct 15 09:48 initrd.img-4.7.3-sunxi
-rw-r--r--  1 root root    0 Sep 15 00:39 .next
lrwxrwxrwx  1 root root   18 Sep 15 00:41 script.bin -> bin/cubietruck.bin
-rw-r--r--  1 root root 2.4M Sep 14 17:51 System.map-4.7.3-sunxi
-rw-r--r--  1 root root 5.0M Oct 15 09:48 uInitrd
-rwxr-xr-x  1 root root 5.9M Sep 14 17:51 vmlinuz-4.7.3-sunxi
lrwxrwxrwx  1 root root   19 Sep 15 00:39 zImage -> vmlinuz-4.7.3-sunxi

 

 

files on my SSD /boot (used by boot.cmd on mmcblk0p1)

total 19M
drwxr-xr-x  4 root root 4.0K Oct 16 16:16 .
drwxr-xr-x 22 root root 4.0K Oct 15 16:17 ..
drwxr-xr-x  2 root root 4.0K Sep 15 00:41 bin
-rw-r--r--  1 root root 6.8K Sep 15 00:41 boot.bmp
-rw-r--r--  1 root root 2.8K Sep 15 00:38 boot.cmd
-rw-r--r--  1 root root 2.9K Sep 15 00:42 boot.scr
-rw-r--r--  1 root root 140K Oct 16 14:35 config-4.8.1-sunxi
lrwxrwxrwx  1 root root   15 Oct 16 16:15 dtb -> dtb-4.8.1-sunxi
drwxr-xr-x  2 root root  12K Oct 16 16:15 dtb-4.8.1-sunxi
lrwxrwxrwx  1 root root   15 Sep 15 00:41 dtb.old -> dtb-4.7.3-sunxi
-rw-r--r--  1 root root 5.1M Oct 16 16:15 initrd.img-4.8.1-sunxi
-rw-r--r--  1 root root    0 Oct 16 16:15 .next
lrwxrwxrwx  1 root root   18 Sep 15 00:41 script.bin -> bin/cubietruck.bin
-rw-r--r--  1 root root 2.5M Oct 16 14:35 System.map-4.8.1-sunxi
-rw-r--r--  1 root root 5.1M Oct 16 16:15 uInitrd
-rw-r--r--  1 root root   53 Oct 16 16:16 .verbose
-rwxr-xr-x  1 root root 6.0M Oct 16 14:35 vmlinuz-4.8.1-sunxi
lrwxrwxrwx  1 root root   19 Oct 16 16:15 zImage -> vmlinuz-4.8.1-sunxi
 

 

Link to comment
Share on other sites

[    8.879928] systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE

Please remove any custom module names that you added from /etc/modules file recently. All sound and SPDIF modules are loaded automatically in any case.

 

Must be the /boot directory the same on mmcblk0p1 and my SSD (now my root directory)?

/boot directory should be on your SD card (/dev/mmcblk0p1) and it should be mounted to /boot during the upgrade. systemd-modules-load issue may be caused by incompatibility between kernel on boot partition (zImage on SD cards first partition) and installed modules. If you mount /boot directory and repeat kernel installation, this should be resolved.

 

Edit: you should add entry for /boot partition to fstab, otherwise any Armbian kernel upgrade will break your system. Did you move rootfs to SSD manually or did you use nand-sata-install script?

Link to comment
Share on other sites

I moved rootfs via dd command manually and changed the boot.cmd .

 

Should I change my boot.cmd back to boot from sdcard (?) and :

  • performing the upgrade to new kernel again
  • run the nand-sata-install script the to overwrite my SSD?

EDIT:

 Or should I start with a fresh SDCARD installation?

Link to comment
Share on other sites

EDIT:

 Or should I start with a fresh SDCARD installation?

This would be the easiest solution, especially if you dob't have too many custom settings and software in old installation.

 

Should I change my boot.cmd back to boot from sdcard (?) and :

  • performing the upgrade to new kernel again
  • run the nand-sata-install script the to overwrite my SSD?

This should work too

Link to comment
Share on other sites

This would be the easiest solution, especially if you dob't have too many custom settings and software in old installation.

 

This should work too

Hello,

 

now all is running well (soundcard found, MPD plays over ALSA).

 

  • new sdcard image
  • apt update & upgrade
  • dpkg -i of new Kernel deb
  • setup of mpd, minidlna, webmin
  • mounting my HDD permanently to /mnt/HDD
  • installing my SSD via usb sata adapter
  • running nand-sata-install script

 

Thank you for this!!!!

 

Best Regards,

 

Martin

Link to comment
Share on other sites

Guest HeinrichG

Hi guys,

 

the same here, I'm using 4.4.11 mainline with attached DTS and DTSI files.

 

My aplay -l shows:

root@bananapro:/# aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

root@bananapro:/#

aplay -L:

root@bananapro:~# aplay -L

null

    Discard all samples (playback) or generate zero samples (capture)

default:CARD=sun4icodec

    sun4i-codec,

    Default Audio Device

sysdefault:CARD=sun4icodec

    sun4i-codec,

    Default Audio Device

dmix:CARD=sun4icodec,DEV=0

    sun4i-codec,

    Direct sample mixing device

dsnoop:CARD=sun4icodec,DEV=0

    sun4i-codec,

    Direct sample snooping device

hw:CARD=sun4icodec,DEV=0

    sun4i-codec,

    Direct hardware device without any conversions

plughw:CARD=sun4icodec,DEV=0

    sun4i-codec,

    Hardware device with all software conversions

root@bananapro:~#

lsmod:

root@bananapro:~# lsmod

Module                  Size  Used by

snd_soc_spdif_tx        1936  0

sun4i_can               6386  0

sun4i_i2s               5666  0

sun4i_codec            10962  3

sun4i_spdif             4542  0

pwm_sun4i               4628  0

root@bananapro:~#

Is something wrong?

 

Thank you.

Link to comment
Share on other sites

I'm using 4.4.11 mainline with attached DTS and DTSI files.

 

Is something wrong?

https://linux-sunxi.org/Linux_mainlining_effort#Status_Matrix

SPDIF support for A20 appeared in mainline 4.7

 

Edit: Since you have sun4i_spdif in lsmod output you either mixed up your kernel version number or tried to backport SPDIF support to 4.4 LTS kernel. In the first case you need to check kernel config and dmesg for issues and missing options, in the second case we can only offer support for current Armbian kernel version.

Link to comment
Share on other sites

Guest HeinrichG

Uuuups, sorry, my mistake. I'm using 4.9.11, sorry. It's pure mainline, without any patches or so.

 

I've compiled spdif, i2s, can, ... as modules.

 

 

root@bananapro:~# uname -a
Linux bananapro 4.9.11 #2 SMP Tue Feb 21 19:25:51 CET 2017 armv7l GNU/Linux
root@bananapro:~#
Link to comment
Share on other sites

Uuuups, sorry, my mistake. I'm using 4.9.11, sorry. It's pure mainline, without any patches or so.

 

I've compiled spdif, i2s, can, ... as modules.

 

But you had it running on mainline kernel before, or is this the first try? I mean, it could be broken.

Link to comment
Share on other sites

I've reactivate my BPro after a long time...

 

What do you mean with "it could be broken"? Hardware? Kernel? DTS?

That SPDIF support in kernel was somehow broken, stopped working. I am trying to find out if you might have it working in v4.9.10 (or older) ... and it stopped working on upgrade to version released few days ago. In such case last known good kernel is a starting point.

Link to comment
Share on other sites

Guest HeinrichG

@Igor: Ah, okay, I see. No, my last activities mit BPro were a couple of month ago...

 

@zador.blood.stained: Is there a list of modules which have to be activated to get SPDIF running?

 

I've checked my .config and indeed CONFIG_SND_SIMPLE_CARD is not activated. Or where I can download a config file from Armbian?

Link to comment
Share on other sites

Guest HeinrichG

Hi guys,

 

SUCCESS!!!

 

After I enable CONFIG_SND_SIMPLE_CARD in my kernel config and recompile the stuff, I've got an error:

[    1.697960] OF: /sound/simple-audio-card,codec: could not get #sound-dai-cells for /spdif-out

during booting.

 

So, I added this line (bold) to DTS file:

 

 

spdif_out: spdif-out {
                #sound-dai-cells = <0>;
                compatible = "linux,spdif-dit";
        };

 

build a device tree blob and rebootet my BPro.

 

After that:

root@bananapro:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=sun4icodec
    sun4i-codec,
    Default Audio Device
sysdefault:CARD=sun4icodec
    sun4i-codec,
    Default Audio Device
dmix:CARD=sun4icodec,DEV=0
    sun4i-codec,
    Direct sample mixing device
dsnoop:CARD=sun4icodec,DEV=0
    sun4i-codec,
    Direct sample snooping device
hw:CARD=sun4icodec,DEV=0
    sun4i-codec,
    Direct hardware device without any conversions
plughw:CARD=sun4icodec,DEV=0
    sun4i-codec,
    Hardware device with all software conversions
default:CARD=SPDIF
    BPro SPDIF,
    Default Audio Device
sysdefault:CARD=SPDIF
    BPro SPDIF,
    Default Audio Device
dmix:CARD=SPDIF,DEV=0
    BPro SPDIF,
    Direct sample mixing device
dsnoop:CARD=SPDIF,DEV=0
    BPro SPDIF,
    Direct sample snooping device
hw:CARD=SPDIF,DEV=0
    BPro SPDIF,
    Direct hardware device without any conversions
plughw:CARD=SPDIF,DEV=0
    BPro SPDIF,
    Hardware device with all software conversions
root@bananapro:~#

and

root@bananapro:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SPDIF [BPro SPDIF], device 0: spdif-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Now I look forward to activate I²S. :)

Link to comment
Share on other sites

Guest HeinrichG

Done:

 

 

heinrich@bananapro:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sun4icodec [sun4i-codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: BPro [BPro], device 0: spdif-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: BPro [BPro], device 1: 1c22400.i2s-1c22400.i2s 1c22400.i2s-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
heinrich@bananapro:~$

 

and asoc-simple-card mapping:

 

[    0.319628] simple-framebuffer 7f817000.framebuffer: framebuffer at 0x7f817000, 0x7e9000 bytes, mapped to 0xf0900000
[    0.330308] simple-framebuffer 7f817000.framebuffer: format=x8r8g8b8, mode=1920x1080x32, linelength=7680
[    0.418036] simple-framebuffer 7f817000.framebuffer: fb0: simplefb registered!
[    3.911229] asoc-simple-card sound: dit-hifi <-> 1c21000.spdif mapping ok
[    3.944973] asoc-simple-card sound: 1c22400.i2s <-> 1c22400.i2s mapping ok
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