Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Kernel Downgrade #209

Closed
2 of 3 tasks
mxklb opened this issue Feb 14, 2020 · 24 comments
Closed
2 of 3 tasks

Remove Kernel Downgrade #209

mxklb opened this issue Feb 14, 2020 · 24 comments

Comments

@mxklb
Copy link

mxklb commented Feb 14, 2020

Actually I can't install the 2mic respeaker driver on a vanilla flashed HypriotOS v1.12.0 on a PI4. What happens is, the /boot partition of the OS is too small (~12MB free space) to downgrade the kernel during your install.sh script. So far so good but finally after your script finished, I end up with a bricked OS with read-only file system.

The install.sh script shall therefore

  • check that enough space is left on the /boot partition, otherwise skip installation,
  • patch the running kernel, instead of downgrading existing newer kernels,
  • correct error handling so that bricked OS with read-only fs won't happen.

Ok, now I'll get a flashed HypriotOS with bigger /boot partition.
P.S. With former releases of this OS, 2mic respeaker worked. I'll post an issue there too.

install-failure_full-log.txt

@Pillar1989
Copy link
Contributor

I want to Downgrade by default, so that to ensure that the software can be installed, perhaps you can submit a PR, there is an option is the use of the latest kernel.

@mxklb
Copy link
Author

mxklb commented Feb 14, 2020

mxklb pushed a commit to mxklb/seeed-voicecard that referenced this issue Feb 14, 2020
@mxklb
Copy link
Author

mxklb commented Feb 14, 2020

I'm not familiar with patching kernels, driver development. So I won't contribute to the second part - avoid downgrading the kernel for driver installation to succeed. Please do it by your own..

Nevertheless, good job, thank you very much for developing respeaker drivers!

P.S. Downgrading the kernel to ensure that the software can be installed is in my opinion a security issue. This may therefore impact lifecyle/acceptance of respeaker driver and hardware. Better find another way without downgrading kernel to ensure that the software can be installed/patched directly. I think this is a design and lifcyle descision you should make at respeaker/seeed-voicecard.

@solidssss
Copy link

solidssss commented Feb 15, 2020

Oh, so that was why I could not install the 4mic driver.. Anyone know of a fix?

@HinTak
Copy link
Contributor

HinTak commented Mar 19, 2020

See also the now closed #192 , I have pushed upstream to fix the kernel header issue -

raspberrypi/linux#3279

So it is no longer necessary to downgrade the kernel to get matching headers. In fact I have been using the respeaker driver for both up to date stretch and up to date buster for a few months since. Please remove the kernel downgrade. @Pillar1989

@mInzamamMalik
Copy link

mInzamamMalik commented Mar 19, 2020

Actually what is happening to me is it is taking forever in kernel downgrade part in ./install.sh

