What do I need to do to make it work? I see only ALSA HDMI and PULSE BT devices installed...
If the USB audio interface is supported by Linux, it will appear as a new output device on LE's audio settings. Just select it.
What do I need to do to make it work? I see only ALSA HDMI and PULSE BT devices installed...
If the USB audio interface is supported by Linux, it will appear as a new output device on LE's audio settings. Just select it.
Hello everyone,
I have installed LibreELEC 10.0.2 on RPi 3 B+.
I have a problem with the choice of the sound emission, I'll explain better.
1.
First I enable the following parameter in config.txt:
This is to be able to use the 3.5 Audio Jack
2.
I created autostart.sh where I run the following command on startup::
3.
With a script I set the device connected via Bluetooth as the Audio source and everything works fine
import os, subprocess, xbmc, re
#Esegui il comando shell sottostante. Questo assegna il dispositivo bluetooth come fonte predefinita per Kodi
os.system("pactl set-default-source `pactl list short sources | grep -i blue | awk {'print $2 '}`")
#Assegna l'output del comando shell a BT_NAME (nome Bluetooth)
BT_NAME = subprocess.check_output("pactl list sources | grep -i bluetooth.protocol -A 1 | awk 'FNR==2{print $3}'", shell=True)
patron = r'"(.*?)"'
BT_NAME = BT_NAME.decode('utf-8')
BT_NAME = re.compile(patron).findall(BT_NAME)[0]
#Se la variabile non e vuota, crea una finestra di dialogo KODI che mostri il nome del dispositivo bluetooth
if BT_NAME:
xbmc.executebuiltin("Notification(Bluetooth,Activated %s,3000)" % BT_NAME) #Assicurati che questa riga sia rientrata
os.system("pactl unload-module module-loopback")
os.system("pactl load-module module-loopback latency_msec=1000") #Latenza 1 sec
else:
#Se la variabile e vuota, crea una finestra di dialogo KODI che mostra nessun dispositivo bluetooth trovato:
xbmc.executebuiltin("Notification(Bluetooth,No Blutooth Device Found,3000)") #Assicurati che questa riga sia rientrata
Display More
4.
I have created a script to set which "sound card" to play the sound on but this is where I encounter the problem.
Any setting I set (HDMI or Analog) however always comes out in Jack 3.5
# Valori amixer: "0"= Auto, "1"= Jack Audio, "2"=HDMI
# Importo le librerie
import os, re, subprocess, xbmc
from subprocess import check_output
# Eseguo comando e Verifico stato del numid
output = subprocess.check_output("amixer cget numid=3", shell=True)
# Regex per catturare lo stato di numid
patron = r'values.([0-9])'
output_string = output.decode('utf-8')
matches = re.compile(patron).findall(output_string)[0]
# Azioni
if matches == "0":
action = os.system("amixer cset numid=3 1"), xbmc.executebuiltin("Notification(Uscita musica Bluetooth,Analogico,3000)") # Se uscita risulta Auto imposta su Jack
if matches == "1":
action = os.system("amixer cset numid=3 2"), xbmc.executebuiltin("Notification(Uscita musica Bluetooth,HDMI,3000)") # Se uscita risulta Jack imposta su HDMI
if matches == "2":
action = os.system("amixer cset numid=3 1"), xbmc.executebuiltin("Notification(Uscita musica Bluetooth,Analogico,3000)") # Se uscita risulta HDMI imposta su jack
Display More
In the Kodi settings I see the following Audio tabs:
- ALSA: bcm2835 Headphones, bcm2835 Headphones
- PULSE: Default, Bluetooth Audio (PULSEAUDIO)
- PULSE: Built-in Audio Digital Stereo (HDMI), HDMI / Display Port (PULSEAUDIO)
If you select "ALSA: bcm2835 Headphones, bcm2835 Headphones" I hear audio only from Jack 3.5
If I select "PULSE: Built-in Audio Digital Stereo (HDMI), HDMI / Display Port (PULSEAUDIO)" I hear the music in Jack 3.5 and the effects of the Kodi Gui on HDMI.
This whole system in LibreELEC 9.2.8 version worked perfectly.
You can help me?
Thank you
I Have solved, i have use this commands,
For Use HDMI:
For Use Jack Audio:
Than i have made this script:
# Importo le librerie
import os, xbmc, xbmcgui
# Definizioni variabili
_list = ['Analogico', 'HDMI']
_heading = 'Selezione Output Audio'
# Comando di selezione
select = xbmcgui.Dialog().select(_heading,_list)
# Selezioni
if select == 0:
action = os.system("pactl set-default-sink alsa_output.1.stereo-fallback"), xbmc.executebuiltin("Notification(Uscita musica Bluetooth,Automatico,3000)")
elif select == 1:
action = os.system("pactl set-default-sink alsa_output.0.hdmi-stereo"), xbmc.executebuiltin("Notification(Uscita musica Bluetooth,Analogico,3000)")
Display More
And I linked this script with a button in my keyboard enabled in keymap
I fail to see the logic of a default installation of an audio player application having the audio output disabled.
Do you not understand it's an AUDIO PLAYER!?!?!?!?
This is about the dumbest programming setting I have ever encountered in my entire life!
Reading through this thread, I do not understand at all what is supposed to be made of this information to manually re-enable the audio output. Again - for an AUDIO OUTPUT PLAYER!!!!!
Could someone please for the love of god fix this stupidity, so I can actually listen to the audio that is being played on my audio player?
JonnyGators For most users it's an A/V player, so they get audio over HDMI. Developers will not fix it, because that's another audio stream, just for a very small amount of people. USB DAC's are pretty cheap, and have much better quality, compared to the internal RPi DAC. Some Bluetooth audio dongles also work on RPi4, see here.
Sorry for not providing a plug-and-play solution. It is what it is.
I just want to get sound out of an audio player. This is ridiculous that no one can fix this glaring bug that renders the whole thing unuseable!
It's not a bug, it's intended. Digital devices can be detected at runtime, and driver only loads when needed. Analog jacks don't do that trick, so they have to be always-on, or always-off. Developers could set it always-on, but they don't want to for technical reasons.
When using two separate streams for A/V, then those streams will run out-of-sync. As mentioned, most users play A/V, not just music. So it would be a problem for the majority.
You're minority, because you want to listen to music in poor quality. That's why you have to activate that software switch. OK?
For those looking for useful instructions - allow me to demonstrate how to actually answer a question.
The enabling of the audio output on the 3.5mm audio jack can be done by doing the following:
Open an ssh session into the pi, signing in as root and the root password set when setting up the pi (I use putty in windows to do this)
enter:
mount -o remount,rw /flash
This sets it so you can edit the config file.
to edit the config file, use the command:
nano /flash/config.txt
edit the file by adding in the line
dtparam=audio=on
Exit out of nano by pressing ctrl-x, when prompted to save type Y
To set things back into read only mode, use the command
mount -o remount,ro /flash
Restart the pi - this can be done from the ssh session with the command of:
reboot
Once Kodi restarts, you need to change the audio output to the now available option of the 3.5 output.
(That this only enables the option to easily set it as an audio output, rather than actually enable it, makes it that much stupid that the option isn't there by default. To intentionally add a barrier to an option that end users may want to easily select is the exact opposite of what programmers should be doing!)
go into settings - system - audio
highlight Audio output device
highlight/select ALSA;bcm2835 Headphones bcm2835 Headphones.
With that output now selected, you should now hear audio coming out of the jack, and can now judge for yourself whether or not this is an adequate option for your purposes, rather than some developer trying to make the decision for you.
...
dtparam=audio=on
...
You, sir, are a scholar and a gentleman. Thank you.
One note, though, is that the file in my fresh 12.0.1 install has the following lines:
# uncomment to enable analog audio output
#dtparam=audio=on
#audio_pwm_mode=1
I will have to figure out the audio_pwm_mode effect. Probably by digging in the ALSA or PulseAudio docs, but maybe by experimenting.