tinkerboard android - /sys/class/thermal/thermal_zone1/temp: No such file or directory - linux

I am using a tinkerboard with an android + chroot linux. When I try to read temperature by the following command:
cat /sys/class/thermal/thermal_zone1/temp
I get the following error :
cat: /sys/class/thermal/thermal_zone1/temp: No such file or directory
If I run the tinkerboard directly with a linux distribution rather than android I am able to read the temperature by the above command.
The tinkerboard uses the RK3288 cpu which has a TS-ADC temperature sensor.
Any suggestions?
lsmod - linux:
Module Size Used by
fuse 94208 3
snd_soc_hdmi_codec 16384 1
mali_kbase 335872 0
dw_hdmi_i2s_audio 16384 0
rk_crypto 24576 0
dw_wdt 16384 0
syscon_reboot_mode 16384 0
reboot_mode 16384 1 syscon_reboot_mode
r8723bs 544768 0
zram 20480 5
ip_tables 20480 0
autofs4 28672 0
lsmod - android ( linux chroot ):
Module Size Used by

After some research by my colleague:
The kernel was missing the required drivers. Fortunately the newest updates to the kernel included the thermal sensor. It now works.

Related

How to fix No sound on Ubuntu 18.04? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 months ago.
Improve this question
1) I've been using Ubuntu 18.04 with Windows 10 dual boot for some months now. Today suddenly my sound stopped working on Ubunutu. Activities -> Sound menu shows only "Dummy Output". All fine on Windows though.
2) Output of lsmod is:
rohit#rohitUb18043LTS:~$ lsmod | grep snd_
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event
snd_rawmidi 36864 1 snd_seq_midi
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_soc_dmic 16384 0
snd_hda_codec_realtek 118784 0
snd_hda_codec_generic 81920 1 snd_hda_codec_realtek
ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_soc_hdac_hdmi 32768 0
snd_sof_intel_hda_common 73728 1 sof_pci_dev
snd_soc_hdac_hda 24576 1 snd_sof_intel_hda_common
snd_sof_intel_hda 20480 1 snd_sof_intel_hda_common
snd_sof_intel_byt 24576 1 sof_pci_dev
snd_sof_intel_ipc 20480 1 snd_sof_intel_byt
snd_sof 98304 4 snd_sof_intel_hda_common,snd_sof_intel_byt,snd_sof_intel_ipc,sof_pci_dev
snd_sof_xtensa_dsp 16384 1 sof_pci_dev
snd_hda_ext_core 28672 4 snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match 32768 2 snd_sof_intel_hda_common,sof_pci_dev
snd_soc_acpi 16384 2 snd_soc_acpi_intel_match,sof_pci_dev
snd_soc_core 237568 5 snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_dmic
snd_compress 24576 1 snd_soc_core
ac97_bus 16384 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_hda_codec_hdmi 57344 1
snd_hda_intel 53248 2
snd_intel_nhlt 20480 1 snd_hda_intel
snd_hda_codec 131072 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core 90112 10 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_hwdep 20480 1 snd_hda_codec
snd_pcm 102400 10 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_timer 36864 2 snd_seq,snd_pcm
snd 86016 17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
rohit#rohitUb18043LTS:~$
3) I installed all updates from Software updater but no luck.
4) No change by using: sudo alsa force-reload
5) Looking around, found this thread: https://askubuntu.com/questions/1059619/sound-card-shown-as-dummy-output-in-ubuntu-18-04 . User says found the "active profile was off" and links to a solution on this forum (https://forums.linuxmint.com/viewtopic.php?t=268499). I am pasting the output of the four commands as per that link:
rohit#rohitUb18043LTS:~$ sudo fuser -v /dev/snd/*
[sudo] password for rohit:
USER PID ACCESS COMMAND
/dev/snd/controlC0: gdm 1505 F.... pulseaudio
rohit 1878 F.... pulseaudio
rohit#rohitUb18043LTS:~$ pacmd list-cards
1 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xb4000000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "0fb9"
device.product.name = "GP107GL High Definition Audio Controller"
device.string = "0"
device.description = "GP107GL High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: no)
output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: no)
output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: no)
off: Off (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
rohit#rohitUb18043LTS:~$ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <auto_null>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1000
volume: front-left: 65536 / 100% / 0,00 dB, front-right: 65536 / 100% / 0,00 dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: no
current latency: 0,00 ms
max request: 344 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
module: 15
properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"
rohit#rohitUb18043LTS:~$ pacmd list-sink-inputs
0 sink input(s) available.
rohit#rohitUb18043LTS:~$
6) I tried the suggested command but it says "No such profile".
rohit#rohitUb18043LTS:~$ pacmd set-card-profile alsa_card.pci-0000_01_00.1 output:analog-stereo+input:analog-stereo
No such profile: output:analog-stereo+input:analog-stereo
rohit#rohitUb18043LTS:~$
Please help - how do I proceed?
Similar issue with "Dummy Sound" on Ubuntu 18.04 also with a NVIDIA card. This solved it for me:
Edit /etc/modprobe.d/alsa-base.conf as root and add options snd-hda-intel dmic_detect=0
Edit /etc/modprobe.d/blacklist.conf as root and add blacklist snd_soc_skl at the end of the file.
After making these changes, reboot your system.
More details (and credits): https://www.linuxuprising.com/2018/06/fix-no-sound-dummy-output-issue-in.html
I had the same problem, and tried the solution given by #maartenor without success.
Eventually I got the sound back by upgrading linux kernel to the last HWE stack, for me it was 4.15.0-106-generic to 5.3.0-59-generic.
The command to do this :
$ sudo apt install linux-generic-hwe-18.04
Edit the file /etc/modprobe.d/alsa-base.conf and add the following lines:
options snd-hda-intel dmic_detect=0
options snd-hda-intel model=laptop-amic enable=yes
The first line is to enable the speaker, the second for the internal microphone.
Good luck!
Got this answer from Reddit. Worked like a charm for me!
Link : https://www.reddit.com/r/linuxmint/comments/fltlrl/no_sound_on_acer_swift_3_with_kernel_53/
Try this..
Open your terminal
sudo apt update && sudo apt install alsamixer
run alsamixer in your terminal.
press arrow right til you go to sound option (if headphone go to HEADPHONES bar).
press M to unmute.
press up/down to adjust the volume.
press Esc to exit alsamixer.
Following steps worked very reliably. It does not fix the audio-losing-after-suspend issue permanently, but instantly as a command to run after back from suspend.
Use lspci to get the audio card location (0000:00:1f.3). On my machine,
$ lspci
00:1f.0 ISA bridge: Intel Corporation H110 ...
00:1f.2 Memory controller: Intel ...
00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset ...
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset ...
Then, (make sure the directories below exist)
$ echo 1 | sudo tee /sys/bus/pci/devices/0000:00:1f.3/remove
$ echo 1 | sudo tee /sys/bus/pci/rescan
I believe the audio driver/hardware is stuck. So we remove the device driver, and rescan the PCI bus to get audio back.
i found answer above not work on my computer, and i solve this problem by accidient , this is script i use , most same as answer above, but at last, u need mute then unmute auidio. sleep a short moment after command is necessary here if you put script in sh file then excute it , use sh -c is for file redirection for root
REST=0.5
#make sure Audio always actived
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
DEVICE_ID=$(lspci -D | grep Audio | awk '{print $1}')
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/devices/0000:00:1f.3/remove'
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
#mute then unmute to restart audio
amixer -D pulse sset Master mute
sleep $REST
amixer -D pulse sset Master unmute

