@dotpi/tools 1.0.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.editorbackup/NOTES.md~ +974 -0
  2. package/.editorbackup/PIPEWIRE.md~ +42 -0
  3. package/.editorbackup/README.md~ +335 -0
  4. package/BACKUP-SANDO.command +61 -0
  5. package/BACKUP-SISIDO.command +61 -0
  6. package/PIPEWIRE.md +280 -0
  7. package/dotpi_root/bin/.editorbackup/dotpi_firstrun.bash~ +149 -0
  8. package/dotpi_root/bin/.editorbackup/dotpi_firstrun~ +177 -0
  9. package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card.bash~ +425 -0
  10. package/dotpi_root/bin/.editorbackup/dotpi_prepare_sd_card~ +620 -0
  11. package/dotpi_root/bin/.editorbackup/dotpi_prepare_system.bash~ +82 -0
  12. package/dotpi_root/bin/.editorbackup/dotpi_prepare_system~ +100 -0
  13. package/dotpi_root/bin/.editorbackup/dotpi~ +61 -0
  14. package/dotpi_root/bin/.editorbackup/prepare_sd_card.bash~ +252 -0
  15. package/dotpi_root/bin/dotpi_prepare_system +14 -3
  16. package/dotpi_root/etc/.editorbackup/dotpi_environment_default.bash~ +49 -0
  17. package/dotpi_root/etc/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  18. package/dotpi_root/etc/.editorbackup/dotpi_environment_project.bash~ +33 -0
  19. package/dotpi_root/etc/.editorbackup/dotpi_tarignore~ +4 -0
  20. package/dotpi_root/share/.editorbackup/coucou~ +1 -0
  21. package/dotpi_root/share/.editorbackup/dotpi_environment.bash~ +9 -0
  22. package/dotpi_root/share/.editorbackup/dotpi_functions.bash~ +11 -0
  23. package/dotpi_root/share/.editorbackup/dotpi_functions_configuration.bash~ +420 -0
  24. package/dotpi_root/share/.editorbackup/dotpi_functions_connection.bash~ +358 -0
  25. package/dotpi_root/share/.editorbackup/dotpi_init.bash~ +18 -0
  26. package/dotpi_root/share/dotpi_audio_alsa/dotpi_audio_alsa.service +15 -0
  27. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth.service~ +24 -0
  28. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_command~ +80 -0
  29. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_start_command~ +26 -0
  30. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_audio_bluetooth_stop_command~ +30 -0
  31. package/dotpi_root/share/dotpi_audio_bluetooth/.editorbackup/dotpi_bluetooth_audio.service~ +21 -0
  32. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_bluetooth.bash~ +256 -0
  33. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_audio_device.bash~ +287 -0
  34. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_bluetooth_audio.bash~ +7 -0
  35. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_configuration.bash~ +428 -0
  36. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_connection.bash~ +194 -0
  37. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_daemon.bash~ +26 -0
  38. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcard.bash~ +287 -0
  39. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_soundcards.bash~ +12 -0
  40. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_system.bash~ +158 -0
  41. package/dotpi_root/share/dotpi_functions/.editorbackup/dotpi_functions_utils.bash~ +152 -0
  42. package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +68 -10
  43. package/dotpi_root/share/dotpi_init.bash +3 -0
  44. package/dotpi_root/share/dotpi_pipewire/bin/dotpi_pipewire_relink +85 -0
  45. package/dotpi_root/share/dotpi_pipewire/dotpi_install +24 -0
  46. package/dotpi_root/share/dotpi_pipewire/systemd/dotpi_pipewire.service +22 -0
  47. package/dotpi_root/share/dotpi_pipewire/systemd/dotpi_pipewire_command +29 -0
  48. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_bluetooth.bash~ +20 -0
  49. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_command~ +17 -0
  50. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_headphones.bash~ +20 -0
  51. package/dotpi_root/share/jackd/.editorbackup/dotpi_jackd_hifiberry.bash~ +16 -0
  52. package/dotpi_root/share/jackd/.editorbackup/jackd.conf~ +5 -0
  53. package/dotpi_root/share/jackd/.editorbackup/jackd.service~ +15 -0
  54. package/dotpi_root/share/jackd/.editorbackup/jackd_headphones.conf~ +5 -0
  55. package/dotpi_root/share/jackd/dotpi_jack_simple_client.service +23 -0
  56. package/dotpi_root/share/wireplumber/.editorbackup/8zzz-dotpi-wireplumber-config.lua~ +1 -0
  57. package/package.json +1 -1
  58. package/projects/asterismes.tgz +0 -0
  59. package/projects/example-bluetooth/configuration/.editorbackup/dotpi_instance_001.bash~ +4 -0
  60. package/projects/example-bluetooth/configuration/.editorbackup/dotpi_instance_002.bash~ +3 -0
  61. package/projects/example-bluetooth/configuration/.editorbackup/dotpi_project.bash~ +46 -0
  62. package/projects/example-bluetooth/configuration/dotpi_instance_001.bash +3 -0
  63. package/projects/example-bluetooth/configuration/dotpi_instance_002.bash +3 -0
  64. package/projects/example-bluetooth/configuration/dotpi_project.bash +48 -0
  65. package/projects/example-development/configuration/.editorbackup/dotpi_project.bash~ +59 -0
  66. package/projects/example-development/configuration/dotpi_instance_114.bash +4 -0
  67. package/projects/example-headphones/configuration/.editorbackup/dotpi_project.bash~ +18 -0
  68. package/projects/example-hifiberry/configuration/.editorbackup/dotpi_instance_012.bash~ +4 -0
  69. package/projects/example-hifiberry/configuration/.editorbackup/dotpi_project.bash~ +18 -0
  70. package/projects/example-network/configuration/.editorbackup/dotpi_project.bash~ +21 -0
  71. package/projects/old/bad/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  72. package/projects/old/bad/.editorbackup/dotpi_environment_project.bash~ +26 -0
  73. package/projects/old/bad/.editorbackup/dotpi_project.bash~ +33 -0
  74. package/projects/old/bad/.editorbackup/dotpi_tmp.bash~ +3 -0
  75. package/projects/old/bad/.editorbackup/wpa_supplicant.conf~ +37 -0
  76. package/projects/old/bad/dotpi_project.bash +20 -0
  77. package/projects/old/bluetooth/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  78. package/projects/old/bluetooth/.editorbackup/dotpi_environment_project.bash~ +26 -0
  79. package/projects/old/bluetooth/.editorbackup/dotpi_project.bash~ +21 -0
  80. package/projects/old/bluetooth/.editorbackup/dotpi_tmp.bash~ +3 -0
  81. package/projects/old/bluetooth/.editorbackup/wpa_supplicant.conf~ +37 -0
  82. package/projects/old/bluetooth/dotpi_project.bash +29 -0
  83. package/projects/old/dev.bak/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  84. package/projects/old/dev.bak/.editorbackup/dotpi_environment_project.bash~ +33 -0
  85. package/projects/old/dev.bak/.editorbackup/wpa_supplicant.conf~ +37 -0
  86. package/projects/old/dev.bak/dotpi_environment_instance.bash +1 -0
  87. package/projects/old/dev.bak/dotpi_environment_project.bash +46 -0
  88. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI-A114.nmconnection~ +24 -0
  89. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/DOTPI.nmconnection~ +24 -0
  90. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +24 -0
  91. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/onze.nmconnection~ +22 -0
  92. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/.editorbackup/welcome.nmconnection~ +23 -0
  93. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI-A114.nmconnection +23 -0
  94. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/DOTPI.nmconnection +23 -0
  95. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/Livebox-97C6_wifi_invite.nmconnection +24 -0
  96. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/onze.nmconnection +24 -0
  97. package/projects/old/dev.bak/file-system/etc/NetworkManager/system-connections/welcome.nmconnection +23 -0
  98. package/projects/old/dev.bak/network/.editorbackup/DOTPI-A114.nmconnection~ +24 -0
  99. package/projects/old/dev.bak/network/.editorbackup/DOTPI.nmconnection~ +24 -0
  100. package/projects/old/dev.bak/network/.editorbackup/Livebox-97C6_wifi_invite.nmconnection~ +24 -0
  101. package/projects/old/dev.bak/network/.editorbackup/onze.nmconnection~ +22 -0
  102. package/projects/old/dev.bak/network/.editorbackup/welcome.nmconnection~ +23 -0
  103. package/projects/old/dev.bak/network/AccueilCie.nmconnection +24 -0
  104. package/projects/old/dev.bak/network/DOTPI-A114.nmconnection +23 -0
  105. package/projects/old/dev.bak/network/DOTPI.nmconnection +23 -0
  106. package/projects/old/dev.bak/network/Livebox-97C6_wifi_invite.nmconnection +25 -0
  107. package/projects/old/dev.bak/network/onze.nmconnection +24 -0
  108. package/projects/old/dev.bak/network/welcome.nmconnection +23 -0
  109. package/projects/old/dev.bak/network/wifi-access-point.nmconnection +23 -0
  110. package/projects/old/dev.bak/network/wifi-internet.nmconnection +24 -0
  111. package/projects/old/dev.bak/network/wifi-ircam-public.nmconnection +24 -0
  112. package/projects/old/dev.bak/network/wifi-local.nmconnection +22 -0
  113. package/projects/old/dev.bak/network/wifi-welcome.nmconnection +24 -0
  114. package/projects/old/dev.bak/wpa_supplicant.conf +43 -0
  115. package/projects/old/dev.zip +0 -0
  116. package/projects/old/example/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  117. package/projects/old/example/.editorbackup/dotpi_environment_project.bash~ +26 -0
  118. package/projects/old/example/.editorbackup/dotpi_project.bash~ +21 -0
  119. package/projects/old/example/.editorbackup/dotpi_tmp.bash~ +3 -0
  120. package/projects/old/example/.editorbackup/wpa_supplicant.conf~ +37 -0
  121. package/projects/old/example/configuration/.editorbackup/dotpi_project.bash~ +21 -0
  122. package/projects/old/example/configuration/dotpi_project.bash +21 -0
  123. package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_instance.bash~ +1 -0
  124. package/projects/old/example-complete.bak/.editorbackup/dotpi_environment_project.bash~ +26 -0
  125. package/projects/old/example-complete.bak/.editorbackup/dotpi_project.bash~ +21 -0
  126. package/projects/old/example-complete.bak/.editorbackup/dotpi_tmp.bash~ +3 -0
  127. package/projects/old/example-complete.bak/.editorbackup/wpa_supplicant.conf~ +37 -0
  128. package/projects/old/example-complete.bak/configuration/.editorbackup/dotpi_project.bash~ +21 -0
  129. package/projects/old/example-complete.bak/configuration/dotpi_project.bash +21 -0
  130. package/projects/old/example-complete.bak/configuration/jackd/.editorbackup/dotpi_jackd.bash~ +14 -0
  131. package/projects/old/example-complete.bak/configuration/jackd/dotpi_jackd.bash +14 -0
  132. package/src/create-project.js +3 -3
  133. package/src/templates/dotpi_project.bash +1 -1
  134. package/src/templates/gitignore +4 -0
