WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Build Kernel Modul on 5.10.77  (Read 1912 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: Build Kernel Modul on 5.10.77
« Reply #15 on: January 23, 2022, 02:16:30 PM »
Hi michnixweiss
...
Code: [Select]
sudo /sbin/depmod -a
which exits without any output
Modprobe also exits without output ...
No output means no error.

If you want to confirm it's loaded, see if it shows up in this command:
Code: [Select]
lsmod
Quote
to get it persistent for future i created an extension ...
Kudos on figuring out how to package it.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: Build Kernel Modul on 5.10.77
« Reply #16 on: January 23, 2022, 05:45:22 PM »
Hi michnixweiss
...
Code: [Select]
----- Snip -----
tce-load -i wm8960.tcz
----- Snip -----
Code: [Select]
sudo /sbin/depmod -a
...
Just one more thing. Since you packaged the modules, you don't need to depmod. When you load your extension,
tce-load  checks the extension for modules and runs  depmod  for you.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Build Kernel Modul on 5.10.77
« Reply #17 on: January 29, 2022, 08:05:03 AM »
Many thanks @Rich,

I build my extension with the files needed (I think so).
Now so far:
Code: [Select]
aplay -l
card 0: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
aplay -D hw:0,0 piano2.wav
No error message, but I am getting no sound from the speaker nor the headphone...
The only thing unknown so far is where to but the asound.state so that alsa is loading it. But this is not the main problem I think!?

Can I ask this here or open a new thread for alsa?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: Build Kernel Modul on 5.10.77
« Reply #18 on: January 29, 2022, 10:07:43 AM »
Hi michnixweiss
My guess is some path(s) is/are muted.

This is a post I wrote on setting up ALSA:
http://forum.tinycorelinux.net/index.php/topic,22145.msg138620.html#msg138620
Make sure your driver is loaded first. Then, follow the instructions in the post. The extensions must be loaded in
the order listed. Rearrange their order in your  onboot.lst  and reboot. Then continue from step 4.

If you still get no audio, start the alsamixergui and try some of the controls.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 809
Re: Build Kernel Modul on 5.10.77
« Reply #19 on: January 29, 2022, 11:31:32 AM »
Have you done everything shown on their github site.   While you cannot use the provided install and service files, you should do everything they do manually.

https://github.com/waveshare/WM8960-Audio-HAT

1) Driver built -  This appears to be ok
2) dtbo installed in /mnt/mmcblk0p1/overlays
3) in the boot config.txt did you add dtoverlay=wm8960-soundcard
4) Assume you have also enabled both i2c and i2s interfaces.
5) Add the asound.conf to /etc  (Also add etc/asound.conf to /opt/.filetool.lst)
6) Copy the provided asound.state to /var/lib/asla/asound.state  (Make sure to add this file to the backup list too)

Then during boot, you will need to wait for the card to be recognized first
Then restore the asound state.

Let me know if you need more direction, but just follow what they do on github.  And convert what they to do tinycore methodology.



Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Build Kernel Modul on 5.10.77
« Reply #20 on: January 29, 2022, 12:11:17 PM »
Thx @Rich.
Thx @Paul_123, I figured it out before reading your post.
Your point 6 was my problem. Like written before it was not clear for me where to put the asound.state and unmute with alsamixer does not do the trick.
Trial and error brings it up
Code: [Select]
sudo alsactl restore
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
For me the documentation is a bit confusing. For example: the link in the post of @Rich to alsa - which is not so old - isn't correct anymore.
There is no alsa-config.tcz (anymore). Comparing the alsa.tcz.list and alsa-config.tcz.list (from 4.x) with the alsa.tcz.list (from 13.x) seems for me, that its in one extension now. Also the described path usr/local/etc/alsa/asound.state seems to be the wrong for now.
And it is really annoying that I cannot post some things - tried to quote the "echo..." part. Is it a bug or because I am a newbie?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: Build Kernel Modul on 5.10.77
« Reply #21 on: January 29, 2022, 01:30:14 PM »
Hi michnixweiss
I think the ARM version may have been configure differently. The  .info  file for TC13 x86_64 still lists  asound.state
being saved in   /usr/local/etc/alsa/asound.state:
http://tinycorelinux.net/13.x/x86_64/tcz/alsa.tcz.info

... And it is really annoying that I cannot post some things - tried to quote the "echo..." part. Is it a bug or because I am a newbie?
It's the forum. Sometimes it doesn't like certain words or punctuation. The other day I couldn't write  /etc/hosts , today
it's perfectly fine with it.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Build Kernel Modul on 5.10.77
« Reply #22 on: January 31, 2022, 01:00:48 PM »
Last point (I hope) to the sound HAT:
How do I restore the asound.state at reboot?
I stored the working var/lib/alsa/asound.state with /opt/.filetool.lst

I tried in bootlocal.sh
Code: [Select]
/usr/local/sbin/alsactl restore
and
/usr/local/sbin/alsactl -f /home/tc/asound.state restore
/usr/local/bin/speaker-test [-Ddefault:1] -c2 -t wav -l1 #to proof its working
which didn't work,
so I tried the same with /usr/bin/sudo in ~/.X.d/alsa
which didn't work either...

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 809
Re: Build Kernel Modul on 5.10.77
« Reply #23 on: January 31, 2022, 01:10:44 PM »
bootlocal.sh will run way too soon.  You need to wait for the kernel to recognize the card first.   Then use alsactl to restore.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Build Kernel Modul on 5.10.77
« Reply #24 on: January 31, 2022, 02:47:26 PM »
bootlocal.sh will run way too soon.  You need to wait for the kernel to recognize the card first.   Then use alsactl to restore.
Thanks for the hint, but I got a "wifi autoconnect" in it which is working fine
Code: [Select]
/usr/local/bin/wifi.sh -a 2>&1 > /tmp/wifi.log
Is it because its a HAT and wifi onboard or does the wifi.sh wait for the wlan to be ready?
From the corebook the .X.d is described as the "final part of the boot process" so shouldn't this had to work?

To make it easy I would create a start script which checks via lsmod if the wm8960 is loaded or is there an other way!?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 809
Re: Build Kernel Modul on 5.10.77
« Reply #25 on: January 31, 2022, 04:31:15 PM »
Use a while loop.   Look at /proc/asound   Or just run aplay -L.  And watch for your card.

Some cards are really picky at boot.  I will often, wait for the card, then load the state twice

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: Build Kernel Modul on 5.10.77
« Reply #26 on: January 31, 2022, 06:00:08 PM »
Hi michnixweiss
Assuming your card is  wm8960soundcard , something like this should work:
Code: [Select]
while true
do
    s_leep 1
    aplay -l | grep -q wm8960soundcard
    [ $? == 0 ] && break
done
/usr/local/sbin/alsactl restore
Remove the underscore from  s_leep. Sorry, forum error.

Place it in its own script (init8960.sh for example) and launch it in the background.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Build Kernel Modul on 5.10.77
« Reply #27 on: February 01, 2022, 03:01:57 PM »
Thx a lot for the help. Works like a charm now.
Main problem was in front of the RPi...
I started a daemon in the bootlocal.sh without init script and forgot the "&" at the end of the line...
How can I Set this to SOLVED?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10210
Re: [Solved] Build Kernel Modul on 5.10.77
« Reply #28 on: February 01, 2022, 04:49:42 PM »
Hi michnixweiss
... How can I Set this to SOLVED?
Easy, just ask.  :)