Skip to content

Instantly share code, notes, and snippets.

View telent's full-sized avatar

Daniel Barlow telent

View GitHub Profile
# this is Work In Progress configuration.nix for cross-compiling
# a Kodi appliance based on the Odroid C2
{ config, lib, pkgs, ... }:
{
nixpkgs.overlays = [
(self: super: {
# make-tarball is hardcoded to use pixz, but waqnts a host
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
nixpkgs.overlays = [
(self: super: {
[dan@noetbook:~/src/odroid/uboot]$ cat default.nix
with import <nixpkgs> {} ;
pkgsCross.aarch64-multiplatform.ubootOdroidC2.override {
extraPatches = [
(pkgs.fetchPatch {
url="https://source.denx.de/u-boot/u-boot/-/commit/a246e21351778a93805b3f52302a420f4b268601.diff";
sha256 = lib.fakeHash;
})];
}

Audio

(This is still quite exploratory: when some of the questions have been answered and we find out if our suppositions are right, we can build a configuration option to enable audio cleanly)

To enable the audio subsystem, you first need to write to /dev/subsys_adsp

# echo 1 > /dev/subsys_adsp
potter:/sdcard # aplay -v -v -v --dump-hw-params out.wav
Playing WAVE 'out.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
HW Params of device "default":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S20_LE S20_BE U20_LE U20_BE S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT: STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
[ 0.112344,0] scm_call failed: func id 0x42000101, ret: -1, syscall returns: 0x0, 0x0, 0x0
[ 0.116810,1] cpuidle: using governor ladder
[ 0.123472,2] cpuidle: using governor menu
[ 0.130108,2] cpuidle: using governor qcom
[ 0.131784,2] vdso: 2 pages (1 code @ ffffffc000e96000, 1 data @ ffffffc001444000)
[ 0.131821,2] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.132670,2] software IO TLB: mapped [mem 0xed400000-0xed800000] (4MB)
[ 0.133472,2] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.138307,2] __of_mpm_init(): MPM driver mapping exists
[ 0.140063,2] platform soc:qcom,kgsl-hyp: assigned reserved memory node gpu_region@0
This file has been truncated, but you can view the full file.
/discover
Script started on 2021-05-25 19:22:12+01:00 [TERM="screen" TTY="/dev/pts/4" COLUMNS="143" LINES="34"]
[]0;dan@loaclhost: ~/src/nixos-potter/mobile-nixosdan@loaclhost:~/src/nixos-potter/mobile-nixos]$ NIX_PATH="nixpkgs=../nixpkgs-for-mobile" nix-build examples/hello/ -A build.default --argstr de
evice motorola-potter --show-trace
trace: **************************************
trace: * Evaluating device: motorola-potter *
trace: **************************************
trace: Building with crossSystem?: aarch64-linux != x86_64-linux → we are.
"""
My first application
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
from rubicon.java import JavaClass, JavaInterface
from rubicon.java.jni import java
"""
My first application
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
from rubicon.java import JavaClass
@telent
telent / default.nix
Created November 28, 2018 12:02
arcan build with nixos
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "arcan";
version="1";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake git
] ;
CMAKE_CXX_FLAGS = "-msse4.1";
DRM_INCLUDE_DIR = "${pkgs.libdrm.dev}/include/libdrm";