Page 1 of 1

ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Tue Apr 17, 2018 4:21 pm
by AleFachini
Hello:
I've Been working with sam9x35 and i was able to compile flash and boot linux and RFS, even ran some programs.
When i started with audio testing i had issues:
  • Folders inside /dev/snd/* are not mounted
  • Sound cards not found
  • Drivers not Initialized
I don't really know where to start looking for issues.
I'm workin with Buildroot and i'm attaching the kernel config file and the kernel dmesg, and highlighting the pertinent lines I found (may be wrong)

LINUX DEFCONFIG:
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_EMBEDDED=y
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
CONFIG_ARCH_MULTI_V4T=y
CONFIG_ARCH_MULTI_V5=y
# CONFIG_ARCH_MULTI_V7 is not set
CONFIG_ARCH_AT91=y
CONFIG_SOC_AT91RM9200=y
CONFIG_SOC_AT91SAM9=y
CONFIG_AEABI=y
CONFIG_UACCESS_WITH_MEMCPY=y
# CONFIG_ATAGS is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
CONFIG_KEXEC=y
CONFIG_CPU_IDLE=y
# CONFIG_ARM_AT91_CPUIDLE is not set
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_BEET is not set
CONFIG_IPV6_SIT_6RD=y
CONFIG_NETFILTER=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y
CONFIG_CAN=y
CONFIG_CAN_AT91=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
# CONFIG_UEVENT_HELPER is not set
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ATMEL=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_GLUEBI=m
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=4
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_ATMEL_TCLIB=y
CONFIG_ATMEL_SSC=y
CONFIG_EEPROM_AT24=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_NETDEVICES=y
CONFIG_MACB=y
# CONFIG_NET_VENDOR_BROADCOM is not set
CONFIG_DM9000=y
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
CONFIG_DAVICOM_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_MWIFIEX=m
CONFIG_MWIFIEX_SDIO=m
CONFIG_MWIFIEX_USB=m
CONFIG_RT2X00=m
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800USB_RT53XX=y
CONFIG_RT2800USB_RT55XX=y
CONFIG_RT2800USB_UNKNOWN=y
CONFIG_RTL8187=m
CONFIG_INPUT_POLLDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=480
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=272
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_QT1070=y
CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
# CONFIG_SERIO is not set
CONFIG_LEGACY_PTY_COUNT=4
CONFIG_SERIAL_ATMEL=y
CONFIG_SERIAL_ATMEL_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_AT91=y
CONFIG_I2C_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_ATMEL=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_SPIDEV=m
CONFIG_GPIO_SYSFS=y
CONFIG_POWER_RESET=y
CONFIG_POWER_SUPPLY=y
# CONFIG_HWMON is not set
CONFIG_WATCHDOG=y
CONFIG_AT91SAM9X_WATCHDOG=y
CONFIG_MFD_ATMEL_HLCDC=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
# CONFIG_USB_GSPCA is not set
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ATMEL_ISI=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
CONFIG_VIDEO_OV2640=m
CONFIG_VIDEO_OV2659=m
CONFIG_VIDEO_OV7640=m
CONFIG_VIDEO_OV7670=m
# CONFIG_DVB_AU8522_V4L is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set
CONFIG_DRM=y
CONFIG_DRM_ATMEL_HLCDC=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_FB_ATMEL=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_ATMEL_LCDC=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_PWM=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_SOC=y
CONFIG_SND_ATMEL_SOC=y
CONFIG_SND_AT91_SOC_SAM9G20_WM8731=y
CONFIG_SND_ATMEL_SOC_WM8904=y
CONFIG_SND_AT91_SOC_SAM9X5_WM8731=y
CONFIG_SOUND_PRIME=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_ACM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_GADGET=y
CONFIG_USB_ATMEL_USBA=m
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_ZERO=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
# CONFIG_MMC_BLOCK_BOUNCE is not set
CONFIG_MMC_ATMELMCI=y
CONFIG_MMC_SPI=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_GPIO=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_AT91RM9200=y
CONFIG_RTC_DRV_AT91SAM9=y
CONFIG_DMADEVICES=y
CONFIG_AT_HDMAC=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_AT91_ADC=y
CONFIG_PWM=y
CONFIG_PWM_ATMEL=y
CONFIG_PWM_ATMEL_HLCDC_PWM=y
CONFIG_PWM_ATMEL_TCB=y
CONFIG_EXT4_FS=y
CONFIG_FANOTIFY=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_CONFIGFS_FS=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_UTF8=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
CONFIG_DEBUG_USER=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_USER_API_HASH=m
CONFIG_CRYPTO_USER_API_SKCIPHER=m
# CONFIG_CRYPTO_HW is not set
CONFIG_CRC_CCITT=y
LINUX DMESG
RomBOOT



AT91Bootstrap 3.8.6 (vie abr 13 17:44:42 -03 2018)

1-Wire: Loading 1-Wire information ...
1-Wire: ROM Searching ... Done, 1 1-Wire chips found

1-Wire: BoardName | [Revid] | VendorName
Failed to parse the board name: SOM9X35

1-Wiie: Using default information

1-Wire: Board sn: 0x4010425 revision: 0x8421

NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0x32
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctabblity Bits: 4, ECC Sector Bytes: 512
NAND: Diiable On-Die ECC
WARNING: ONFI requires 4-bit/512-byte ECC, but we use 2-bit/512-byte ECC.
NAND: Initialize PMECC params, cap: 2, sector: 512
NAND: Image: Copy 0x3a4d30 bytes from 0x200000 to 0x22000000
NAND: dt blob: Copy 0x72fc bytes from 0x180000 to 0x21000000

Booting zImage ......

Using device tree in place at 0x21000000

Starting linux kernel ..., machid: 0xffffffff

Booting Linux Linux on physical CPU 0x0
Linux version 4.9.30-linuxx4sam_5.6 (afachini@afachini-VBox32) (gcc version 6.4.0 (Buildroot 2017.08) ) #2 Mon Apr 16 09:43:23 -03 2018
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
CPU: VIVT data cache, VIVT instruction cache
OF: fdt:Machine model: Atmel AT91SAM9X35-EK
Memory policy: Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: mem=128M console=ttyS0,115200 mtdparts=atmel_nand:8M(bootstrap/kernel)ro,-(rootfs) rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 122156K/131072K available (5487K kernel code, 180K rwdata, 1372K rodata, 196K init, 192K bss, 8916K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xc8800000 - 0xff800000 ( 880 MB)
lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0564350 (5489 kB)
.init : 0xc06e3000 - 0xc0714000 ( 196 kB)
.data : 0xc0714000 - 0xc0741120 ( 181 kB)
.bss : 0xc0741120 - 0xc077132c ( 193 kB)
NR_IRQS:16 nr_irqs:16 16
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 7167226906 ns
sched_clock: 32 bits at 128 Hz, resolution 7812500ns, wraps every 16777215996093750ns
Console: colour dummy device 80x30
Calibrating delay loop... 198.76 BogoMIPS (lpj=775168)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x20008400 - 0x2000847c
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 14931722236523437 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
AT91: Detected SoC family: at91sam9x5
AT91: Detected SoC: at91sam9x35, revision 1

gpio-at91 fffff400.gpio: at address c8861400
gpio-at91 fffff600.gpio: at address c8863600
gpio-at91 fffff800.gpio: at address c8865800
gpio-at91 fffffa00.gpio: at address c8867a00
pinctrl-at91 ahb:apb:pinctrl@fffff400: initialized AT91 pinctrl driver
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 114675631333 ns
at_hdmac ffffec00.dma-controller: Atmel AHB DMA Controller ( cpy set slave sg-cpy ), 8 channels
at_hdmac ffffee00.dma-controller: Atmel AHB DMA Controller ( cpy set slave sg-cpy ), 8 channels
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8010000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f8010000.i2c: AT91 i2c bus driver (hw version: 0x402).

Linux video capture interface: v2.00
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=30 max_order=15 bucket_order=0
io scheduler noop registered (default)
fffff200.serial: ttyS0 at MMIO 0xfffff200 (irq = 16, base_baud = 8333333) is a ATMEL_SERIAL
console [ttyS0] enabled
f801c000.serial: ttyS1 at MMIO 0xf801c000 (irq = 25, base_baud = 8333333) is a ATMEL_SERIAL
[drm] Initialized
brd: module loaded
loop: module loaded
ssc f0010000.ssc: Atmel SSC device at 0xc88a4000 (irq 22)
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to create HLCDC outputs: -517
atmel-hlcdc-display-controller atmel-hlcdc-dc: failed to initialize mode setting
atmel_nand 40000000.nand: Using dma0chan2 for DMA transfers.
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xaa
nand: Micron MT29F2G08ABBEAHC
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
atmel_nand 40000000.nand: Use On Flash BBT
atmel_nand 40000000.nand: minimum ECC: 4 bits in 512 bytes
atmel_nand 40000000.nand: WARNING: Be Caution! Using different PMECC parameters from Nand ONFI ECC reqirement.
atmel_nand 40000000.nand: Initialize PMECC params, cap: 2, sector: 512
nand: WARNING: 40000000.nand: the ECC used on your system is too weak compared to the one required by the NAND chip
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: bad block at 0x00000e340000
2 cmdlinepart partitions found on MTD device atmel_nand
Creating 2 MTD partitions on "atmel_nand":
0x000000000000-0x000000800000 : "bootstrap/kernel"
0x000000800000-0x000010000000 : "rootfs"
libphy: Fixed MDIO Bus: probed
CAN device driver interface
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Generic PHY f802c000.etherne:00:0attached PHY driver [Generic PHY] (mii_bus:phy_addr=f802c000.etherne:00, irq=-1)
macb f802c000.ethernet eth0: Cadence MACB rev 0x0001010c at 0xf802c000 irq 30 (5a:c1:17:22:2b:b6)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci::irq 31, io mem 0x00770000
atmelatmel-ehci 700000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.9.30-linux4sam_5.6 ehci_hcd
usb usb1: SerialNumber: 700000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 600000.ohci: failed to find sfr node
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 31, io mem 0x00600000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.9.30-linux4sam_5.6 ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
mousedev: PS/2 mouse device common for all mice
qt1070 0-001b: can not read register, returned -121
qt1070 0-001b: ID -121 not supported
rtc rtc0: alarm rollover not handled
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc fffffeb0.rtc: rtc core: registered fffffeb0.rtc as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after user reset
at91_wdt fffffe40.watchdog: watchdog is disabled
at91_wdt: probe of fffffe40.watchdog failed with error -22
atmel_mci f0008000.mmc: version: 0x504
atmel_mci f0008000.mmc: using dma0chan3 for DMA transfers
atmel_mci f0008000.mmc: Atmel MCI controller at 0xf0008000 irq 23, 1 slots
atmel_mci f000c000.mmc: version: 0x504
atmel_mci f000c000.mmc: using dma1chan0 for DMA transfers
atmel_mci f000c000.mmc: Atmel MCI controller at 0xf000c000 irq 24, 1 slots
leddtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
iio iio:device0: Resolution used: 10 bits
input: at91_adc as /devices/socc/ahb/ahb:apb/f804c000.adc/input/input0
wm8731 0-001a: Assuming static MCLK
0-001a supply AVDD not found, using dummy regulator
0-001a supply HPVDD not found, using dummy regulator
0-001a supply DCVDD not found, using dummy regulator
0-001a supply DBVDD not found, using dummy regulator
wm8731 0-001a: Failed to issue reset: -121
wm8731: probe of 0-001a failed with error -121
sam9x5-snd-wm8731 sound: ASoC: CODEC DAI wm8731-hifi not registered
sam9x5-snd-wm8731 sound: ASoC: Platform device allocation failed

ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
atmel-hlcdc-display-controller atmel-hlcdc-dc: DRM device successfully registered
sam9x5-snd-wm8731 sound: ASoC: CODEC DAI wm8731-hifi not registered
sam9x5-snd-wm8731 sound: ASoC: Platform device allocation failed

ubi0: default fastmap pool size: 95
ubi0: default fastmap WL pool size: 47
ubi0: attaching mtd1
random: fast init done
ubi0: scannin scs finished
ubi0: attached mtd1 (name "rootfs", size 248 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 1979, bad PEBs: 5, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1887926208
ubi0: available PEBs: 0, total reserved PEBs: 1979, PEBs reserved for bad PEB handling: 35
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 06:02:28 UTC (1167631348)
panel-power-supply: disabling
ALSA device list:
No soundcards found.

ubi0: background thread "ubi_bgt0d" started, PID 61
UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 62
UBIFS (ubi0:0): recovery needed
UBIFS (ubi0:0): recovery completed
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048bytes/2048 bytes
UBIFS (ubi0:0): FS size: 244682752 bytes (233 MiB, 1927 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 6BDA07DF-4D23-41EC-AB63-E7B4163F0267, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 196K (c06e3000 - c0714000)
This architecture does not have kernel memory protection.
Starting logging: OK
Initializing random number generator... done.
Starting system message bus: done
Starting network: OK
Starting dropbear sshd: OK
Starting sshd: OK
Hola desde Hello.c


Welcome to Buildroot

buildroot login: atmel-hlcdc-display-controller atmel-hlcdc-dc: fb0: frame buffer device
Some other DATA:
cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k4.9.30-linux4sam_5.6.
# ls /dev
bus ram1 tty41
console ram2 tty42
cpu_dma_latency ram3 tty43
dri random tty44
fb0 rtc0 tty45
full shm tty46
gpiochip0 snd tty47
gpiochip1 tty tty48
gpiochip2 tty0 tty49
gpiochip3 tty1 tty5
hwrng tty10 tty50
i2c-0 tty11 tty51
iio:device0 tty12 tty52
input tty13 tty53
kmem tty14 tty54
kmsg tty15 tty55
log tty16 tty56
loop-control tty17 tty57
loop0 tty18 tty58
loop1 tty19 tty59
loop2 tty2 tty6
loop3 tty20 tty60
loop4 tty21 tty61
loop5 tty22 tty62
loop6 tty23 tty63
loop7 tty24 tty7
mem tty25 tty8
memory_bandwidth tty26 tty9
mtd0 tty27 ttyS0
mtd0ro tty28 ttyS1
mtd1 tty29 ttyp0
mtd1ro tty3 ttyp1
mtdblock0 tty30 ttyp2
mtdblock1 tty31 ttyp3
network_latency tty32 ubi0
network_throughput tty33 ubi0_0
null tty34 ubi_ctrl
ptmx tty35 urandom
pts tty36 vcs
ptyp0 tty37 vcs1
ptyp1 tty38 vcsa
ptyp2 tty39 vcsa1
ptyp3 tty4 zero
ram0 tty40
I would appreciate ANY help, suggestion or correction, toward solving this.

Regards Alejandro-

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Wed Apr 18, 2018 12:00 am
by blue_z
AleFachini wrote:I would appreciate ANY help, suggestion or correction, toward solving this.
Okay, here it goes:

AleFachini wrote:I've Been working with sam9x35 ...
You're not clear. What board is this?

AleFachini wrote:Folders inside /dev/snd/* are not mounted
Unless there's a GUI, there are no "folders". A folder is not necessarily a directory.
Filesystems get mounted, not "folders", not directories, not device nodes.
A device node (aka special file) is created (e.g. the mknod command).

AleFachini wrote:Drivers not Initialized
A vague conclusion.

The root problem seems to be the failure of the wm8731 driver to initialize (errno = 121, EREMOTEIO).
The typical kernel configuration that Atmel uses specifies such sound drivers as loadable modules rather than built-in modules.
You should revert to this conventional configuration to test if there is a timing dependency.
If there is no timing dependency, then you'll have to find the source of the EREMOTEIO.

Booting Linux Linux on physical CPU 0x0
Linux version 4.9.30-linuxx4sam_5.6 (afachini@afachini-VBox32) (gcc version 6.4.0 (Buildroot 2017.08) ) #2 Mon Apr 16 09:43:23 -03 2018
Why are there typos in the boot log?
BTW a plain listing of a directory (e.g. `ls /dev`) is not as helpful as you seem to think it is. Provide the full listing (e.g. the -l option) if at all.


Both U-Boot and the kernel have issued warnings that the PMECC configuration for the NAND chip is deficient.
Why haven't you corrected the issue?


Regards

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Wed Apr 18, 2018 2:58 pm
by AleFachini
blue_z wrote:You're not clear. What board is this?
Specific CM is SAM9x35 EMBEST but is made from a private vendor(APEXAR, check log), I say is embest because has 2 micro switch not jumpers (as ronetix have). The Board Is CUSTOM.
Another Clarification, i've checked the schematics for pinout from EMBEST and RONETIX to wm8731 and there is a discrepance, see EK_FLEXTRONICS_RevB.pdf from files at microchip's site for sam9x5 page 8/14:
While PA24 to PA29 are connected the same from SAM CM to CODEC, PA30 and PA31 are connected to PC0 and PC1 in this board, (this project wasn't designed by me, was given as payment with very few information). I believe this is the first big issue since codecs may be mapping these pins wrong.

Blue_z wrote:Unless there's a GUI, there are no "folders". A folder is not necessarily a directory.
Filesystems get mounted, not "folders", not directories, not device nodes.
A device node (aka special file) is created (e.g. the mknod command).

Yes, i understand this, i am using unproper terms because i'm just new at this, I was referring to what you say. What i try to say is that, buildroot should mount a device table at boot, where i should have paths like the ones in the example link. These devices are not mounting, but i don't have idea if this depends on buildroot's config or not, or because hardware is wrong. I refer as mounting because i've read this word in every website i've found, sorry if it's not correct.
I did not try to mount manually, also i don't quite understand how.

Blue_z wrote:A vague conclusion.
Well, yeah it was just a brief before the logs and all the post.
Blue_z wrote:The root problem seems to be the failure of the wm8731 driver to initialize (errno = 121, EREMOTEIO).
The typical kernel configuration that Atmel uses specifies such sound drivers as loadable modules rather than built-in modules.
You should revert to this conventional configuration to test if there is a timing dependency.
If there is no timing dependency, then you'll have to find the source of the EREMOTEIO.

First: How did you found that error 121 is that one? i tried and couldn't find it.
Second: Yes, i changed buildroot to mount on start, I think i should try load them after. Should i do it from console, and later with init script?

Blue_z wrote:Why are there typos in the boot log?
Probably my Terminal.
Blue_z wrote:BTW a plain listing of a directory (e.g. `ls /dev`) is not as helpful as you seem to think it is. Provide the full listing (e.g. the -l option) if at all.

Ok, lets see:
# ls -l /dev
total 0
drwxr-xr-x 3 root root 60 Jan 1 1970 bus
crw------- 1 root root 5, 1 Jan 1 00:02 console
crw------- 1 root root 10, 63 Jan 1 1970 cpu_dma_latency
drwxr-xr-x 2 root root 80 Jan 1 1970 dri
crw------- 1 root root 29, 0 Jan 1 00:00 fb0
crw-rw-rw- 1 root root 1, 7 Jan 1 1970 full
crw------- 1 root root 254, 0 Jan 1 1970 gpiochip0
crw------- 1 root root 254, 1 Jan 1 1970 gpiochip1
crw------- 1 root root 254, 2 Jan 1 1970 gpiochip2
crw------- 1 root root 254, 3 Jan 1 1970 gpiochip3
crw------- 1 root root 10, 183 Jan 1 1970 hwrng
crw------- 1 root root 89, 0 Jan 1 1970 i2c-0
crw------- 1 root root 252, 0 Jan 1 1970 iio:device0
drwxr-xr-x 2 root root 100 Jan 1 1970 input
crw------- 1 root root 1, 2 Jan 1 1970 kmem
crw-r--r-- 1 root root 1, 11 Jan 1 1970 kmsg
srw-rw-rw- 1 root root 0 Jan 1 00:00 log
crw------- 1 root root 10, 237 Jan 1 1970 loop-control
brw------- 1 root root 7, 0 Jan 1 1970 loop0
brw------- 1 root root 7, 1 Jan 1 1970 loop1
brw------- 1 root root 7, 2 Jan 1 1970 loop2
brw------- 1 root root 7, 3 Jan 1 1970 loop3
brw------- 1 root root 7, 4 Jan 1 1970 loop4
brw------- 1 root root 7, 5 Jan 1 1970 loop5
brw------- 1 root root 7, 6 Jan 1 1970 loop6
brw------- 1 root root 7, 7 Jan 1 1970 loop7
crw------- 1 root root 1, 1 Jan 1 1970 mem
crw------- 1 root root 10, 60 Jan 1 1970 memory_bandwidth
crw------- 1 root root 90, 0 Jan 1 1970 mtd0
crw------- 1 root root 90, 1 Jan 1 1970 mtd0ro
crw------- 1 root root 90, 2 Jan 1 1970 mtd1
crw------- 1 root root 90, 3 Jan 1 1970 mtd1ro
brw------- 1 root root 31, 0 Jan 1 1970 mtdblock0
brw------- 1 root root 31, 1 Jan 1 1970 mtdblock1
crw------- 1 root root 10, 62 Jan 1 1970 network_latency
crw------- 1 root root 10, 61 Jan 1 1970 network_throughput
crw-rw-rw- 1 root root 1, 3 Jan 1 1970 null
crw-rw-rw- 1 root root 5, 2 Jan 1 1970 ptmx
drwxr-xr-x 2 root root 0 Jan 1 00:00 pts
crw------- 1 root root 2, 0 Jan 1 1970 ptyp0
crw------- 1 root root 2, 1 Jan 1 1970 ptyp1
crw------- 1 root root 2, 2 Jan 1 1970 ptyp2
crw------- 1 root root 2, 3 Jan 1 1970 ptyp3
brw------- 1 root root 1, 0 Jan 1 1970 ram0
brw------- 1 root root 1, 1 Jan 1 1970 ram1
brw------- 1 root root 1, 2 Jan 1 1970 ram2
brw------- 1 root root 1, 3 Jan 1 1970 ram3
crw-rw-rw- 1 root root 1, 8 Jan 1 1970 random
crw------- 1 root root 253, 0 Jan 1 1970 rtc0
drwxrwxrwx 2 root root 40 Jan 1 00:00 shm
drwxr-xr-x 2 root root 60 Jan 1 1970 snd
crw-rw-rw- 1 root root 5, 0 Jan 1 1970 tty
crw------- 1 root root 4, 0 Jan 1 1970 tty0
crw------- 1 root root 4, 1 Jan 1 1970 tty1
crw------- 1 root root 4, 10 Jan 1 1970 tty10
crw------- 1 root root 4, 11 Jan 1 1970 tty11
crw------- 1 root root 4, 12 Jan 1 1970 tty12
crw------- 1 root root 4, 13 Jan 1 1970 tty13
crw------- 1 root root 4, 14 Jan 1 1970 tty14
crw------- 1 root root 4, 15 Jan 1 1970 tty15
crw------- 1 root root 4, 16 Jan 1 1970 tty16
crw------- 1 root root 4, 17 Jan 1 1970 tty17
crw------- 1 root root 4, 18 Jan 1 1970 tty18
crw------- 1 root root 4, 19 Jan 1 1970 tty19
crw------- 1 root root 4, 2 Jan 1 1970 tty2
crw------- 1 root root 4, 20 Jan 1 1970 tty20
crw------- 1 root root 4, 21 Jan 1 1970 tty21
crw------- 1 root root 4, 22 Jan 1 1970 tty22
crw------- 1 root root 4, 23 Jan 1 1970 tty23
crw------- 1 root root 4, 24 Jan 1 1970 tty24
crw------- 1 root root 4, 25 Jan 1 1970 tty25
crw------- 1 root root 4, 26 Jan 1 1970 tty26
crw------- 1 root root 4, 27 Jan 1 1970 tty27
crw------- 1 root root 4, 28 Jan 1 1970 tty28
crw------- 1 root root 4, 29 Jan 1 1970 tty29
crw------- 1 root root 4, 3 Jan 1 1970 tty3
crw------- 1 root root 4, 30 Jan 1 1970 tty30
crw------- 1 root root 4, 31 Jan 1 1970 tty31
crw------- 1 root root 4, 32 Jan 1 1970 tty32
crw------- 1 root root 4, 33 Jan 1 1970 tty33
crw------- 1 root root 4, 34 Jan 1 1970 tty34
crw------- 1 root root 4, 35 Jan 1 1970 tty35
crw------- 1 root root 4, 36 Jan 1 1970 tty36
crw------- 1 root root 4, 37 Jan 1 1970 tty37
crw------- 1 root root 4, 38 Jan 1 1970 tty38
crw------- 1 root root 4, 39 Jan 1 1970 tty39
crw------- 1 root root 4, 4 Jan 1 1970 tty4
crw------- 1 root root 4, 40 Jan 1 1970 tty40
crw------- 1 root root 4, 41 Jan 1 1970 tty41
crw------- 1 root root 4, 42 Jan 1 1970 tty42
crw------- 1 root root 4, 43 Jan 1 1970 tty43
crw------- 1 root root 4, 44 Jan 1 1970 tty44
crw------- 1 root root 4, 45 Jan 1 1970 tty45
crw------- 1 root root 4, 46 Jan 1 1970 tty46
crw------- 1 root root 4, 47 Jan 1 1970 tty47
crw------- 1 root root 4, 48 Jan 1 1970 tty48
crw------- 1 root root 4, 49 Jan 1 1970 tty49
crw------- 1 root root 4, 5 Jan 1 1970 tty5
crw------- 1 root root 4, 50 Jan 1 1970 tty50
crw------- 1 root root 4, 51 Jan 1 1970 tty51
crw------- 1 root root 4, 52 Jan 1 1970 tty52
crw------- 1 root root 4, 53 Jan 1 1970 tty53
crw------- 1 root root 4, 54 Jan 1 1970 tty54
crw------- 1 root root 4, 55 Jan 1 1970 tty55
crw------- 1 root root 4, 56 Jan 1 1970 tty56
crw------- 1 root root 4, 57 Jan 1 1970 tty57
crw------- 1 root root 4, 58 Jan 1 1970 tty58
crw------- 1 root root 4, 59 Jan 1 1970 tty59
crw------- 1 root root 4, 6 Jan 1 1970 tty6
crw------- 1 root root 4, 60 Jan 1 1970 tty60
crw------- 1 root root 4, 61 Jan 1 1970 tty61
crw------- 1 root root 4, 62 Jan 1 1970 tty62
crw------- 1 root root 4, 63 Jan 1 1970 tty63
crw------- 1 root root 4, 7 Jan 1 1970 tty7
crw------- 1 root root 4, 8 Jan 1 1970 tty8
crw------- 1 root root 4, 9 Jan 1 1970 tty9
crw------- 1 root root 4, 64 Jan 1 1970 ttyS0
crw------- 1 root root 4, 65 Jan 1 1970 ttyS1
crw------- 1 root root 3, 0 Jan 1 1970 ttyp0
crw------- 1 root root 3, 1 Jan 1 1970 ttyp1
crw------- 1 root root 3, 2 Jan 1 1970 ttyp2
crw------- 1 root root 3, 3 Jan 1 1970 ttyp3
crw------- 1 root root 250, 0 Jan 1 1970 ubi0
crw------- 1 root root 250, 1 Jan 1 1970 ubi0_0
crw------- 1 root root 10, 59 Jan 1 1970 ubi_ctrl
crw-rw-rw- 1 root root 1, 9 Jan 1 1970 urandom
crw------- 1 root root 7, 0 Jan 1 1970 vcs
crw------- 1 root root 7, 1 Jan 1 1970 vcs1
crw------- 1 root root 7, 128 Jan 1 1970 vcsa
crw------- 1 root root 7, 129 Jan 1 1970 vcsa1
crw-rw-rw- 1 root root 1, 5 Jan 1 1970 zero
Blue_z wrote:Both U-Boot and the kernel have issued warnings that the PMECC configuration for the NAND chip is deficient.
Why haven't you corrected the issue?
Nope. I really don't know. The way i have to flash for the system to work is:
Flash Bootstrap
flash DTB
Flash kernel
Reboot with sw1 and sw2 off
Enable NandFlash script
Enable PMECC, check trimffs
FLASH RFS

If i use trimffs for the other binaries, nothing work.

Extra Data: I have a RONETIX CM on the SAM9x5ek and these images on that board won't even boot, not even the atbootstrap (terminal only throws RomBoot and stops there). THis is just a comment might help or not.

1- What should i do About PMECC?
2- How do i change and where do i change the pins for the bus in Drivers to point PC0 and PC1 instead of PA30 and PA31?
3- How should i mount manually the devices?
4- Can ou telll why buildroot isnt readib├žng the custom devie table?
5- Are all options needed in the kernel config(first post) file for SOUND activated?

Regards Alejandro.-

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Fri Apr 20, 2018 1:51 am
by blue_z
AleFachini wrote:Specific CM is SAM9x35 EMBEST but is made from a private vendor(APEXAR, check log), I say is embest because has 2 micro switch not jumpers (as ronetix have). The Board Is CUSTOM.
Another Clarification, i've checked the schematics for pinout from EMBEST and RONETIX to wm8731 and there is a discrepance, see EK_FLEXTRONICS_RevB.pdf from files at microchip's site for sam9x5 page 8/14:
While PA24 to PA29 are connected the same from SAM CM to CODEC, PA30 and PA31 are connected to PC0 and PC1 in this board, (this project wasn't designed by me, was given as payment with very few information). I believe this is the first big issue since codecs may be mapping these pins wrong.
You're clear as mud.
What kind of page number is that?
Why would a pair of PIO pins be connected to another pair of PIO pins?
If you don't know if your SoC is properly connected to the codec chip, then you're wasting everybody's time with software questions.

AleFachini wrote:Yes, i understand this, i am using unproper terms because i'm just new at this, I was referring to what you say. What i try to say is that, buildroot should mount a device table at boot, where i should have paths like the ones in the example link. These devices are not mounting, but i don't have idea if this depends on buildroot's config or not, or because hardware is wrong. I refer as mounting because i've read this word in every website i've found, sorry if it's not correct.
I did not try to mount manually, also i don't quite understand how.
You claim you understand, yet you argue that other sites are correct, so therefore I must be wrong?
You write that you're sorry, yet persist in misusing jargon, and apparently refuse to learn.
Read the man pages for the mount and modprobe commands, and stop misusing jargon.
You're going to stay "new at this" if you fail to learn the proper matching of nouns and verbs.

AleFachini wrote:First: How did you found that error 121 is that one? i tried and couldn't find it.
Did you try googling for "linux errno 121"?
AleFachini wrote:Second: Yes, i changed buildroot to mount on start, I think i should try load them after. Should i do it from console, and later with init script?
Drivers are not "mounted". A (loadable) module is loaded (and then init'd).

AleFachini wrote:1- What should i do About PMECC?
Specify the required ECC strength. A more complete answer is off-topic.

AleFachini wrote:2- How do i change and where do i change the pins for the bus in Drivers to point PC0 and PC1 instead of PA30 and PA31?
Again, this makes no sense.
Instead of just mentioning PIO pin names, include the signal name and the other end of the connection.

AleFachini wrote:3- How should i mount manually the devices?
What filesystems do you want to mount?

AleFachini wrote:4- Can ou telll why buildroot isnt readib├žng the custom devie table?
Buildroot only executes on your host PC to compile/build the kernel and root filesystem. Buildroot does not execute on your target board.
What table are you referring to?

AleFachini wrote:5- Are all options needed in the kernel config(first post) file for SOUND activated?
Seems okay.

Regards

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Fri Apr 20, 2018 2:42 pm
by AleFachini
blue_z wrote:You're clear as mud.
What kind of page number is that?
Why would a pair of PIO pins be connected to another pair of PIO pins?
If you don't know if your SoC is properly connected to the codec chip, then you're wasting everybody's time with software questions.
GSUS!, I totally butchered what i wanted to say. I'll try again:
In original schematics pdf, from microchip's website CODEC's pins are conected to the following SAM port Pins:
CODEC PINS >>> SAM PINS
[*] RK >>> PA28
[*] TK >>> PA24
[*] TD >>> PA26
[*] TF >>> PA25
[*] RD >>> PA27
[*] RF >>> PA29
[*] TWD0 >>> PA30
[*] TWCK0 >>> PA31

In this CUSTOM BOARD, the connections are:
CODEC PINS >>> SAM PINS
[*] RK >>> PA28
[*] TK >>> PA24
[*] TD >>> PA26
[*] TF >>> PA25
[*] RD >>> PA27
[*] RF >>> PA29
[*] TWD0 >>> PC00
[*] TWCK0 >>> PC01

This new board was working in a prototype where i can't access to the kernel configurations, thats why i dont know whats the customization of pins or whatever it might be.
The page I refer to is page 8 in a pdf of 14 pages, I really thought this was pretty simple to understand, clearly i'm pretty bad going from mind spanish to written english.
Now the question is: Is it probably that; as these pins are not the same, i'm having trouble initializing the driver? If it is so, i should ask in which part of the dtbs or where should i change these pin configs, this is advanced for me but i have no choice

blue_z wrote:You claim you understand, yet you argue that other sites are correct, so therefore I must be wrong?

You write that you're sorry, yet persist in misusing jargon, and apparently refuse to learn.
Read the man pages for the mount and modprobe commands, and stop misusing jargon.
You're going to stay "new at this" if you fail to learn the proper matching of nouns and verbs.
Well yes, it was a lazy excuse, i'll be more professional or at least try to. I dont know if you are a mean person or a very good teacher, thanks anyways.

blue_z wrote:Did you try googling for "linux errno 121"? .
no, i copy pasted the error as appear in log, "error -121+ linux+ alsa" and lots of combinations, but never "errno 121". but this is something good to know for the future!!
blue_z wrote: Drivers are not "mounted". A (loadable) module is loaded (and then init'd).
Ok, the word is LOADED then?
Specify the required ECC strength. A more complete answer is off-topic.
Forgot to mention I used this:
linux4sam/bin/view/Linux4SAM/FlashRootF ... ing_SAM_BA
Using the same config, Ill try to see whats wrong, but thanks.


So from the guide i linked before in the first post the "folders" (correct my concepts please) I should have in /dev directory are:
# Audio stuff
/dev/audio c 666 0 29 14 4 - - -
#/dev/audio1 c 666 0 29 14 20 - - -
/dev/dsp c 666 0 29 14 3 - - -
#/dev/dsp1 c 666 0 29 14 19 - - -
#/dev/sndstat c 666 0 29 14 6 - - -
/dev/mixer c 666 0 29 14 0 - - -
/dev/snd d 755 0 29 - - - - -
/dev/snd/controlC0 c 666 0 29 116 0 - - -
/dev/snd/pcmC0D0c c 666 0 29 116 24 - - -
/dev/snd/pcmC0D0p c 666 0 29 116 16 - - -
/dev/snd/seq c 666 0 29 116 1 - - -
/dev/snd/timer c 666 0 29 116 33 - - -
This is a fragment of a custom device table for ALSA to work. This table can be pointed to from buildroot menues to compile it into the kernel, I dont know how to check this, except than going to dev and doing ls -l and checking.
From the above list, and from comand line, there exist only:

[*]/dev/snd
[*]/dev/snd/timer

So, its like i dont know where to start, what do you suggest?

EDIT: So, I Flashed my images in the Evaluation Kit with a RONETIX SAM and the drivers are found and initialized, which means my kernel config isn't all wrong. But when i try to speaker-test:
speaker-test 1.1.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 1024 to 32768
Period size range from 128 to 4096
Using max buffer size 32768
Periods = 4
was set period_size = 4096
was set buffer_size = 32768
0 - Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error
ALSO: i ran: less /proc/modules

and after several tries, and different terminal sofwares i got this everytime:
less /proc/modules
[0;0H[K
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[K~
[24;0H[K[7m/proc/modules[0m


So now I have 2 problems:
1) Clearly I have problems with the hardware pin connections and pin mapping of the driver, should I start messing with driver configs?
2) In the working kit, i have to change some configs, no idea where to start to find solution. Directions?

Thank you, Alejandro.

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Fri Apr 20, 2018 10:02 pm
by blue_z
AleFachini wrote:In original schematics pdf, from microchip's website CODEC's pins are conected to the following SAM port Pins:
CODEC PINS >>> SAM PINS
[*] RK >>> PA28
[*] TK >>> PA24
[*] TD >>> PA26
[*] TF >>> PA25
[*] RD >>> PA27
[*] RF >>> PA29
[*] TWD0 >>> PA30
[*] TWCK0 >>> PA31

In this CUSTOM BOARD, the connections are:
CODEC PINS >>> SAM PINS
[*] RK >>> PA28
[*] TK >>> PA24
[*] TD >>> PA26
[*] TF >>> PA25
[*] RD >>> PA27
[*] RF >>> PA29
[*] TWD0 >>> PC00
[*] TWCK0 >>> PC01

So the original relevant pin configuration is described in at91sam9x5ek.dtsi by

Code: Select all

			i2c0: i2c@f8010000 {
				status = "okay";

				wm8731: wm8731@1a {
					compatible = "wm8731";
					reg = <0x1a>;
				};
			};

The proper way to disable this node and assign PC0 and PC1 (which belong to i2c1), could be inserting the following to the top-level dts file (which would be a renamed copy of at91sam9x35ek.dts to reflect your custom module):

Code: Select all

	ahb {
		apb {
			... 

			i2c0: i2c@f8010000 {
				status = "disabled";
			};

			i2c1: i2c@f8014000 {
				status = "okay";

				wm8731: wm8731@1a {
					compatible = "wm8731";
					reg = <0x1a>;
				};
			};

			... 
		};
	};
};
This will disable the QT1070 keypads (which also uses i2c0). You would have to instead actually hack at91sam9x5dm.dtsi and at91sam9x5ek.dtsi to preserve that functionality.

Regards

Re: ALSA Sound on SAM9x35, kernel not mounting devices, CODEC wm8731

Posted: Thu May 03, 2018 3:32 pm
by PowerPenguin
Hi AleFachini,

if your kernel version has support for your codec e.g. [*] wm8731 you can run the codec by fake Kconfig "your sound card with your codec" based on SND_SIMPLE_CARD.

See my post, viewtopic.php?f=12&t=26510

I had a lot of troubles to get PCK0 driving the codec clk input (no codec crystal to safe the money).
At the 4 line audio interface (IN,OUT,FRAME,CLK) in my setup the codec has to drive the CLK.

Also important: I2C codec control must be set to I2C GPIO bit bang driver because the TWI (IP) never worked (bug) !
check if there is codec SPI support as alternative too and what setup interface is hard wired at codec

Good luck and let the music play :-)

Best regards,
PP

P.S. : Because the PCK0 divder is not exactly e.g. 12MHz you can tune the FRAME to match e.g. 44.1kHz exactly by scope with this parameter of device tree simple-audio-card,mclk-fs = <256>; If they call it pitch any one who knows a turntable will unterstand it much quicker :D
Check your codec driver / datasheet for the default crystal and set it as PCK0
Use a website to convert a mp3 to wav with 44.1kHZ 8 bit stereo, play it with aplay. No time out is a good sign because interface is shifting the PCM out.
Use a real headphone as codec load or 32 Ohm with scope. With out load no level even if the digital SSC lines show the expected !
before first audio out ssh to alsa-mixer and open all volumes to 100% (there some hidden in small windows, scroll left to see all/more) and unmute everything