Posts by 5schatten

    Of course the "Advanced Linux Sound Architecture" itself is not useless but the basic functionality it provides without additional mixing plugins or a soundserver that uses the ALSA API. But in the end this discussion is splitting hairs since you always need a more advanced setup once you use more than one source at a single time & if ALSA would suit all needs nobody would develope PulseAudio or PipeWire or whatever comes next.

    Once you "touch" the audio stream I guess it's always resampled in one way or another. The standard volume is way to loud which was the reason why I added a slider to reduce it in the first place. ALSA resampling works faster because it offers only a simple linear resampler but I have no clue if it still is the only sampler it uses.

    Have you tried to run PA with resample-method = trivial Looks like most of the resamplers work quite well so maybe we should give speex-float-1 a try and build PA with speex support?

    Prioritize all you want, that doesn't make ALSA useless is all I'm saying. In fact it's very powerful by itself and certainly a better choice for low power systems.

    As I said for my usecase a pure ALSA audio device is useless. ALSA is fine as long you just have to satisfy basic needs without mixing. Also on many systems PA manages autodetection of the available devices & and sets them up the without the need of any terminal magic so personally I prefer it. My RPi3B and my S905X based devices seem to handle PA also fine but maybe I'm not "audiophile" enough to hear a difference or see any performance regressions. /shrug

    And if Kupo91 wants to play with dmix nobody will stop him to do so. ;)

    Being too lazy to research how to use it properly does not equal being useless ;)

    HDMI is a digital signal so it's only logical that volume control doesn't work (ever try adjusting the volume on your TV when connected to a soundbar with optical?). What Pulseaudio does is resampling the audio stream before passing it along, so in that way increasing the volume is possible. You could do the same thing with ALSA as well by using dmix/softvol. As for PCSX2, if you wanted to use Pulseaudio you could just configure your container properly so that it would use it. You can have sound in video previews at the same time as you have sound in the menus as well, there is nothing that requires Pulseaudio.

    And how do you think Pulseaudio talks to your sound card? ALSA :)

    Well I'm aware of those ALSA plugins & I know that basically Kodi and PA just resamples the given audio stream and in- or decreases the volume this way. AFAIK the master volume just controls the onboard amplifier and sets the output voltage for analog outputs.

    But to be honest I had other priorities. Maybe some would call it lazy but I was to busy to overhaul the docker scripts & images to make sure you always get a defined tagged version of the container and I was also busy to fix PCSX2 for at least most Nvidia users by figuring out what's wrong with the driver. So yes you might have to take your remote and lower the volume but at least you can run ps2 games. ;)

    If someone isn't pleased by using one of three frontends that all feature theming, assets or video previews then c'est la vie. Feel free to use any third party stuff and I help to fix some bugs if I can but I'm not motivated to reconfigure the ALSA stuff while a fully functional PulseAudio backend is available which even the average user can configure in a Kodi addon without having to deal with a terminal or other cli stuff. But as I said priorities /shrug

    In the end you can either use this build which basically runs ootb after some minor adjustments or you craft a custom solution. Pick your p0ison :P

    Build RR-20190423-716b9f8 | is mostly online | C2 uploading

    • updated copyright & license in package files
    • added basic Rockchip project for RockPro64 RK3399 -> WIP
    • updated to latest LE 9.x
    • updated to Kodi 18.2
    • updated Generic kernel to 5.0.9 | RPi kernel to 5.0.8
    • updated Mesa to 19.0.2
    • updated Vulkan to v1.1.106
    • updated dav1d to 0.2.2 & fixed multi threaded SW AV1 decoding
    • updated Gstreamer to 1.16.0 | added gst-omx for RPi -> WIP
    • updated FluidSynth to 2.0.5
    • added Kodi announcement when a frontend & Spotify is started
    • fixed ALSA volume for analog audio -> restores 100% after exiting frontends
    • added recording options to Retroarch -> you have to delete your retroarch.cfg before you update, start, exit & start RA again if you use PulseAudio
    • splitted libretro cores & coreinfo into separate packages -> clean up & satisfies my ocd ;)
    • added lr-nSide SNES emulator based on higan v106r25 to Generic builds
    • updated (lr-)ppsspp to v1.8.0-dev for Generic | reverted v1.7.5 for all other projects due speed issues
    • updated GLideN64 to 4.0 for Generic | fixed build for RPi but still WIP
    • updated DOSBox to 0.74-2 | r4156
    • updated several libretro-cores
    • updated citra & dolphin

    You could try to insert "amixer set Master 25% unmute" at some point of the script that launches the game... But I don't know if there's a "close script" where you can insert the same code to roll back alsa master volume to 100%.

    Hope this gives you the start point for your solution.

    This could work if he uses analog audio too, but at least on my systems the master volume did not change the volume of my HDMI audio output.

    So something like amixer -q set Master,0 75% unmute in front of the dolphin start command could work.

    In the past I used alsa as audio backend because I didnt manage to run pulseaudio. Now I gave it another try because this volume difference between dolphin and the rest annoys me too and just noticed that everything I had to do was unchecking "Use module-udev-detect to autodetect PulseAudio device". So the sound is working now and also decreasing the volume in the rr config tool works fine.

    However only with Emulationstation 5schatten you maybe remember that Im using a different script in Rom Collection Browser and I dont get it working with pulse. Currently I have no sound in dolphin if I start it via RCB. Can you please take a look and tell me what I have to change? Is it even possible to use pulse on this setup because I dont freeze kodi and I use alsa in kodi?

    I just tried to change =alsa to =pulseaudio but that doesnt work.

    In short? No. As long as Kodi is running the ALSA device is locked and PulseAudio can't create the sink. So unless Libreelec itself won't rework the whole audio subsystem to use PulseAudio this is not an option.

    Aw, okay. I misunderstood... I thought you were using pulseaudio even in kodi for digital output.

    So, if you're using alsa in kodi like me, the only difference is analog or digital output? With digital audio your scripts work fine but with analog don't?

    I'll wait for your fix now that it's identified. Thanks a lot for your work.

    I guess they use PA because it's able to detect & configure bt devices on the fly. In the past PA had some issues and so they did not fully made the step to use PA for everything.
    My workstation has some analog speakers attached but it's a while since I used it. Maybe the sound output changes there too but I guess only a small minority don't uses a digital audio system ://shrug

    Sure. I agree to select pulseaudio as backend. So, maybe the code is not working for all the folks using analog outputs.

    I would select pulse audio in kodi too, but it's not selectable for me :( I only have bluetooth audio output for pulseaudio section in kodi audio devices.

    Because it's not needed. PulseAudio is only used for BT audio because basically Kodi works fine with ALSA.

    with kodifreeze the volume drop to 44% and stays there after unfreeze (pulseaudio as backend). With alsa backend it stays always at 100% (that's the reason why we use pulse as backend: the emulators volume is too high)

    Another way could be to provide a volume selector for alsa backend in rr config, as you developed for pulse backend. In this way with both backends everyone can set a backend volume.

    Thank you again

    ALSA is basically useless & only needed for some special snowflake software like PCSX2. My TV uses HDMI and changing the ALSA Master volume does not even effect the audio output so it does not make sense to add any functions for this backend while PA normally works fine & is mandatory for video previews for example.

    Analog. Thank you.

    I'll try the tests.

    Answering your "pulse audio changes alsa volume" I suggest to read the link I posted, it writes about it.

    does amixer set Master 100% unmute restore the volume for you? If yes I'll add it to the script

    EDIT:

    Do you know how to create and run a Linux script?

    so log into a terminal then run nano test.sh copy & paste the content, then run chmod +x test.sh and finally ./test.sh

    Bash
    #!/bin/sh
    # SPDX-License-Identifier: GPL-2.0
    # Copyright (C) 2018-present 5schatten (https://github.com/5schatten)
    
    if [ ! $(amixer get Master | awk '$0~/%/{print $4}' | tr -d '[]%') = "100" ]; then
      amixer -q set Master,0 100% unmute
      echo "Restoring ALSA Master volume to 100%"
    fi

    If this works I can add this straight to the script and this should fix this problem.

    Well let's continue to find what's the root cause. When you run kodifreeze.sh freeze in a terminal it should stop Kodi also. Can you check if the ALSA volume changes too? (kodifreeze.sh unfreeze starts Kodi)
    1 time with PA backend & 1 time with ALSA backend?

    Depending on the backend setting it should give a different result.
    LibreELEC.tv/kodifreeze.sh at libreelec-9.x-rr · 5schatten/LibreELEC.tv · GitHub

    If for whatever reason the PulseAudio changes ALSA volume I could probably hardcode it too 100% back too though I have no clue how it touches the device.

    Which audio output do you use? HDMI or some analog?

    Can you provide some lines of code to add to your original code to debug? I'm not familiar with python, but I think if I can add some lines to print out some results to a text file for every if statement of the code you linked in the previous post, maybe we can point out where the code is not working as we expect.

    As a workaround maybe I can add a line of code that doesn't use RR variables to set the volume back to 100% when exiting from emu frontend.

    Thank you

    Again I don't change the ALSA volume so my scripts don't touch this. Does you volume only change if you run ES or change also if you run RA or Pegasus because all three are completely different.

    What you can do is to reboot your system, enter systemctl stop kodi and check again with amixer or alsamixer if the volume has changed. Also grab this image LibreELEC Testbuilds for x86_64 (Kodi 18.0) and check if a recent LE master build shows a somewhat similar behavior -> if you made a clean install of my build you can switch between them on the fly.

    The main question is under which circumstances the ALSA volume changes because my scripts don't touch it. You use this device? AOpen Digital Engine DE67-HA ab € 0 (2019) | heise online Preisvergleich / Deutschland

    settings.xml is created if I change something else in the plugin, such as the kms setting. the problem is not the settings.xml cannot be created, it is that whatever runs to create asound.conf on boot or from the plugin when you select a device from the addon does not seem to run.

    You tried a clean install with the latest img.gz and it still does not list the audio devices in the addon? If so please enable the debug log, reboot, run the addon, try to select something upload the kodi.log & the log zip.

    When I asked you to manually enter the audio device into the settings.xml you said it's not created so if you run the addon now it still don't show a list when you try to select the audio device? Because underlaying script should leave some traces if it fails.

    No different. Can you give any more detail on your setup? Device, bios/efi boot, install, the steps you take to create the asound.conf file.

    grab 2 usb drives, download the img.gz, download Installation of LibreELEC [LibreELEC.wiki] then burn it to one drive, boot a system from the usb-drive, I used my old x220 notebook, installed the image from one usb-drive to the other usb-drive, rebooted & started the usb-drive with the clean install,used the wizard to setup basic stuff & set the audio device in the addon, reboot once and done.

    Started RA & ES & ran MrBoom -> listened to annoying music & as I said it works here. The problem is that according to your logs the rr-config-tool wasn't started or did not run properly so it won't create the settings.xml and so later no proper asound.conf will be created.