Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: MikkelM on August 28, 2019, 06:10:22 AM
-
I am trying to get audio to work over PWM pins, but without luck
I have followed the tricks described here, by setting GPIO pins.
http://forum.tinycorelinux.net/index.php?topic=20550.0
My image (the SDcard) works as intended on an Pi 3 model B
I get this error on the Pi Zero
tc@box:~$ aplay -l
aplay: device_list:268: no soundcards found...
Here is my config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
[PI0]
initramfs 9.0.3.gz followkernel
kernel kernel4922.img
cmdline cmdline.txt
[PI1]
initramfs 9.0.3.gz followkernel
kernel kernel4922.img
cmdline cmdline.txt
[PI2]
initramfs 9.0.3v7.gz followkernel
kernel kernel4922v7.img
cmdline cmdline.txt
[PI3]
initramfs 9.0.3v7.gz followkernel
kernel kernel4922v7.img
cmdline cmdline3.txt
[ALL]
#----------------------------------------------------
# Enable peripheral buses
dtparam=i2c=on,spi=on,i2s=on
# Enable serial console
enable_uart=1
[PI3]
dtoverlay=pi3-disable-bt
[ALL]
dtparam=audio=on
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
gpu_mem=16
Cheers
Mikkel
-
Did you add the appropriate kernel driver. It is not included by default.
AFAIK, it is not included in any extension, but would be in the module tar package.
-
Hi Paul.
Thank you. Can you hint me were to find modular tar package and how to add the right kernel driver.
Yes I am a newbie.
Cheers
Mikkel
-
Hi MikkelM
... Can you hint me were to find modular tar package ...
ARM6:
http://tinycorelinux.net/9.x/armv6/releases/RPi/src/kernel/
ARM7:
http://tinycorelinux.net/9.x/armv7/releases/RPi/src/kernel/
-
Ok, and how do I do it? Do I need to compile a new kernel?
And what do I need to include from the modular package, I can see there is a folder called sound.
I have used the newest build from here http://tinycorelinux.net/9.x/armv6/releases/RPi/
As I mentioned above, it works perfectly with PWM sound on the RPI 3, which I started out to use.
The whole setup is for an art project where we are going to use Pi zeros.
Thanks
Mikkel
-
I would compare drivers loaded using when everything is working on the Pi3, then again with the zero, and compare.
I have no experience with PWM audio.
-
I can see I miss this on the Zero compared to the Pi3
snd_bcm2835 23123 0
snd_pcm 97468 1 snd_bcm2835
snd_timer 23881 1 snd_pcm
snd 70476 3 snd_bcm2835,snd_pcm,snd_timer
I am just swapping the SDcard around on the two boards.
when I write this on the Zero modprobe snd
modprobe: module snd not found in modules.dep
I get no failure on the Pi3.
But the PiZero and Pi3 is loading different kernels in the config.txt, and the lib/modules are way different.
Any ideas?
Cheers
Mikkel
-
Hi MikkelM
If you unpack:
http://tinycorelinux.net/9.x/armv6/releases/RPi/src/kernel/4.9.22-piCore_modules.tar.xz
you'll find it contains:
lib/modules/4.9.22-piCore/kernel/sound/core/snd.ko
lib/modules/4.9.22-piCore/kernel/sound/core/snd-timer.ko
lib/modules/4.9.22-piCore/kernel/sound/core/snd-pcm.ko
lib/modules/4.9.22-piCore/kernel/sound/arm/snd-bcm2835.ko
You'll need to either copy them to /lib and back them up or create an extension out of them.
-
Hi MikkelM
I'm not certain, but you may also need to run:
sudo depmod
after adding the files to the file system.
-
Hi Rich.
I have copied the files and ran the depmod command, but how do I get the files to stay in the /lib folder.
Or simply how do I add the needed modules to the Kernel package.
It seems I am getting closer.
Thanks.
Mikkel
-
Hi MikkelM
After copying the files to /lib you could add the following lines to /opt/.filetool.lst:
lib/modules/4.9.22-piCore/kernel/sound/core/snd.ko
lib/modules/4.9.22-piCore/kernel/sound/core/snd-timer.ko
lib/modules/4.9.22-piCore/kernel/sound/core/snd-pcm.ko
lib/modules/4.9.22-piCore/kernel/sound/arm/snd-bcm2835.ko
and then run a backup like this:
filetool.sh -b
-
Yeah. It works.
My bootlocal is somehow a mess now
depmod
and then modprobe to the individual modules
amixer cset numid=3 1
gpio -g mode 18 ALT5
gpio -g mode 13 ALT0
Are there anyway to use dtoverlay when loading drivers?
-
Hi MikkelM
You shouldn't need to "modprobe the individual modules". Try:
modprobe snd-bcm2835
Since snd-bcm2835 depends on the other 3 modules, modprobe should be loading the other 3 automatically.
-
Are you sure you loaded the alsa-modules-KERNEL.tcz package.
When you download the sound stuff on your RPI 3, it would have only downloaded the package for the armv7 boards.