[RPi] No Audio on 3,5mm Jack

  • 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:

    Code
    dtparam=audio=on

    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::

    Code
    pactl load-module module-udev-detect

    3.

    With a script I set the device connected via Bluetooth as the Audio source and everything works fine

    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

    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

    Edited once, last by napster32 (March 22, 2022 at 1:49 PM).

  • I Have solved, i have use this commands,

    For Use HDMI:

    Code
    pactl set-default-sink alsa_output.0.hdmi-stereo

    For Use Jack Audio:

    Code
    pactl set-default-sink alsa_output.1.stereo-fallback

    Than i have made this script:

    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.

  • 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.