Commit graph

39 commits

Author SHA1 Message Date
G Derber
f7761fd635
Add ability to differentiate group ownership from user ownership. 2024-08-06 09:38:25 -04:00
cmitu
2985bcaa52 audiosettings: improve Pipewire control
Fixes:
 - settings the default sink (audio output) with `pactl` doesn't work like `pacmd`. The index of the sink is ignored and it's sink's `object.id` that's accepted by `pactl set-default-sink <id>`. As such, previous version didn't correctly set the audio output for Pipewire/Pulseaudio so a separate hash map was added to translate from `index` to the `object.id` of the sink.
 - running `alsamixer` doesn't work correctly as `root` when Pipewire/Wireplumber are started as user services. Thus, run it as the install user in the Pulseaudio context

Tweaks:
 - use `card.name` for the name of the card when listed in the dialog. This makes the name of the HDMI outputs nicer, instead of using the `alsa.name` property which outputs `MAI PCM i2s-hifi-0` as the card name (not very user friendly). With the new naming tweaks, the HDMI outputs are shown as `HDMI-0` or `HDMI-1`.
2024-06-27 17:55:49 +01:00
cmitu
6e74abe4f3 audiosettings: fix Pi5 detection
Fixed Pi5 detection by checking for `vc4hdmi` cards when determining if audio is enabled.
Since the Pi5 doesn't have the analog audio output (Headphones), the detection thinks there's no audio enabled (since `snd_bcm2835` module is not loaded), but it's wrong.

Also fixed a couple of things:
 - the `pactl` listing parsing would enter an infinite loop if no audio was present
 - when checking for Pulse/Pipewire use the `.service` instead of the `.socket`, since the socket can be disabled, but the service is always active.
2023-11-07 03:30:36 +00:00
cmitu
b9f3998ec8 audiosettings: add Pi5 along
Pi5 has the same 2 mHDMI ports and 2 cards
2023-10-24 19:12:53 +01:00
cmitu
3fd5a3cbf0 audiosettings: add PipeWire support
Since PipeWire is the default sound server in RaspiOS 12 _bookworm_, make sure we account for its presence and we're able to choose a default card ('output sink') or disable/enable it.

At this time, PipeWire is using emulating a PulseAudio session manager through `pipewire-pulse`, while also running the native `wireplumber` session manager.
Most of the clients still think they speak to PulseAudio using the PulseAudio client API, while the actual backend is PipeWire.

Changed:
 - use `pactl` instead of `pacmd`, since the latter is not working through PipeWire's PulseAudio emulation
 - use `pactl` to set the PipeWire defaul output, instead of using the native `pw-cli`
 - added a toggle functions for PipeWire and PulseAudio, chosen based on the detected sound server

NOTE: although techically possible, I haven't added an option to enable PulseAudio if PipeWire is also present, but I don't think it's needed.
2023-10-17 18:47:23 +01:00
cmitu
a9024142af audiosettings: ensure ALSA configuration folder exists
On RaspiOS (10/11), the ALSA configurations folder doesn't exist, so make sure we're creating it before saving/moving the ALSA configuration file we generate with the scriptmodule.
2023-08-15 17:17:44 +01:00
Jools Wills
e6392b8209 audiosettings - use /etc/alsa/conf.d for retropie alsa configs
Move resetting alsa to function to avoid duplication.

Add dialog when migrating ~/.asoundrc to the new location.
If ~/.asoundrc exists and there is no config in /etc/alsa/conf.d/99-retropie.conf then offer to move the file.

Asking the user is safer as we don't want to migrate a users own custom ALSA configuration.
2023-06-19 19:41:41 +01:00
cmitu
83ef823f9d audiosettings: support the ARM-side HDMI driver
Needed for configurations using the 'vc4-kms-v3d' overlay (default in RPI OS 11).
The names are (almost) similar, but the default order of the cards is different:

 * (fkms/videocore) the order is HDMI, Headphones
 * (kms) the order is Headphones, HDMI

The `vc4hdmi` driver also has an extra PCM (hdmi) that does the audio conversion, since the default one understands only the `IEC958_SUBFRAME_LE` format.
The new PCM is configured in `/usr/share/alsa/cards/vc4-hdmi.conf`, and it needs a recent `libasound2-data` package (on Buster, Bullseye already has the configuration included).

The default ALSA configuration may have a bug (?) in the definition of the volume control (mixer) for the `vc4hdmi` cards, so add a software volume control with a mute toggle for these cards. For compatibility with previous configurations, the control is named 'HDMI'.
2023-03-19 10:21:22 +00:00
cmitu
7c010a52c5 audiosettings: fix PA options display when using mawk
`mawk` (default AWK on Debian) doesn't know about `gensub`, so use a Posix ERE instead.
Fix also the options index when choosing the PulseAudio sink so the correct audio output is chosen.
2021-03-21 17:35:09 +00:00
cmitu
e6e6127a67 audiosettings: add PulseAudio configuration support.
When PulseAudio is installed and active, it takes over as the default ALSA device.
Remove any `.asoundrc` when it's enabled and configure the PulseAudio default output sink instead.