@@ -25,10 +25,10 @@ dotpi_audio_device_supported=(
25
25
  'raspberry pi dac+'
26
26
  'raspberry pi digiamp+'
27
27
  'raspberry pi codec zero'
28
- 'iqaudio pi dac pro'
29
- 'iqaudio pi dac+'
30
- 'iqaudio pi digiamp+'
31
- 'iqaudio pi codec zero'
28
+ 'iqaudio dac pro'
29
+ 'iqaudio dac+'
30
+ 'iqaudio digiamp+'
31
+ 'iqaudio codec zero'
32
32
  'bluetooth'
33
33
  'ue boom 2'
34
34
  'ue boom 3'
@@ -171,22 +171,22 @@ dotpi_audio_device_select() (
171
171
  # Raspberry
172
172
  # Cf. https://www.raspberrypi.com/documentation/accessories/audio.html#configuration
173
173
 
174
- 'raspberry pi dac pro'|'iqaudio pi dac pro')
174
+ 'raspberry pi dac pro'|'iqaudio dac pro')
175
175
  dtoverlay=rpi-dacpro
176
176
  _dotpi_audio_device_select_raspberry_pi
177
177
  ;;
178
178
 
179
- 'raspberry pi dac+'|'iqaudio pi dac+')
180
- dtoverlay=rpi-dacplus
179
+ 'raspberry pi dac+'|'iqaudio dac+')
180
+ dtoverlay='rpi-dacplus,auto_mute_amp'
181
181
  _dotpi_audio_device_select_raspberry_pi
