I installed OpenELEC on my RaspberryPi. Connected with TV with HDMI cable audio is OK and works. I plugged some speakers to mini jack and I have no sound. How can I enable audio via minijack (I've already enabled it in OpenELEC settings)?
[OpenELEC] audio via mini jack
Try this: #!/bin/bash # # The value(s) (last line) for PCM playback 0=auto, 1=analog, 2=hdmi # # amixer cget numid=3 # numid=3,iface=MIXER,name='PCM Playback Route' # ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0 # : values=0 # # script toggles output from auto to speaker # or sets absoutely if $1 is 0, 1 or 2 # if [ ! -z "$1" ] then if [ "$1" = "auto" ] then amixer cset numid=3 0 echo "Output set to auto." elif [ "$1" = "0" -o "$1" = "1" -o "$1" = "2" ] then amixer cset numid=3 $1 case $1 in 0) echo "Output set to auto." ;; 1) echo "Output set to analog." ;; 2) echo "Output set to hdmi." ;; esac else echo "To set: value must be 0, 1 or 2." echo "No parameter to toggle 0/1." fi exit fi # if [ $(amixer cget numid=3 | tail -n1 | cut -d= -f2) -eq 0 ] then amixer cset numid=3 1 echo "Output set to analog." else amixer cset numid=3 0 echo "Output set to auto." fi #
Thx, I'll try. Should it be executed automatically each time OpenELEC is starting?
If you want ONLY mini-jack output, just execute "amixer cset numid=3 1" at startup.
The bash script can be executed anytime from command prompt.
amixer settings are remembered across reboots, so only need to execute it once. Caveat: /boot/config.txt may also set jack/hdmi output.
Yes. I've heard that one before. Setting it every boot doesn't hurt - and if you've set it to HDMI during uptime, it's reset.
Just for my understanding.
Can you have audio out of both devices or is it either/or?
Cheers
Dave R
AKAIK Either/Or
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required