how to remove the alsa driver from linux kernel

I have taken reference alsa driver from
https://alsa-project.org/main/index.php/Minivosc and driver code path from https://github.com/stadaki/alsa-minivosc-src .
If I, do a rmmod of aforesaid driver using below command
"rmmod snd-minivosc"
Output of the above command is
"rmmod: ERROR: Module snd_minivosc is in use"
Below is output from lsmod | grep snd-minivosc
"snd_minivosc 16384 1
snd_pcm 98304 6 snd_hda_intel,snd_hda_codec,snd_usb_audio,snd_minivosc,snd_hda_core,snd_hda_codec_hdmi
snd 81920 26
snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_usb_audio,snd_minivosc,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_usbmidi_lib,snd_seq_device,snd_hda_codec_realtek,snd_pcm"
Is there is any way to remove alsa driver from kernel without restarting PC?

pvcreate failing to create PV. Device not found /dev/sdxy (or ignored by filtering)

I have an oVirt installation with CentOS Linux release 7.3.1611.
I want to add a new drive (sdb) to the oVirt volume group to work with VMs.
Here is the result of fdisk on the drive:
[root#host1 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be
careful before using the write command.
Orden (m para obtener ayuda): p
Disk /dev/sdb: 300.1 GB, 300069052416 bytes, 586072368 sectors
Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512
bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk
label type: dos Identificador del disco: 0x7a33815f
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sdb1 2048 586072367 293035160 8e Linux LVM
The partitions are showed up in /proc/partitions:
[root#host1 ~]# cat /proc/partitions
major minor #blocks name
8 0 293036184 sda
8 1 1024 sda1
8 2 1048576 sda2
8 3 53481472 sda3
8 4 1 sda4
8 5 23072768 sda5
8 6 215429120 sda6
8 16 293036184 sdb
8 17 293035160 sdb1
When I execute the command to create PV with "pvcreate /dev/sdb1" the result is:
[root#host1 ~]# pvcreate /dev/sdb1
Device /dev/sdb1 not found (or ignored by filtering).
I have revised the file /etc/lvm/lvm.conf for the filters, but I do not have any filter that makes LVM discarding the drive. I have rebooted the computer after creating the PV with pvcreate. I did research on Google for the error but no idea.
Thanks. Any help would be appreciated Manuel
Try to edit lvm.conf uncomment global_flter and edit like this
global_filter = [ "a|/dev/sdb|"]
After that edit multipath vi /etc/multipath.conf
[root#ovirtnode2 ~]#lsblk /dev/sdb NAME
MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb
8:16 0 200G 0 disk └─3678da6e715b018f01f1abdb887594aae 253:2
0 200G 0 mpath
edit
vi /etc/multipath.conf
append the following to multipath.conf blacklist {
wwid 3678da6e715b018f01f1abdb887594aae }
service multipathd restart
its work for me, and i have that problem to when im trying on ovirt but
[root#ovirtnode2 ~]# pvcreate /dev/sdb Physical volume "/dev/sdb"
successfully created. [root#ovirtnode2 ~]#

Kernel Panic with ramfs on embedded device: No filesystem could mount root

I'm working on an embedded ARM device running Linux (kernel 3.10), with NAND memory for storage. I'm trying to build a minimal linux which will reside on its own partition and carry out updates of the main firmware.
The kernel uses a very minimal root fs which is stored in a ramfs. However, I can't get it to boot. I get the following error:
[ 0.794113] List of all partitions:
[ 0.797600] 1f00 128 mtdblock0 (driver?)
[ 0.802669] 1f01 1280 mtdblock1 (driver?)
[ 0.807697] 1f02 1280 mtdblock2 (driver?)
[ 0.812735] 1f03 8192 mtdblock3 (driver?)
[ 0.817761] 1f04 8192 mtdblock4 (driver?)
[ 0.822794] 1f05 8192 mtdblock5 (driver?)
[ 0.827820] 1f06 82944 mtdblock6 (driver?)
[ 0.832850] 1f07 82944 mtdblock7 (driver?)
[ 0.837876] 1f08 12288 mtdblock8 (driver?)
[ 0.842906] 1f09 49152 mtdblock9 (driver?)
[ 0.847928] No filesystem could mount root, tried: squashfs
[ 0.853569] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[ 0.861806] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.73 #11
[ 0.867732] [<800133ec>] (unwind_backtrace+0x0/0x12c) from [<80011a50>] (show_stack+0x10/0x14)
(...etc)
The root fs is built by the build process, using the following (simplified for clarity):
# [Copy some things to $(ROOTFS_OUT_DIR)/mini_rootfs]
cd $(ROOTFS_OUT_DIR)/mini_rootfs && find . | cpio --quiet -o -H newc > $(ROOTFS_OUT_DIR)/backup.cpio
gzip -f -9 $(ROOTFS_OUT_DIR)/backup.cpio
This creates $(ROOTFS_OUT_DIR)/backup.cpio.gz
The kernel is then built like this:
#$(MAKE) -C $(LINUX_SRC_DIR) O=$(LINUX_OUT_DIR) \
CONFIG_INITRAMFS_SOURCE="$(ROOTFS_OUT_DIR)/backup.cpio.gz" \
CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0
I think this means it uses the same config as the main firmware (built elsewhere), but supplies the minimal ramfs image using CONFIG_INITRAMFS_SOURCE.
From Kernel.Org, the ramfs is always built anyway, and CONFIG_INITRAMFS_SOURCE is all that is needed to specify a pre-made root fs to use. There are no build errors to indicate that there is a problem creating the ramfs, and the size of the resulting kernel looks about right. backup.cpio.gz is about 3.6 MB; the final zImage is 6.1 MB; the image is written to a partition which is 8 MB in size.
To use this image, I set some flags used by the (custom) boot loader which tell it to boot from the minimal partition, and also set a different command line for the kernel. Here is the command line used to boot:
console=ttyS0 rootfs=ramfs root=/dev/ram rw rdinit=/linuxrc mem=220M
Note that the nimimal root fs contains "/linuxrc", which is actually a link to /bin/busybox:
lrwxrwxrwx 1 root root 11 Nov 5 2015 linuxrc -> bin/busybox
Why doesn't this boot? Why is it trying "squashfs" filesystem, and is this wrong?
SOLVED! It turned out that a file name used by the (custom) build system had changed as part of an update, and so it was not putting the correct kernel image into the firmware package. I was actually trying to boot the wrong kernel with the "rootfs=ramfs" parameter, one which didn't have a ramfs.
So, for future reference, this error occurs if you specify "rootfs=ramfs" but your kernel wasn't built with any rootfs built in (CONFIG_INITRAMFS_SOURCE=... NOT specified)

Upgrading Beagle Bone Black using an external microSD card (together with SSH)

I am trying to upgrade BBB to the latest version of Linux (on the microSD that is built in into the board). Here are my steps:
Apply the image to an external microSD card
Boot BBB using the external microSD card.
Download the same image again (external microSD). I got it from http://debian.beagleboard.org/images/bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz.
Then, I used dd if=imagefile.img of=/dev/mmcblk1.
After 15 minutes, I got the error: No space left on the device.
Do you know how this can be resolved? When I tried to use dd but instead of the image file, I had the entire microSD card (external), it worked. The thing is, the external microSD card had the same image.
Edit:
Note: When I had the if parameter set to the external SD card, I did not have the last, third partition. It's only there to allow me store the image (of it self).
External microSD
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 198655 98304 e W95 FAT16 (LBA)
/dev/mmcblk0p2 198656 7577599 3689472 83 Linux
/dev/mmcblk0p3 7577600 22257663 7340032 83 Linux
internal microSD
Device Boot Start End Blocks Id System
/dev/mmcblk1p1 * 2048 198655 98304 e W95 FAT16 (LBA)
/dev/mmcblk1p2 198656 7577599 3689472 83 Linux
From lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16 0 2M 1 disk
mmcblk1boot1 179:24 0 2M 1 disk
mmcblk0 179:0 0 14.9G 0 disk
|-mmcblk0p1 179:1 0 96M 0 part /media/BEAGLEBONE_
|-mmcblk0p2 179:2 0 3.5G 0 part /
`-mmcblk0p3 179:3 0 7G 0 part /media/7ea42485-bebc-451d-bb10- d0349cb4c582
mmcblk1 179:8 0 3.6G 0 disk
|-mmcblk1p1 179:9 0 96M 0 part /media/BEAGLEBONE
`-mmcblk1p2 179:10 0 3.5G 0 part
From blockdev --getsize64 /dev/mmcblk1 I get 3867148288. This is supposed to be the no. of bytes, so ~3.86714829 GB

Resources