182
182
  ;;
183
183
 
184
- 'raspberry pi digiamp+'|'iqaudio pi digiamp+')
185
- dtoverlay=rpi-digiampplus
184
+ 'raspberry pi digiamp+'|'iqaudio digiamp+')
185
+ dtoverlay='rpi-digiampplus,auto_mute_amp'
186
186
  _dotpi_audio_device_select_raspberry_pi
187
187
  ;;
188
188
 
189
- 'raspberry pi codec zero'|'iqaudio pi codec zero')
189
+ 'raspberry pi codec zero'|'iqaudio codec zero')
190
190
  dtoverlay=rpi-codeczero
191
191
  _dotpi_audio_device_select_raspberry_pi
192
192
  ;;
@@ -438,6 +438,64 @@ _dotpi_audio_device_volume_set_alsa() (
438
438
  --value "$volume"
439
439
  )
440
440
 
441
+ dotpi_audio_device_init() (
442
+
443
+ if [[ -z "$dotpi_audio_device" ]] ; then
444
+ dotpi_echo_warning "dotpi_audio_device not set, keeping default audio device"
445
+ return 0
446
+ fi
447
+
448
+ model_normalised="$(dotpi_audio_device_model_normalise "$dotpi_audio_device")"
449
+
450
+ # hardware
451
+ case "$model_normalised" in
452
+ 'raspberry pi codec zero'|'iqaudio codec zero')
453
+
454
+ usr_repository="raspberrypi/Pi-Codec"
455
+ usr_directory="${DOTPI_ROOT}/usr/${usr_repository}"
456
+
457
+ # clone once to be able to init offline
458
+ if ! [[ -d "${usr_directory}" ]] ; then
459
+ mkdir -p "${usr_directory}"
460
+ git clone "https://github.com/${usr_repository}.git" "${usr_directory}" || {
461
+ dotpi_echo_error "Unable to clone repository ${usr_repository}"
462
+ return 1
463
+ }
464
+ fi
465
+
466
+ alsactl restore -f "${usr_directory}/Codec_Zero_StereoMIC_record_and_HP_playback.state"
467
+ ;;
468
+
469
+ esac
470
+
471
+ # alsa
472
+ case "$model_normalised" in
473
+
474
+ 'headphones')
475
+
476
+ amixer -D sysdefault sset -- 'PCM' 'on'
477
+ amixer -D sysdefault sset -- 'PCM' '0dB'
478
+ alsactl store
479
+ ;;
480
+
481
+ 'raspberry pi dac pro'|'iqaudio dac pro' \
482
+ | 'raspberry pi dac+'|'iqaudio dac+' \
483
+ | 'raspberry pi digiamp+'|'iqaudio digiamp+' \
484
+ | 'raspberry pi codec zero'|'iqaudio codec zero')
485
+
486
+ amixer -D sysdefault sset -- 'Headphone' 'on'
487
+ amixer -D sysdefault sset -- 'Headphone' '0dB'
488
+
489
+ amixer -D sysdefault sset -- 'Lineout' 'on'
490
+ amixer -D sysdefault sset -- 'Lineout' '0dB'
491
+
492
+ alsactl store
493
+ ;;
494
+
495
+ esac
496
+
497
+ )
498
+
441
499
  # set and store volume for the current audio device