I am using this version of raspbian (as mentioned here: https://www.raspberrypi.org/downloads/raspbian/):

Raspbian Buster Lite
Minimal image based on Debian Buster
Version:February 2020
Release date:2020-02-13
Kernel version:4.19
Size:434 MB

it is not only taking forever but sometimes it just got disconnect from the ssh, pi is not restarting not script failing but just got unresponsive

@HinTak as you told above that something was wrong was with raspbian and you said it is now fixed, so if I remove --force-yes from the script do you think it will still work perfectly, I also noticed they have added in this line of script recently (end of 2019)

please let me know your opinion

however what I have done for now is started downloading raspbian stretch with release name 2019-09-26 date(2019-09-30) (https://en.wikipedia.org/wiki/Raspbian) (raspbian-2019-09-30/ http://downloads.raspberrypi.org/raspbian/images/) and also removed the force from script and running it now, see what happens

@mInzamamMalik
Copy link

someone also tell me the kernel which they are forcing came with which version of raspbian, because I cannot find list of all raspbian with their kernel detail on internet, I will be thankful

for now I don't care about anything but I have to complete one of my prototype asap, so may be I will be ending up downloading all raspbian releases and installing each of them for checking their version in worst case, lolz how dumb of me 🤣

@mInzamamMalik
Copy link

here is my fork I removed the --force-yes

raspbian version is same as before:

Raspbian Buster Lite
Minimal image based on Debian Buster
Version:February 2020
Release date:2020-02-13
Kernel version:4.19
Size:434 MB

and here is my install log:

Using username "pi".
[email protected]'s password:
Access denied
[email protected]'s password:
Access denied
[email protected]'s password:
Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Mar 19 01:01:07 2020 from 192.168.43.6

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set                                                                                                      a new password.

pi@raspberrypi:~ $ cd data/
pi@raspberrypi:~/data $ cd ..
pi@raspberrypi:~ $ git clone https://github.com/malikasinger1/seeed-voicecard.gi                                                                                                     t
Cloning into 'seeed-voicecard'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 710 (delta 8), reused 3 (delta 2), pack-reused 694
Receiving objects: 100% (710/710), 1.31 MiB | 197.00 KiB/s, done.
Resolving deltas: 100% (442/442), done.
pi@raspberrypi:~ $ cd seeed-voicecard/
pi@raspberrypi:~/seeed-voicecard $ sudo ./install.sh
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Fetched 15.0 kB in 2s (6,930 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
dkms is already the newest version (2.6.1-4).
git is already the newest version (1:2.20.1-2+deb10u1).
i2c-tools is already the newest version (4.1-1).
libasound2-plugins is already the newest version (1.1.8-1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
--2020-03-19 21:58:49--  http://archive.raspberrypi.org/debian/pool/main/r/raspb                                                                                                     errypi-firmware/raspberrypi-kernel_1.20190925+1-1_armhf.deb
Resolving archive.raspberrypi.org (archive.raspberrypi.org)... 46.235.231.151, 4                                                                                                     6.235.231.111, 176.126.240.167, ...
Connecting to archive.raspberrypi.org (archive.raspberrypi.org)|46.235.231.151|:                                                                                                     80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 70656964 (67M) [application/x-debian-package]
Saving to: ‘/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb’

/tmp/raspberrypi-ke  40%[=======>            ]  27.30M   195KB/s    in 2m 53s

2020-03-19 22:01:43 (161 KB/s) - Connection closed at byte 28630276. Retrying.

--2020-03-19 22:01:44--  (try: 2)  http://archive.raspberrypi.org/debian/pool/ma                                                                                                     in/r/raspberrypi-firmware/raspberrypi-kernel_1.20190925+1-1_armhf.deb
Connecting to archive.raspberrypi.org (archive.raspberrypi.org)|46.235.231.151|:                                                                                                     80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 70656964 (67M), 42026688 (40M) remaining [application/x-debian-package]
Saving to: ‘/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb’

/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.  61%[++++++++++++++++++++++++++++++++++++++===================>                                     ]  41.37M  --.-KB/s    eta 84s

/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.  61%[++++++++++++++++++++++++++++++++++++++===================>                                     ]  41.49M  77.9KB/s    in 2m 25s

2020-03-19 22:04:09 (99.9 KB/s) - Connection closed at byte 43506860. Retrying.

--2020-03-19 22:04:11--  (try: 3)  http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel_1.20190925+1-1_armhf.deb
Connecting to archive.raspberrypi.org (archive.raspberrypi.org)|46.235.231.151|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 70656964 (67M), 27150104 (26M) remaining [application/x-debian-package]
Saving to: ‘/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb’

/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.  66%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++====>                                ]  44.90M   895KB/s    eta 28s

/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.  67%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++====>                                ]  45.17M   956KB/s    eta 25s
/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.  67%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=====>                               ]  45.58M   999KB/s    eta 25s
/tmp/raspberrypi-kernel_1.20190925+1-1_armhf. 100%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++====================================>]  67.38M   652KB/s    in 28s

2020-03-19 22:04:40 (948 KB/s) - ‘/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb’ saved [70656964/70656964]

