Skip to content

Instantly share code, notes, and snippets.

View rootfs's full-sized avatar
🎯
Focusing

Huamin Chen rootfs

🎯
Focusing
View GitHub Profile
@rootfs
rootfs / a2dp_sink_ubuntu_linux.md
Created September 24, 2023 18:42 — forked from joergschiller/a2dp_sink_ubuntu_linux.md
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

@rootfs
rootfs / _README.md
Created September 24, 2023 18:41 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
apiVersion: v1
kind: Namespace
metadata:
labels:
sustainable-computing.io/app: kepler
name: kepler
---
apiVersion: v1
kind: ServiceAccount
metadata:

test env

host

MacBook

% uname -a
Darwin xxx 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:51:50 PDT 2023; root:xnu-8796.121.2~5/RELEASE_X86_64 x86_64

cluster

kind 1.27

create minikube

The following create a minikube with 10 CPU cores and 32GB memory. This is for experiments with heavy workload.

It uses kvm hypervisor. Make sure the qemu and libvirt have already installed

minikube start --cpus 10 --memory 32GB --disk-size=400g --extra-disks=2 --driver=kvm2 --force --container-runtime cri-o

install prometheus and grafana

main branch 5b9c91af68c8644911e0955639750004e803c41f

(pprof) top20 -cum (all)
Active filters:
   focus=(all)
Showing nodes accounting for 1.13s, 61.75% of 1.83s total
Showing top 20 nodes out of 186
      flat  flat%   sum%        cum   cum%
     0.85s 46.45% 46.45%      0.85s 46.45%  runtime.cgocall

Arch

# more /proc/cpuinfo
processor       : 0
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c

Power Estimate

System

Complete System Power Estimation using Processor Performance Events https://lca.ece.utexas.edu/pubs/bircher-TC2012.pdf

CPU

Power estimate wiki (before 2012) https://en.wikipedia.org/wiki/Run-time_estimation_of_system_and_sub-system_level_power_consumption

We have presented a systematic study on the use of performance counters to estimate power online. We found a subset of counters (# Fetched instructions, L1 hit and Dispatch Stalls) that are suitable for estimating power across multiple architecture types within an error of 5%. This was illustrated using an OOO high performance (HPerf) and an in-order low power (LP) core. At 5% average error, the proposed estimator improves upon prior estimators with error of 9% [3] and 11.5% [4].

Environment

Jetpack 4.6, Jetson Xavier, Ubuntu 18.04

prepare

apt install -y curl jq runc iptables conntrack nvidia-container-runtime nvidia-container-toolkit

crio

Install crio

systemctl stop microshift
crictl stop $(crictl ps -q) -t 1
mount |grep overlay |awk '{print $3}' |xargs umount
mount |grep kubelet |awk '{print $3}' |xargs umount
rm /var/lib/etcd -rf
rm /var/lib/kubelet -rf
mkdir -p /var/lib/kubelet
rm /var/lib/rook -rf
rm -rf /var/lib/microshift