442
500
  dotpi_audio_device_volume_set() (
443
501
  volume="$1"
@@ -13,6 +13,9 @@ _local_path="$(cd -- "$(dirname -- "${_local_file}")" && pwd)"
13
13
  DOTPI_ROOT="$(cd -- "${_local_path}/.." && pwd)"
14
14
  export DOTPI_ROOT
15
15
 
16
+ export PATH="${PATH}:${DOTPI_ROOT}/usr/bin"
17
+ export PATH="${PATH}:${DOTPI_ROOT}/bin"
18
+
16
19
  source "${DOTPI_ROOT}/share/dotpi_functions.bash"
17
20
 
18
21
  source "${DOTPI_ROOT}/share/dotpi_environment.bash"
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/node
2
+
3
+ // @TODO: use a proper pipewire lua script that automatically runs
4
+ // whenever the default audio output is restored
5
+
6
+ const util = require('node:util');
7
+ const exec = util.promisify(require('node:child_process').exec);
8
+
9
+ let pipewireData = null;
10
+ async function pipewireRelink() {
11
+
12
+ try {
13
+ const { stdout, stderr } = await exec('pw-dump');
14
+ // console.log('pw-dump stdout:', stdout);
15
+ if(stderr) {
16
+ console.warn('pw-dump stderr:', stderr);
17
+ }
18
+
19
+ pipewireData = JSON.parse(stdout);
20
+
21
+ } catch (error) {
22
+ console.error('Error with pw-dump:', error.message, error);
23
+ process.exit(1);
24
+ }
25
+ const playbackNodes = pipewireData.filter( (e) => {
26
+ return e.type === "PipeWire:Interface:Node"
27
+ && e.info
28
+ && e.info.props
29
+ && typeof e.info.props['client.id'] !== 'undefined'
30
+ && e.info.props['media.type'] === 'Audio'
31
+ });
32
+
33
+ if (playbackNodes.length === 0) {
34
+ console.warn('pipewireRelink: no playback node');
35
+ // no error
36
+ process.exit(0);
37
+ }
38
+
39
+ const outputNodes = pipewireData.filter( (e) => {
40
+ return e.type === "PipeWire:Interface:Node"
41
+ && e.info
42
+ // && e.info['max-input-ports'] > 1
43
+ && e.info.props
44
+ && e.info.props['media.class'] === 'Audio/Sink';
45
+ });
46
+
47
+ if (outputNodes.length === 0) {
48
+ console.warn('pipewireRelink: no output node');
49
+ // no error
50
+ process.exit(0);
51
+ }
52
+ else if (outputNodes.length > 1) {
53
+ console.warn('pipewireRelink: multiple output nodes');
54
+ }
55
+
56
+ for(let p = 0; p < playbackNodes.length; ++p) {
57
+ for(let o = 0; o < outputNodes.length; ++o) {
58
+ playbackIndex = playbackNodes[p].id;
59
+ outputIndex = outputNodes[o].id;
60
+ const commandString = `pw-link ${playbackIndex} ${outputIndex}`;
61
+ try {
62
+ // console.log(commandString);
63
+ const {stdout, stderr} = await exec(commandString);
64
+ // console.log('pw-link stdout:', stdout);
65
+ if(stderr) {
66
+ console.warn('pw-link stderr:', stderr);
67
+ }
68
+ } catch(error) {
69
+ // error when linking nodes instead of ports: ignore
70
+ // console.error( `Error with ${commandString}:`, error.message, error);
71
+ continue;
72
+ }
73
+ }
74
+ }
75
+
76
+ process.exit(0);
77
+
78
+ }
79
+
80
+ pipewireRelink();
81
+
82
+
83
+
84
+
85
+
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+
3
+ # drop sudo privileges
4
+ if [[ "$USER" == "root" ]]; then
5
+ if [[ -n "$SUDO_USER" ]] ; then
6
+ user="$SUDO_USER"
7
+ else
8
+ FIRSTUSER="$(getent passwd 1000 | cut -d: -f1)"
9
+ user="${FIRSTUSER:-pi}"
10
+ fi
11
+ sudo -u "${user}" "$0" "$@"
12
+ fi
13
+
14
+ local_file="$(dotpi readlink_follow "$0")"
15
+ local_path="$(dirname -- "$local_file")"
16
+
17
+ sudo dotpi service_install --user "${local_path}/systemd/dotpi_pipewire.service"
18
+
19
+ source_path="${local_path}/bin"
20
+ destination_path="${DOTPI_ROOT}/usr/bin"
21
+ sudo mkdir -p -- "$destination_path"
22
+ for executable in "${source_path}/"* ; do
23
+ sudo ln -s -f -- "$executable" "${destination_path}/$(basename -- "$executable")"
24
+ done
@@ -0,0 +1,22 @@
1
+ [Unit]
2
+ Description=dotpi pipewire audio daemon
3
+ Requires=pipewire.service
4
+ After=pipewire.service
5
+
6
+ # TODO: stop on system stop
7
+
8
+ [Service]
9
+ Type=exec
10
+
11
+ ExecStart=/opt/dotpi/share/dotpi_pipewire/systemd/dotpi_pipewire_command
12
+
13
+ Restart=always
14
+
15
+ # wait before restarting
16
+ RestartSec=10s
17
+
18
+ # Do not stop to try restarting service
19
+ StartLimitBurst=0
20
+
21
+ [Install]
22
+ WantedBy=pipewire.service
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+
3
+ if [[ "$USER" == "root" ]] ; then
4
+ dotpi echo_error "This script MUST NOT be executed by root (or via sudo)"
5
+ exit 1
6
+ fi
7
+
8
+ local_file="$(dotpi readlink_follow "$0")"
9
+ local_path="$(dirname -- "$local_file")"
10
+
11
+ (( trial_count_max = 10 ))
12
+ while true ; do
13
+ if systemctl --user is-active "pipewire" > /dev/null 2>&1 ; then
14
+ (
15
+ (( trial_count = 0 ))
16
+ while (( trial_count < trial_count_max )) ; do
17
+ "${local_path}/../bin/dotpi_pipewire_relink" && exit 0
18
+ sleep 3
19
+ (( ++trial_count ))
20
+ done
21
+ dotpi echo_error "Failed to relink pipewire outputs ${trial_count_max} times."
22
+ dotpi echo_warning "Rebooting system."
23
+ sudo reboot
24
+ )
25
+ fi
26
+ sleep 10
27
+ done
28
+
29
+
@@ -0,0 +1,20 @@
1
+ DOTPI_JACKD_ENVIRONMENT=(
2
+ JACK_NO_AUDIO_RESERVATION=1
3
+ )
4
+
5
+ # warning: long option for -d (--driver) seems broken
6
+
7
+ # explicit outchannels (default is 0)
8
+
9
+ DOTPI_JACKD_ARGUMENTS=(
10
+ --realtime
11
+ --realtime-priority 95
12
+ -d alsa
13
+ --device hw:0
14
+ --playback
15
+ --period 1024
16
+ --nperiods 2
17
+ --rate 48000
18
+ --inchannels 0
19
+ --outchannels 2
20
+ )
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ local_file="$(dotpi readlink_follow "$0")"
4
+ local_path="$(dirname -- "$local_file")"
5
+
6
+ source "${local_path}/jackd.conf"
7
+
8
+ echo "dotpi_jackd_command"
9
+
10
+ echo "ENV: ${DOTPI_JACKD_ENVIRONMENT[@]}"
11
+ echo "ARGS: ${DOTPI_JACKD_ARGUMENTS[@]}"
12
+
13
+ for e in "${DOTPI_JACKD_ENVIRONMENT[@]}" ; do
14
+ export "$e"
15
+ done
16
+
17
+ jackd "${DOTPI_JACKD_ARGUMENTS[@]}"
@@ -0,0 +1,20 @@
1
+ DOTPI_JACKD_ENVIRONMENT=(
2
+ JACK_NO_AUDIO_RESERVATION=1
3
+ )
4
+
5
+ # warning: long option for -d (--driver) seems broken
6
+
7
+ # explicit outchannels (default is 0)
8
+
9
+ DOTPI_JACKD_ARGUMENTS=(
10
+ --realtime
11
+ --realtime-priority 95
12
+ -d alsa
13
+ --device hw:0
14
+ --playback
15
+ --period 1024
16
+ --nperiods 2
17
+ --rate 48000
18
+ --inchannels 0
19
+ --outchannels 2
20
+ )
@@ -0,0 +1,16 @@
1
+ DOTPI_JACKD_ENVIRONMENT=(
2
+ JACK_NO_AUDIO_RESERVATION=1
3
+ )
4
+
5
+ # warning: long option for -d (--driver) seems broken
6
+
7
+ DOTPI_JACKD_ARGUMENTS=(
8
+ --realtime
9
+ --realtime-priority 95
10
+ -d alsa
11
+ --device hw:0,0
12
+ --duplex
13
+ --period 128
14
+ --nperiods 2
15
+ --rate 48000
16
+ )
@@ -0,0 +1,5 @@
1
+ DOTPI_JACK_PRIORITY=95
2
+ DOTPI_JACK_ALSA_HW=hw:sndrpihifiberry,0
3
+ DOTPI_JACK_ALSA_SAMPLE_RATE=48000
4
+ DOTPI_JACK_ALSA_PERIOD=128
5
+ DOTPI_JACK_ALSA_NUM_PERIOD=2
@@ -0,0 +1,15 @@
1
+ [Unit]
2
+ Description=Jack daemon
3
+ After=sound.target
4
+
5
+ [Service]
6
+ LimitRTPRIO=infinity
7
+ LimitMEMLOCK=infinity
8
+ User=pi
9
+ Group=audio
10
+ ExecStart=/opt/dotpi/share/jackd/jackd_command
11
+ Restart=always
12
+
13
+ [Install]
14
+ WantedBy=multi-user.target
15
+
@@ -0,0 +1,5 @@
1
+ DOTPI_JACK_PRIORITY=95
2
+ DOTPI_JACK_ALSA_HW=hw:0,0
3
+ DOTPI_JACK_ALSA_SAMPLE_RATE=48000
4
+ DOTPI_JACK_ALSA_PERIOD=128
5
+ DOTPI_JACK_ALSA_NUM_PERIOD=2
@@ -0,0 +1,23 @@
1
+ [Unit]
2
+ Description=dotpi jack simple client
3
+ # no dependency between system and user services
4
+ Wants=pipewire.service
5
+ After=pipewire.service
6
+
7
+
8
+ [Service]
9
+ Type=exec
10
+ ExecStart=/usr/bin/pw-jack /home/pi/playtest/bin/jack_simple_client
11
+ WorkingDirectory=/home/pi
12
+ StandardOutput=inherit
13
+ StandardError=inherit
14
+ Restart=always
15
+
16
+ # wait before restarting
17
+ RestartSec=5s
18
+
19
+ # Do not stop to try restarting service
20
+ StartLimitBurst=0
21
+
22
+ [Install]
23
+ WantedBy=pipewire.service
@@ -0,0 +1 @@
1
+ bluez_monitor.properties["with-logind"] = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/tools",
3
- "version": "1.0.1",
3
+ "version": "1.4.0",
4
4
  "description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
5
5
  "author": "Jean-Philippe Lambert",
6
6
  "contributors": [
Binary file
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_bluetooth_speaker_mac='10:94:97:24:D0:13'
4
+ dotpi_bluetooth_speaker_name="Ast-${dotpi_instance_number}"
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_bluetooth_audio_mac='10:94:97:24:D0:13'
@@ -0,0 +1,46 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ dotpi_ssh_allow_password_authentication='yes'
6
+
7
+ dotpi_timezone='Europe/Paris'
8
+ dotpi_keymap='fr'
9
+
10
+ dotpi_soundcard='HiFiBerry DAC+ ADC Pro'
11
+
12
+ # add packages
13
+ # be sure to keep the parentheses, even for a single line
14
+ dotpi_apt_install+=(
15
+ #### utilities ####
16
+
17
+ # 'locate' # find files
18
+ 'screen' # detach sessions
19
+
20
+
21
+ #### compilation ####
22
+
23
+ 'cmake'
24
+ 'make'
25
+ 'scons'
26
+
27
+
28
+ #### network ####
29
+
30
+ # 'dnsutils' # dig
31
+ # 'nmap' # test clients in network
32
+
33
+
34
+ #### audio ####
35
+
36
+ 'jackmeter' # monitor sound activity in console
37
+ # 'mpv' # play soundfiles via jackd
38
+ # 'sox' # manipulate soundfile
39
+ # 'vlc' # play soundfiles via jackd
40
+
41
+ #### bluetooth ####
42
+
43
+ 'bluez'
44
+ 'bluez-alsa-utils' # bluealsa-aplay to get sound from Bluetooth
45
+ 'bluez-tools'
46
+ )
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_bluetooth_audio_mac='10:94:97:24:D0:13'
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_bluetooth_audio_mac='10:94:97:24:11:11'
@@ -0,0 +1,48 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ dotpi_ssh_allow_password_authentication='yes'
6
+
7
+ dotpi_timezone='Europe/Paris'
8
+ dotpi_keymap='fr'
9
+
10
+ dotpi_soundcard='UE MegaBoom 3'
11
+
12
+ dotpi_bluetooth_audio_volume=127
13
+
14
+ # add packages
15
+ # be sure to keep the parentheses, even for a single line
16
+ dotpi_apt_install+=(
17
+ #### utilities ####
18
+
19
+ # 'locate' # find files
20
+ 'screen' # detach sessions
21
+
22
+
23
+ #### compilation ####
24
+
25
+ 'cmake'
26
+ 'make'
27
+ 'scons'
28
+
29
+
30
+ #### network ####
31
+
32
+ # 'dnsutils' # dig
33
+ # 'nmap' # test clients in network
34
+
35
+
36
+ #### audio ####
37
+
38
+ 'jackmeter' # monitor sound activity in console
39
+ # 'mpv' # play soundfiles via jackd
40
+ # 'sox' # manipulate soundfile
41
+ # 'vlc' # play soundfiles via jackd
42
+
43
+ #### bluetooth ####
44
+
45
+ 'bluez'
46
+ 'bluez-alsa-utils' # bluealsa-aplay to get sound from Bluetooth
47
+ 'bluez-tools'
48
+ )
@@ -0,0 +1,59 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ # default is yes
6
+ dotpi_ssh_allow_password_authentication='yes'
7
+
8
+ # no default password:
9
+ # - keep the one set by the imager
10
+ # - or over-ride in dotpi_environment_project.bash
11
+ dotpi_password_hash6=
12
+ # # openssl passwd -6
13
+ # dotpi_password_hash6='$6$...'
14
+
15
+ dotpi_timezone='Europe/Paris'
16
+ dotpi_keymap='fr'
17
+
18
+ dotpi_soundcard='HiFiBerry DAC+ ADC Pro'
19
+
20
+ # use node.js specific version
21
+ # default is lts
22
+ dotpi_node_version='lts'
23
+
24
+ # add packages
25
+ # be sure to keep the parentheses, even for a single line
26
+ dotpi_apt_install+=(
27
+ #### utilities ####
28
+
29
+ # 'locate' # find files
30
+ 'screen' # detach sessions
31
+
32
+
33
+ #### compilation ####
34
+
35
+ 'cmake'
36
+ 'make'
37
+ 'scons'
38
+
39
+
40
+ #### network ####
41
+
42
+ 'dnsutils' # dig
43
+ 'nmap' # test clients in network
44
+
45
+
46
+ #### audio ####
47
+
48
+ 'jackmeter' # monitor sound activity in console
49
+ # 'mpv' # play soundfiles via jackd
50
+ # 'sox' # manipulate soundfile
51
+ # 'vlc' # play soundfiles via jackd
52
+
53
+ #### bluetooth ####
54
+
55
+ # 'bluez'
56
+ # 'bluez-alsa'
57
+ # 'bluez-alsa-utils' # bluealsa-aplay to get sound from Bluetooth
58
+ # 'bluez-tools'
59
+ )
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ # define soundcard
4
+ dotpi_audio_device='headphones'
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ dotpi_ssh_allow_password_authentication='yes'
6
+
7
+ dotpi_soundcard='Headphones'
8
+
9
+ # add packages
10
+ # be sure to keep the parentheses, even for a single line
11
+ dotpi_apt_install+=(
12
+ # 'dnsutils' # dig
13
+ 'jackmeter' # monitor sound activity in console
14
+ # 'locate'
15
+ # 'nmap' # test clients in network
16
+ 'screen' # detach sessions
17
+ # 'mpv' # play soundfiles via jackd
18
+ )
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ # 012 is not professional
4
+ dotpi_soundcard='HiFiBerry DAC+ ADC'
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ dotpi_ssh_allow_password_authentication='yes'
6
+
7
+ dotpi_soundcard='HiFiBerry DAC+ ADC Pro'
8
+
9
+ # add packages
10
+ # be sure to keep the parentheses, even for a single line
11
+ dotpi_apt_install+=(
12
+ # 'dnsutils' # dig
13
+ 'jackmeter' # monitor sound activity in console
14
+ # 'locate'
15
+ # 'nmap' # test clients in network
16
+ 'screen' # detach sessions
17
+ # 'mpv' # play soundfiles via jackd
18
+ )
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+
3
+ dotpi_project_name='example'
4
+
5
+ dotpi_ssh_allow_password_authentication='yes'
6
+
7
+ dotpi_timezone='Europe/Paris'
8
+ dotpi_keymap='fr'
9
+
10
+ dotpi_soundcard='HiFiBerry DAC+ ADC Pro'
11
+
12
+ # add packages
13
+ # be sure to keep the parentheses, even for a single line
14
+ dotpi_apt_install+=(
15
+ 'jackmeter' # monitor sound activity in console
16
+ # 'locate'
17
+ 'dnsutils' # dig
18
+ 'nmap' # test clients in network
19
+ 'screen' # detach sessions
20
+ # 'mpv' # play soundfiles via jackd
21
+ )