Skip to content

Instantly share code, notes, and snippets.

View emsi's full-sized avatar

Mariusz Woloszyn emsi

View GitHub Profile
@emsi
emsi / pipewire.md
Created March 2, 2023 10:28 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Unfortunately, aptX and AAC are not enabled because of patents and other technical reasons. However, looks like aptX will be available in coming 22.10 release. If you need these codecs in 22.04 you may use this PPA from @aglasgall which is based on universe, but rebuilds pipewire with

@emsi
emsi / ro-root.sh
Last active July 25, 2021 08:39 — forked from paul-ridgway/ro-root.sh
A scrip to replace the default RPi init to create and chroot to an overlayfs-backed root
#!/bin/sh
# Read-only Root-FS for Raspian using overlayfs
# Version 1.2:
# Don't mount ro/rw root inside newroot
# Don't remove root from ftab
# Move dev & proc to newroot and redirect execed chrooted subshell console to newroot's dev
# Version 1.1:
# Changed to use /proc/mounts rathern than /etc/fstab for deriving the root filesystem.
#
@emsi
emsi / tutorial.txt
Created February 10, 2019 20:17 — forked from ChrisB85/tutorial.txt
Sterowanie urządzeniami głosem w języku polskim przy użyciu Raspberry Pi, asystenta Snips i Home Assistant
Co będzie potrzebne?
- Raspberry Pi (zalecane 3B lub 3B+, ale myślę, że 2 również da radę) z zainstalowanym Raspbianem
- Głośnik i mikrofon. Można użyć zwykłego "dongla" typu https://pupilsys.com/image/cache/catalog/Product_images/PS139/USB_soundCard-600x600.jpg z wejściem na mikrofon i wyjściem na głośniki lub przystawki typu HAT. Ja użyłem Sound Blaster SBX8, czyli głośnik i mikrofon USB w jednym (http://www.benchmark.pl/mini-recenzje/creative-sound-blaster-axx-sbx8-test.html). Jedyny problem jaki napotkałem i którego nie udało mi się przeskoczyć, to "rwanie" dźwięku (zarówno nagrywanie jak odtwarzanie) w sytuacji, kiedy system jest również na nośniku podłączonym pod USB (u mnie dysk SSD). W przypadku systemu na karcie SD wszystko jest OK. Należy również zwrócić uwagę na fakt, że głośnik ten pobiera maksymalnie 1A z portu USB.
1. Instalacja
Wykonujemy instalację zgodnie z instrukcją: https://docs.snips.ai/getting-started/quick-start-raspberry-pi (kroki 1-4). Nie opisuję tutaj tego dokładniej, bo dokumentac
@emsi
emsi / .pythonrc.py
Created February 7, 2019 20:44 — forked from guyskk/.pythonrc.py
Add command history and tab completion to python shell.
"""
Add command history and tab completion to python shell.
1. Save this file in ~/.pythonrc.py
2. Add the following line to your ~/.bashrc:
export PYTHONSTARTUP="$HOME/.pythonrc.py"
"""
def _enable_history_and_completer():