Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Rebooting resets the volume from Alsamixer to very loud #206

Open
valzi opened this issue Feb 16, 2022 · 17 comments
Open

Rebooting resets the volume from Alsamixer to very loud #206

valzi opened this issue Feb 16, 2022 · 17 comments

Comments

@valzi
Copy link

valzi commented Feb 16, 2022

This problem is not specific to Adam Image. I'm just reporting solutions here in case you want to include them in the image.

Solution 1: https://github.com/vloschiavo/DinguxAlsaMixerSave
It saves changes whenever you use Alsa Mixer and then loads your changes on boot.

Solution 2: https://www.reddit.com/r/RG350/comments/izu53r/instructions_lowering_the_default_volume_on_rg280m/
It is just a file in which you set the volume you want to be loaded upon boot.

Neither solution works for me because commander says I do not have permission to make the change.

@eduardofilo
Copy link
Owner

Interesting. I will investigate it. Many thanks.

@neilswann80
Copy link
Collaborator

neilswann80 commented Feb 18, 2022

The AlsaMixer command-line tool /usr/sbin/alsactl is missing in ODBeta, so the script by @vloschiavo isn't going to work on the Adam Image.

I grabbed alsactl from the original OD and confirmed it works with ODBeta and I've rewritten the script to use it:
https://github.com/neilswann80/DinguxAlsaMixerSave/releases/tag/alamixer

S91alsaSettings as before needs to be saved here:
/media/data/local/etc/init.d (via ssh or a linux PC)

When the script runs for the first time it ensures there's a directory called /media/sdcard/ALSA and creates a file named delete2reset within it; this file can be deleted at any time via commander on the device, then upon reboot the AlsaMixer defaults are restored.

I've added the alsactl file needed for this script to run as a release (via the same link above); it needs to be saved in /media/sdcard/ALSA.

NOTE: I did notice a weird quirk with AlsaMixer in that it doesn't seem to close down properly. As you navigate through SimpleMenu on the D-pad after running AlsaMixer, the D-pad presses seem to keep affecting volume changes with AlsaMixer. I would suggest after setting a volume in AlsaMixer, press select to exit, then immediately press start and shutdown the device. You can then power it straight back on and use the device without worry of AlsaMixer settings being interferred with.

@valzi
Copy link
Author

valzi commented Feb 19, 2022

Thanks for that effort!

I've been trying to find alsactl from od and failing. How can I install it myself?

@neilswann80
Copy link
Collaborator

neilswann80 commented Feb 20, 2022

@valzi it's easier if you have a Linux PC... or make yourself a Ubuntu Live USB and boot your computer from that. You can also do it via ssh from Windows and Linux (but that's trickier to explain)

Grab my versions of S91alsaSettings and alsactl from:
https://github.com/neilswann80/DinguxAlsaMixerSave/releases/tag/alamixer

First, you need to put the script on the primary (internal) card:
Place the card in a usb reader connected to linux
Two partitions should get mounted, we want the larger 2GB ish one
Copy S91alsaSettings to /media/data/local/etc
right click on the etc folder and choose open in terminal
then type:
sudo mv ./S91alsaSettings ./init.d
(if it prompts for a password on a linux live usb it should be blank)

Then on the secondary (games) card:
create a folder called ALSA and place alsactl in it.

That should be it! But like I said, if you want AlsaMixer settings to be saved properly, after making changes in AM, press select to exit, then immediately press start and restart/shutdown the device. If you use the D-pad at any point between setting volumes in AM and the restart/shutdown it changes the AM volume level.

@neilswann80
Copy link
Collaborator

neilswann80 commented Feb 26, 2022

Actually, it probably is easier direct from Windows via ssh. Remove your device's password first... see here

Connect your computer to your gaming device via the USB/DC port

On your Windows PC open the directory containing S91alsaSettings and press Shift whilst right-clicking on an area of free space within the directory and choose Open PowerShell window here

then type: scp S91alsaSettings [email protected]:/media/data/local/etc

then type: ssh [email protected]

then type: sudo mv /media/data/local/etc/S91alsaSettings /media/data/local/etc/init.d/S91alsaSettings

then exit.

Then by whatever method you prefer, create a folder on the secondary (games) card called ALSA and place alsactl in it.

@eduardofilo
Copy link
Owner

Hello to both of you. I've been looking to this and I don't understand what the problem is. The volume level is maintained between reboots via the /media/data/local/etc/volume.state file (the value is recorded on system power down). The value there corresponds to the PCM bar which is the only one that has an effect on the RG280V because of the way the audio hardware is arranged as explained in FAQ number 7.