dpkg-deb: error: '/tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb' is not a Debian format archive
dpkg: error processing archive /tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb (--install):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
 /tmp/raspberrypi-kernel_1.20190925+1-1_armhf.deb
--2020-03-19 22:04:44--  http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel-headers_1.20190925+1-1_armhf.deb
Resolving archive.raspberrypi.org (archive.raspberrypi.org)... 93.93.135.118, 46.235.230.122, 176.126.240.167, ...
Connecting to archive.raspberrypi.org (archive.raspberrypi.org)|93.93.135.118|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24898072 (24M) [application/x-debian-package]
Saving to: ‘/tmp/raspberrypi-kernel-headers_1.20190925+1-1_armhf.deb’

                          /tmp/raspberrypi-ke  14%[============>                                                                                  ]   3.37M  15.6KB/s    eta 2m 58s
                       /tmp/raspberrypi-kerne  14%[============>                                                                                  ]   3.39M  14.9KB/s    eta 3m 4s
               /tmp/raspberrypi-kernel-header  60%[========================================================>                                      ]  14.40M   142KB/s    eta 71s
              /tmp/raspberrypi-kernel-headers  60%[========================================================>                                      ]  14.44M   138KB/s    eta 71s
p/raspberrypi-kernel-headers_1.20190925+1-1_a  78%[=========================================================================>                     ]  18.68M   149KB/s    eta 37s    aerrypi-kernel-headers_1.20190925+1-1_armhf.de  79%[==========================================================================>                    ]  18.98M   150KB/s    eta 36s    a/tmp/raspberrypi-kernel-headers_1.20190925+1- 100%[==============================================================================================>]  23.74M   165KB/s    in 2m 51s

2020-03-19 22:07:36 (142 KB/s) - ‘/tmp/raspberrypi-kernel-headers_1.20190925+1-1_armhf.deb’ saved [24898072/24898072]

dpkg: warning: downgrading raspberrypi-kernel-headers from 1.20200212-1 to 1.20190925+1-1
(Reading database ... 96864 files and directories currently installed.)
Preparing to unpack .../raspberrypi-kernel-headers_1.20190925+1-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1.20190925+1-1) over (1.20200212-1) ...





Setting up raspberrypi-kernel-headers (1.20190925+1-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.75+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.75-v7+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.75-v7l+
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.75-v8+

Creating symlink /var/lib/dkms/seeed-voicecard/0.3/source ->
                 /usr/src/seeed-voicecard-0.3

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make -j4 KERNELRELEASE=4.19.75+ -C /lib/modules/4.19.75+/build M=/var/lib/dkms/seeed-voicecard/0.3/build.......
cleaning build area....

DKMS: build completed.

snd-soc-wm8960.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75+/kernel/sound/soc/codecs/

snd-soc-ac108.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75+/kernel/sound/soc/codecs/

snd-soc-seeed-voicecard.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75+/kernel/sound/soc/bcm/

depmod....

DKMS: install completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make -j4 KERNELRELEASE=4.19.75-v7+ -C /lib/modules/4.19.75-v7+/build M=/var/lib/dkms/seeed-voicecard/0.3/build.......
cleaning build area....

DKMS: build completed.

snd-soc-wm8960.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7+/kernel/sound/soc/codecs/

snd-soc-ac108.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7+/kernel/sound/soc/codecs/

snd-soc-seeed-voicecard.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7+/kernel/sound/soc/bcm/

depmod....

DKMS: install completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make -j4 KERNELRELEASE=4.19.75-v7l+ -C /lib/modules/4.19.75-v7l+/build M=/var/lib/dkms/seeed-voicecard/0.3/build.......
cleaning build area....

DKMS: build completed.

snd-soc-wm8960.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7l+/kernel/sound/soc/codecs/

snd-soc-ac108.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7l+/kernel/sound/soc/codecs/

snd-soc-seeed-voicecard.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.75-v7l+/kernel/sound/soc/bcm/

depmod....

DKMS: install completed.
setup git config
git init
Initialized empty Git repository in /etc/voicecard/.git/
git add --all
git commit -m "origin configures"
[master (root-commit) b0c01a3] origin configures
 7 files changed, 1476 insertions(+)
 create mode 100644 ac108_6mic.state
 create mode 100644 ac108_asound.state
 create mode 100644 asound_2mic.conf
 create mode 100644 asound_4mic.conf
 create mode 100644 asound_6mic.conf
 create mode 100644 dkms.conf
 create mode 100644 wm8960_asound.state
Created symlink /etc/systemd/system/sysinit.target.wants/seeed-voicecard.service → /lib/systemd/system/seeed-voicecard.service.
Job for seeed-voicecard.service failed because the control process exited with error code.
See "systemctl status seeed-voicecard.service" and "journalctl -xe" for details.
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
------------------------------------------------------
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $
pi@raspberrypi:~/seeed-voicecard $

lets see what happens after reboot :-D

@mInzamamMalik
Copy link

worked ;-)