Added the option to enable/disable PulseAudio, depending on the running configuration.
2020-12-15 04:43:56 +00:00
cmitu
a7b8d5d39d audiosettings: update 2020-05-25 05:08:54 +01:00
Jools Wills
805b788efc some missing local variable definitions, and variable renaming of choices to choice 2017-09-19 15:04:33 +01:00
Jools Wills
e385457a7b cosmetic - remove trailing spaces in copyright 2016-08-11 03:23:30 +01:00
Jools Wills
0e2e6ce184 kodi module fix -
* fix some left over use of __depends_mode (now md_mode) - fixes pippleware kodi 16 repo install
  * make sure we force an apt-get update in case one was done before the repo was added
2016-06-11 22:50:11 +01:00
Jools Wills
8dd2069660 use config instead of conf 2016-06-06 22:08:36 +01:00
Jools Wills
889f8ecdfa Initial rewrite of the setup menu, including per package/module management
* rp_module_menus is no more - instead use rp_module_section with one of
   - core (core packages)
   - main (main packages - which will be installed by default in the image)
   - opt (optional packages)
   - exp (experimental packages)
   - driver (driver packages)
   - config (configuration packages / tools)

 * The setup menu organises the data based on the above sections. more could be added in the future if needed. Packages (internally modules), can be added / configured / removed individually, or as entire sections.

 * The setup menu will automatically detect if a binary is available to be installed. the nobin flag is no longer needed. modules that install directly from binary via aptInstall or via a prebuilt binary need to use an install_bin_ function instead of install_

 * rp_module_section of type "config" will have the "gui_" function called first if it's available, otherwise a standard depends/sources/build/install/configure will be called

 * configure is no longer used for "gui" configuration function - use gui_ instead. Had already started to move to this before, but now it is required.
2016-06-06 22:08:36 +01:00
Jools Wills
fdb2bb2104 never remove alsa-utils as raspi-config has a dependency on it 2016-02-22 20:07:21 +00:00
Jools Wills
1348c459c3 force stdin/stdout for alsamixer via /dev/tty - needed when launching alsamixer from retropie-setup within ES, due to the logging redirection 2016-02-05 22:33:09 +00:00
Jools Wills
184dda8c8e use !mali instead of !odroid 2016-01-17 00:36:03 +00:00
Jools Wills
275711dfa0 some more odroid module exclusions 2016-01-04 19:55:01 +00:00
gizmo98
bb41968ac9 Remove more modules 2015-12-24 15:52:44 +01:00
Jools Wills
331ee9e724 added alsa-utils dependency to audiosettings (as not installed by default on OSMC) 2015-12-01 15:29:55 +00:00
Jools Wills
d7f843d473 copyright sp / minor wording tweak 2015-10-12 00:09:22 +01:00
Florian
db0dd30692 CHG: Updated copyright information. 2015-10-11 21:03:16 +02:00
Jools Wills
c0f0a984bf rather than correcting stdin/stdout to /dev/tty for alsamixer, do it when retropie-setup is launched from ES so all modules benefit 2015-10-03 16:52:31 +01:00
Jools Wills
ce8ede4def updated licence url (to RetroPie org). Remove . at end of licence url to avoid any confusion 2015-06-16 16:41:34 +01:00
Florian
4df425c338 CHG: Updated header information 2015-03-28 06:19:16 +01:00
Florian
aab7fbd52d CHG: Added license information to all files 2015-03-27 17:28:38 +01:00
Jools Wills
32fabb3b59 force /dev/tty for input/output for alsamixer - solves issues with launching within retropie-setup and keyboard input/screen output 2015-03-03 14:01:13 +00:00
Jools Wills
94b497ef07 intentation changes (to be more consistent with 4 spaces indentation) 2015-02-26 04:51:05 +00:00
Jools Wills
9d2071619b clean up audiosettings module - add option to launch alsamixer 2015-02-26 02:56:04 +00:00
Jools Wills
bbaaad975c various fixes based on recommendations from shellcheck
changed order of retronetplay module so functions can be found
2015-01-11 21:26:10 +00:00
Jools Wills
231051ccad styleguide changes:
* add newline to end of main scripts
2015-01-11 17:32:20 +00:00
Jools Wills
2fd9bd4e71 styleguide changes:
* [[ "a" != "" ]] -> [[ -n "a" ]]
2015-01-11 17:19:51 +00:00
Jools Wills
641178f761 styleguide changes:
* [ ] -> [[ ]]
  * [ a = b ] -> [[ a == b ]]

note asplashscreen script left with [ ] as it doesn't specify bash directory
2015-01-11 17:11:11 +00:00
Jools Wills
a132751df8 use nobin instead of nobindist 2015-01-07 00:47:55 +00:00
Jools Wills
9a12b1ef88 initial support for creating/installing via split binary packages #553 2015-01-07 00:18:16 +00:00
Jools Wills
d07f45028b de-duplicate setting of dialog backtitle everywhere - use a global variable and set it in retropie_setup.sh once 2014-08-02 18:52:05 +01:00
Jools Wills
de6cec861f split supplementary.sh into auto-loading modules 2014-07-20 20:35:26 +01:00