@neilswann80
Copy link
Collaborator

neilswann80 commented Feb 26, 2022

Lowering the headphone volume via AlsaMixer has the effect (at least on my RG350M) of allowing the volume to be decreased lower than where the default cuts out and I think you also get more individual volume steps/levels. The headphone volume is reset with every reboot. It is useful for some games when trying to find a volume sweet spot free of distortion that would otherwise lie between the standard volume steps.

This feature may be pretty niche... I find it useful, but not sure whether it's worth incorporating in the overall image (so I didn't submit a PR).

@eduardofilo
Copy link
Owner

OK, so this problem only applies to RG350. Anyway, as mentioned in the FAQ, there is also the option to attenuate the sound in RetroArch (in case you use that emulator, of course). I will leave the issue open in case the scripts you mentioned are incorporated in the future.
Thanks.

@valzi
Copy link
Author

valzi commented Feb 26, 2022

This problem is also present for every rg280v user.

@valzi
Copy link
Author

valzi commented Feb 26, 2022

Actually, it probably is easier direct from Windows via ssh. Remove your device's password first... see here

Connect your computer to your gaming device via the USB/DC port

On your Windows PC open the directory containing S91alsaSettings and press Shift whilst right-clicking on an area of free space within the directory and choose Open PowerShell window here

then type: scp S91alsaSettings [email protected]:/media/data/local/etc

then type: ssh [email protected]

then type: sudo mv /media/data/local/etc/S91alsaSettings /media/data/local/etc/init.d/S91alsaSettings

then exit.

Then by whatever method you prefer, create a folder on the secondary (games) card called ALSA and place alsactl in it.

I'll try this, thanks!

@eduardofilo
Copy link
Owner

This problem is also present for every rg280v user.

That is what I do not understand. On my RG280V the volume level is retained between restarts. Please check if at least the content of the /media/data/local/etc/volume.state file is modified between restarts.

  1. Read file content.
  2. Change volume through volume controls (better while a game is playing sound to get feedback).
  3. Restart.
  4. Read file content again and compare.

@hbi2k
Copy link

hbi2k commented Jul 29, 2022

Had a similar problem on an RG300X. Volume was very low, could raise it in Alsamixer, but the change would not persist between restarts.

Solved the problem by flashing the internal SD card with a fresh install of Version 2.1 (upgrade from 2.0). Saves and favorites were stored on the external SD card and were recognized by the new install.

Thinking about it, I realized that I had switched the old 2.0 install between my RG300X and RG280V a couple times using the little select_kernel.bat file. I'm wondering if maybe something went screwy in the transition from 300X to 280V and back again, and that's what caused the problem.

@eduardofilo
Copy link
Owner

@hbi2k I don't think so, or it shouldn't. The only alsamixer channel that recovers its value between restarts is PCM, which corresponds to the value in the /media/data/local/etc/volume.state file. Depending on the console model, more or less channels are involved in the final global volume. I don't have a 300X, only an RG280V and an RG350M, so I can't really analyse your situation. In any case, if you are interested in restoring any of the other channels, you will have to set up a script as described by @Sakitoshi here: #263 (comment)

In future versions of the image, I will probably incorporate this script to restore the channels involved (a new one has also been added in the latest versions of ODbeta).

@Sakitoshi
Copy link

@eduardofilo hey, i've tried other firmwares and rogue handles sound in a much better way than stock opendingux, so i built my own opendingux and patched it up to do the same.
i'll explain in spanish for better understanding.

compilé la ultima version de opendingux beta y agregué un /etc/asound.conf para crear un nuevo control maestro (llamado Master), de esta forma PCM que tiene un rango limitado puede quedar a 0dB y no importa si Mixer existe o no.
el nuevo control Master no esta limitado por el hardware, así que cambia el volumen sin saltos entre paso y paso.
agregué un parámetro extra a /etc/init.d/S91pwswd.sh (-m Master) para que los botones de volumen manejen Master en lugar de PCM.
modifiqué /etc/init.d/S90volume.sh para que no ajuste el volumen de Mixer (por defecto queda en 100%) y que guarde el volumen de Master en lugar de PCM.
agregué /etc/init.d/S40alsa-hack.sh para que toque un wav sin sonido (/usr/share/bootsound/dummy.wav), alsa solo agrega controles nuevos al mixer al usarlos, esto lo soluciona.
solo tengo la RG300X, así que la verdad no se como se comportara en las demás consolas, pero en teoría debería funcionar.
aca te dejo el opk de update para que lo pruebes, también van incluidos todos los archivos mencionados.
https://drive.google.com/file/d/1pNqANhW2KKb42QF-6yDVS8no5UOZXTPD/view?usp=sharing
DSC_0467