@mxklb
Copy link
Author

mxklb commented Mar 20, 2020

I'll wait until the kernel downgrade is removed - as @HinTak mentioned this is not needed anymore and should be removed. Actually the state of this driver installation script is some kind of messy and needs to be refactored in my opinion.

@Psychokiller1888
Copy link
Contributor

Yeah, that kernel downgrade is a real pain, terrible

@Psychokiller1888
Copy link
Contributor

Hallo @Pillar1989 Can we have your input? It's terrible to install on a rpi zero, wait 20+ minutes for nothing. There must be a better way to install those drivers no?

@HinTak
Copy link
Contributor

HinTak commented Apr 23, 2020

The available kernel packages are under
http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/ . FWIW, 1.20190925+1-1 is somewhat dated now.

@HinTak
Copy link
Contributor

HinTak commented Apr 26, 2020

I have put out a pull for this #223

@KillingJacky
Copy link
Contributor

Done with #225

@ismailryt
Copy link

Hello @KillingJacky, i want to be sure and ask some question.

After i do " sudo ./install.sh ", and reboot, arecord -L didnt show me any seeed voice card device. So this mean i have to follow #225 ?? Because after i plug my sd card to raspy3b+, arecord -L show me seeed voice card device. It makes me confused why in raspy4 it can't , in raspy 3b+ it can

Im using raspy4 and latest raspbian buster fyi.

Thanks,

@HinTak
Copy link
Contributor

HinTak commented May 7, 2020

You need to look at dmesg to see what happened. You should have a few ac10x lines. I am on up to date buster on a pi 4. Works just fine.

@ismailryt
Copy link

Pardon @HinTak , that mean you just doing normal instalation and success? Now im formatting sd card and trying to install again. Im gonna try what you say, so i have to put cmnd dmesg after i do "sudo ./install.sh " for deebugging right?

Please correct me if i wrong

@ismailryt
Copy link

Oh 1 more , where i can find this command and change it

W: --force-yes is deprecated, use one of the options starting with --allow instead.

@HinTak
Copy link
Contributor

HinTak commented May 8, 2020

No, you watch dmesg after reboot. Dmesg shows messages from the kernel (whether the driver is loaded, and successful or not)

@HinTak
Copy link
Contributor

HinTak commented Aug 7, 2020

see #238 (comment) regarding the unfeasibility of downgrading...

@Pillar1989
Copy link
Contributor

#249

@turmary
Copy link
Contributor

turmary commented Sep 28, 2020

hi @mxklb

patch the running kernel, instead of downgrading existing newer kernels,

this could be done by ./install argument --keep-kernel

@mxklb
Copy link
Author

mxklb commented Oct 13, 2020

I don't use seeed-voicecard products anymore, this one is not production ready. This all here is just DIY/WIP stuff ..

If you like DIY/WIP, you could stick to seeed-voicecard products. I for myself decided to step away from this vendor (in my opinion at least seeed-voicecard is badly designed & hacky from what I saw..) and use better production ready products.

@turmary thaks for this info, this is really unbelievable, I can't get it .. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants