Thanks for the reply Paul,
alsa and the alsa kernel modules extensions are not on the image, you need to download/install them.
Yes, I figured this out, before I posted. I have downloaded and installed the following TCZ's:
- alsa.tcz
- alsa-modules-4.19.81-piCore.tcz
- alsa-utils.tcz
I'm attempting to get this working with piCore v 11.0 BTW
What does dmesg say about sound modules? You may need to manually load the bcm2835 sound modules.
The only thing I can find in dmesg related to sound/audio are the following 2 lines, which appear to me to say that it is finding the kernel modules, and correctly creating the sound card device:
[ 19.759223] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 20.005672] bcm2835_audio soc:audio: card created with 8 channels
I'm not quite sure why I'm getting the warning, I'm pretty sure I just used
tce-load -iw alsa.tcz
to install the alsa modules.
Just in case you need to see more of the dmesg output, here it is in it's entirety:
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.81-piCore (root@box) (gcc version 8.1.0 (piCore)) #1 Sun Nov 3 14:08:10 UTC 2019
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 8 MiB at 0x1b000000
[ 0.000000] On node 0 totalpages: 114688
[ 0.000000] Normal zone: 1008 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 114688 pages, LIFO batch:31
[ 0.000000] random: get_random_bytes called from start_kernel+0x90/0x4a4 with crng_init=0
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:5D:0D:D6 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed nozswap
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 429736K/458752K available (6960K kernel code, 632K rwdata, 2084K rodata, 456K init, 796K bss, 20824K reserved, 8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xdc800000 - 0xff800000 ( 560 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xdc000000 ( 448 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (6961 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) ( 456 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 633 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 797 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] ftrace: allocating 25190 entries in 74 pages
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000031] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[ 0.000080] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[ 0.000196] bcm2835: system timer (irq = 27)
[ 0.000599] Console: colour dummy device 80x30
[ 0.000625] console [tty1] enabled
[ 0.000694] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[ 0.060341] pid_max: default: 32768 minimum: 301
[ 0.060883] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.060903] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.062302] CPU: Testing write buffer coherency: ok
[ 0.063617] Setting up static identity map for 0x8200 - 0x8238
[ 0.065004] devtmpfs: initialized
[ 0.076304] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[ 0.076711] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.076742] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.078104] pinctrl core: initialized pinctrl subsystem
[ 0.079648] NET: Registered protocol family 16
[ 0.083065] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.090318] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.090334] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.090566] Serial: AMBA PL011 UART driver
[ 0.093784] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[ 0.138214] bcm2835-dma 20007000.dma: DMA legacy API manager at (ptrval), dmachans=0x1
[ 0.140717] SCSI subsystem initialized
[ 0.141164] usbcore: registered new interface driver usbfs
[ 0.141285] usbcore: registered new interface driver hub
[ 0.141465] usbcore: registered new device driver usb
[ 0.160956] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-05-22 21:12, variant start
[ 0.170971] raspberrypi-firmware soc:firmware: Firmware hash is 4da3e1264076308eda90652cb98b553ae0586390
[ 0.183449] clocksource: Switched to clocksource timer
[ 0.290040] VFS: Disk quotas dquot_6.6.0
[ 0.290167] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.290500] FS-Cache: Loaded
[ 0.290848] CacheFiles: Loaded
[ 0.309672] NET: Registered protocol family 2
[ 0.310994] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.311058] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.311128] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.311200] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.311362] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.311395] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.311826] NET: Registered protocol family 1
[ 0.312914] RPC: Registered named UNIX socket transport module.
[ 0.312927] RPC: Registered udp transport module.
[ 0.312932] RPC: Registered tcp transport module.
[ 0.312938] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.313365] Trying to unpack rootfs image as initramfs...
[ 0.945554] Freeing initrd memory: 4704K
[ 0.968241] hw perfevents: no irqs for PMU, sampling events not supported
[ 0.968308] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[ 0.972486] Initialise system trusted keyrings
[ 0.972919] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.988439] FS-Cache: Netfs 'nfs' registered for caching
[ 0.989752] NFS: Registering the id_resolver key type
[ 0.989802] Key type id_resolver registered
[ 0.989810] Key type id_legacy registered
[ 0.989839] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.996115] Key type asymmetric registered
[ 0.996132] Asymmetric key parser 'x509' registered
[ 0.996246] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.996708] io scheduler noop registered
[ 0.996722] io scheduler deadline registered (default)
[ 0.997337] io scheduler cfq registered
[ 0.997353] io scheduler mq-deadline registered (default)
[ 0.997362] io scheduler kyber registered
[ 1.000145] bcm2708_fb soc:fb: FB found 1 display(s)
[ 1.009500] Console: switching to colour frame buffer device 82x26
[ 1.014480] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416
[ 1.016500] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 1.019366] bcm2835-rng 20104000.rng: hwrng registered
[ 1.019878] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 1.020956] vc-sm: Videocore shared memory driver
[ 1.021607] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[ 1.042178] brd: module loaded
[ 1.055721] loop: module loaded
[ 1.056610] Loading iSCSI transport class v2.0-870.
[ 1.057578] usbcore: registered new interface driver smsc95xx
[ 1.057611] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.585660] dwc_otg 20980000.usb: base=(ptrval)
[ 1.786027] Core Release: 2.80a
[ 1.786060] Setting default values for core params
[ 1.786095] Finished setting default values for core params
[ 1.986470] Using Buffer DMA mode
[ 1.986486] Periodic Transfer Interrupt Enhancement - disabled
[ 1.986492] Multiprocessor Interrupt Enhancement - disabled
[ 1.986504] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 1.986617] Dedicated Tx FIFOs mode
[ 1.987520] WARN::dwc_otg_hcd_init:1045: FIQ DMA bounce buffers: virt = db114000 dma = 0x5b114000 len=9024
[ 1.987547] FIQ FSM acceleration enabled for :
[ 1.987547] Non-periodic Split Transactions
[ 1.987547] Periodic Split Transactions
[ 1.987547] High-Speed Isochronous Endpoints
[ 1.987547] Interrupt/Control Split Transaction hack enabled
[ 1.987562] dwc_otg: Microframe scheduler enabled
[ 1.987745] WARN::hcd_init_fiq:457: FIQ on core 0
[ 1.987762] WARN::hcd_init_fiq:458: FIQ ASM at c04ff490 length 36
[ 1.987790] WARN::hcd_init_fiq:497: MPHI regs_base at dc810000
[ 1.987823] dwc_otg 20980000.usb: DWC OTG Controller
[ 1.987916] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[ 1.987992] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[ 1.988046] Init: Port Power? op_state=1
[ 1.988052] Init: Power Port (0)
[ 1.988456] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[ 1.988474] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.988486] usb usb1: Product: DWC OTG Controller
[ 1.988496] usb usb1: Manufacturer: Linux 4.19.81-piCore dwc_otg_hcd
[ 1.988506] usb usb1: SerialNumber: 20980000.usb
[ 1.989611] hub 1-0:1.0: USB hub found
[ 1.989711] hub 1-0:1.0: 1 port detected
[ 1.990786] dwc_otg: FIQ enabled
[ 1.990798] dwc_otg: NAK holdoff enabled
[ 1.990804] dwc_otg: FIQ split-transaction FSM enabled
[ 1.990823] Module dwc_common_port init
[ 1.991376] usbcore: registered new interface driver usb-storage
[ 1.991800] mousedev: PS/2 mouse device common for all mice
[ 1.993251] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 1.993819] bcm2835-cpufreq: min=700000 max=1000000
[ 1.995832] sdhci: Secure Digital Host Controller Interface driver
[ 1.995840] sdhci: Copyright(c) Pierre Ossman
[ 1.996323] mmc-bcm2835 20300000.mmcnr: could not get clk, deferring probe
[ 1.996836] sdhost-bcm2835 20202000.mmc: could not get clk, deferring probe
[ 1.997013] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.997460] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.997572] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.997763] usbcore: registered new interface driver usbhid
[ 1.997769] usbhid: USB HID core driver
[ 1.998642] vchiq: vchiq_init_state: slot_zero = (ptrval), is_master = 0
[ 2.000152] [vc_sm_connected_init]: start
[ 2.008024] [vc_sm_connected_init]: end - returning 0
[ 2.009315] Initializing XFRM netlink socket
[ 2.009367] NET: Registered protocol family 17
[ 2.009487] Key type dns_resolver registered
[ 2.010858] registered taskstats version 1
[ 2.010884] Loading compiled-in X.509 certificates
[ 2.027193] zbud: loaded
[ 2.028221] zswap: loaded using pool lzo/zbud
[ 2.035818] uart-pl011 20201000.serial: cts_event_workaround enabled
[ 2.035927] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 2.037699] console [ttyS0] disabled
[ 2.037746] 20215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 50000000) is a 16550
[ 2.037812] console [ttyS0] enabled
[ 2.039137] mmc-bcm2835 20300000.mmcnr: mmc_debug:0 mmc_debug2:0
[ 2.039151] mmc-bcm2835 20300000.mmcnr: DMA channel allocated
[ 2.067284] sdhost: log_buf @ (ptrval) (5b113000)
[ 2.103249] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 2.104227] random: fast init done
[ 2.104908] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.106526] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.109428] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.114846] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 2.116194] of_cfs_init
[ 2.116306] of_cfs_init: OK
[ 2.120087] Freeing unused kernel memory: 456K
[ 2.120097] This architecture does not have kernel memory protection.
[ 2.120102] Run /init as init process
[ 2.203863] Indeed it is in host mode hprt0 = 00021501
[ 2.274117] mmc0: host does not support reading read-only switch, assuming write-enable
[ 2.278278] mmc0: new high speed SDHC card at address aaaa
[ 2.282651] mmcblk0: mmc0:aaaa SU32G 29.7 GiB
[ 2.314202] mmc1: new high speed SDIO card at address 0001
[ 2.377736] mmcblk0: p1 p2 p3
[ 2.523573] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.523758] Indeed it is in host mode hprt0 = 00001101
[ 2.844173] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
[ 2.844201] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 2.844209] usb 1-1: Product: USB 2.0 Hub
[ 2.845126] hub 1-1:1.0: USB hub found
[ 2.845248] hub 1-1:1.0: 4 ports detected
[ 3.951294] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 7.734006] Adding 1999996k swap on /dev/mmcblk0p3. Priority:-2 extents:1 across:1999996k SSFS
[ 8.031558] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 8.235820] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 19.697415] i2c /dev entries driver
[ 19.710053] uart-pl011 20201000.serial: no DMA platform data
[ 19.759223] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 20.005672] bcm2835_audio soc:audio: card created with 8 channels
[ 20.682420] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 20.808290] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 20.808497] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 20.808508] cfg80211: failed to load regulatory.db
[ 20.885989] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 20.903784] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 20.904112] usbcore: registered new interface driver brcmfmac
[ 21.183613] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 21.183773] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[ 21.184699] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[ 28.631834] random: crng init done
[ 28.744524] NET: Registered protocol family 10
[ 28.752178] Segment Routing with IPv6
[ 30.201404] brcmfmac: power management disabled
[ 30.203404] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 32.385260] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
as for setting the gpio pins, do that from the config.txt with overlays, there should be no need for command line tools.
I saw the overlay method first and thought it appeared to be the easier path, so I tried it. I've tried the following overlays:
- dt_overlay=audremap
- dt_overlay=pwm
- dt_overlay=pwm-2chan
I was unable to get any sound using any of these. I haven't been able to figure out if/how I can verify that the overlay is active, from the command line. So, it becomes a bit of a dead-end for me. Is there a utility I can use or something?
I'm also a bit confused about which pins I should be expecting the output on (several references all quoting pin numbers, and not being clear about which pin numbering they are using). So, if I used an overlay like
dt_overlay=audremap am I reading the README file correctly to assume that the left channel should be coming out of GPIO 12 (physical pin 32 on the header), and the right channel should be coming out of GPIO 13 (physical pin 33 on the header)?
Is there someway to verify that I am in fact getting a pwm signal out of the pin? I ask, because I am connecting the pin to a small board that my buddy built (a band pass filter, and a PAM8403 amplifier), and if I can verify that the pi zero is in fact producing the pwm signal, I think I can focus on the board as the culprit. I'm definitely not an electronics guy, I just dabble a bit for a hobby, but I do have access to a multimeter, and an oscilloscope, if those would be of any use.
Chris