otro arreglo que he estado usando es crear una partición fat32 que usa todo el espacio no usado por el sistema y un script (/media/data/local/etc/init.d/S06_loadroms.sh) que la monta como la micro sd de juegos. así no tengo necesidad de usar una segunda micro sd, bastante útil porque con una tarjeta de16gb quedan casi 12gb libres que son suficientes para todos los juegos que quiero.

#!/bin/sh

case "$1" in
    start)
        printf "Loading roms partition"
        if [ ! -d /media/sdcard ] && mount|grep -q /dev/mmcblk0p3
        then
        mount -o remount,rw /media
        umount /media/mmcblk0p3
        rmdir /media/mmcblk0p3
        mkdir -p /media/sdcard
        mount /dev/mmcblk0p3 -o rw,uid=1000,gid=100 /media/sdcard
        mount -o remount,ro /media
        echo "done"
        fi
        ;;
    stop)
        # Nothing to do
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac

se puede engañar al sistema de forma más sencilla creando una partición exfat y nombrarla sdcard. esto no sirve con fat32 porque la etiqueta siempre queda en mayúsculas y el punto de montaje también, cuando el sistema lo quiere en minúsculas.

@zealvix
Copy link

zealvix commented Nov 15, 2022

Not related to the current state of the Adam image (v2.1) , but I tried updating to newer OpenDingux beta build (> Sep 22 2022) to get the performance improvement (mentioned in https://github.com/OpenDingux/buildroot/actions/runs/3101426374) on a RG300X, but in SoundMixer the volume now appeared to be affected by a new column "Mixer" which always self revert to a value of "31" after a reboot/shutdown which is too soft.

Hope its something that can be looked into for future potential versions of Adam Image.

@eduardofilo
Copy link
Owner

eduardofilo commented Dec 9, 2022

In english:
Very interesting all what you say @Sakitoshi, but I made a commitment with the authors not to modify the ODbeta base system, which could be considered a fork, as well as a maintenance nightmare form me to make updates, given the little time and energy I have to dedicate to this (anyone wants my job?). Besides, as you say, each machine behaves differently and I don't have all of them to test. I prefer as I say that the base project leads the way in this kind of things. Adam is intended to be a snapshot of an installation done with standard parts to prevent other people who are not as knowledgeable from replicating the process of installing/configuring everything to have a moderately useful emulation machine. People like you can set it up on their own and even something like Adam with his compromise solutions may limit them too much. But I thank you for the effort of designing a solution and sharing it. It remains here and others will surely be able to take advantage of it. Thank you very much indeed.

En español:
Muy interesante todo lo que comentas @Sakitoshi, pero me comprometí con los autores a no modificar el sistema base ODbeta, lo que podría ser considerado un fork, además de una pesadilla de mantenimiento para hacer actualizaciones, dado el poco tiempo y ánimos que tengo para dedicarle a esto (¿alguien quiere mi trabajo?). Además de que como comentas cada máquina se comporta de manera diferente y no las tengo todas para probar. Prefiero (y necesito como digo) como digo que el proyecto base marque el camino en este tipo de cosas. Adán pretende ser una instantánea de una instalación hecha con piezas estándar para evitar que otras personas que no tienen tanto conocimiento repliquen el proceso de instalar/configurar todo para tener una máquina de emulación medianamente útil. Personas como tú pueden montárselo por su cuenta e incluso algo como Adán con sus soluciones de compromiso, pueden limitarles demasiado. Pero te agradezco el esfuerzo de haber diseñado una solución y compartirla. Aquí queda y otros seguramente la podrán aprovechar. Gracias, de verdad.

@eduardofilo
Copy link
Owner

Not related to the current state of the Adam image (v2.1) , but I tried updating to newer OpenDingux beta build (> Sep 22 2022) to get the performance improvement (mentioned in https://github.com/OpenDingux/buildroot/actions/runs/3101426374) on a RG300X, but in SoundMixer the volume now appeared to be affected by a new column "Mixer" which always self revert to a value of "31" after a reboot/shutdown which is too soft.

Hope its something that can be looked into for future potential versions of Adam Image.

I want to upgrade Adam to the latest ODbeta version, specifically the one that was compiled two days ago, now that I'm going to have some time. I hope that the tests I can do on a RG280V and RG350 are representative enough for the rest of the machines.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants