I am running osmc VERSION_ID=“2019.07-1” on a raspberry Pi 3 B+ which is connected via HDMI with a Panasonic Viera tx-p42u10e TV. The audio output jack of the raspberry pi is connected to an amplifier which I would like to set to a default volume and control the volume using osmc/kodi. The problem is that I cannot control the volume via the Panasonic remote control. However, it is possible to control osmc via the Panasonic remote control but the volume control buttons up/down are not working. When I press these buttons on the remote, the volume change is displayed on the TV and nothing happens to the volume in osmc/kodi. To control the volume while watching TV, I have to use a mobile app, for example yatse.
Using the command cec-client displays most of the important buttons when I press them on the remote except for the volume buttons.
As far as I understood the manual of the TV it should be possible to control the volume if the “Speaker Selection” in the “VIERA Link Menu” (accessed via the “VIERA Link” button on the remote) is set to “Home Cinema”. However, when I try to select this option I only get two popup warnings on the TV:
Starting up … Please wait.
Please check settings and connections on HDMI device
If I check this option (“Speaker Selection”) again, it is set back to “TV”.
I guess my Panasonic TV does not recognise the Raspberry Pi as a valid VIERA Link device? Does anyone know how I can get the volume buttons working on the Panasonic remote control?
By the way to hear even anything over the amplifier, I had to set hdmi_ignore_edid_audio=1. I tried two HDMI cables but got the same result. However, I am not sure if the cables could be an issue. If so, can someone please suggest cables that should support audio control (if this even exists)?
I also installed keymap from the Addons menu but because the buttons are not recognised by cec-client keymap did not work either.
CEC volume control works on TV’s and audio amplifiers, not playback devices. You really don’t want to use that analog output on a Pi anyway. Does your amplifier not have a remote and an optical S/PDIF such that you could just pull the audio from the TV and control the volume at the amplifier as would normally be done?
Thank for your suggestions @darwindesign. I know that I cannot control the amplifier directly this way and only by setting the volume in osmc/kodi (via another app). However, I am also running raspotify over the audio output jack of the Raspberry Pi. As far as I understand, I would’ve to turn on the TV to listen to spotify in case I would pull the audio from the TV. Or am I missing something?
Regarding, S/PDIF I have never used this connection but my amplifier has a TOSLINK connector which should work I guess? Using this setting, I am also not sure if it’s possible to switch between tv stations on the tv with the remote from the amplifier?
The TOSLINK is Toshiba’s brand name for optical S/PDIF. It is what would normally be used if you cannot directly connect an hdmi device to an amplifier. The Pi plugged into your TV would transfer the audio over the hdmi and then your TV would convert that to optical and send it along to your amplifier. Your TV would need to be on for this. Alternatively you could purchase a hifiberry to go direct from the pi to the amplifier, or you could use a hdmi switcher with an optical output to get you to where you can get direct to the amplifier without having to have the TV on.
As far as controlling the volume on the amplifier with CEC that does not have anything to do with the PI. You would need working CEC between your AVR and TV. Would I be correct in assuming your amplifier does not have hdmi? This situation is were you would normaly use a universal remote that has the volume buttons mapped to the amplifier instead of the TV.
Thanks for your help and the links. I have a few questions to your suggestions:
How would I connect the Pi to the Hifiberry? Over the GPIO pins or again using the audio output of the Pi, I guess not because the audio would suffer again? And I guess, the problem with the volume buttons not working would still exist, except if the TV would recognize the Raspberry Pi + the Hifiberry as valid VIERA Link device. If not, I would still need the solution with the S/PDIF cable, which is unfortunately not acceptable if I have to turn on the TV to listen to spotify
This solution sounds interesting with my current amplifier (older Naim uniti) which has no HDMI as you guessed correctly. Could you please suggest an hdmi switcher with optical output that could possible work? And how would I set this up?
You are right. My plan was to just set the volume of the amplifier to something fixed and control the volume over osmc/kodi or the spotify app. As far as I got it, this controls the volume of the Pi audio jack. This is the solution that I am currently using. Not ideal but it works as long as I have my smartphone with me. However, it would be more convenient if the volume buttons on the Panasonic remote would be working too.
An even better way is what you suggested and I thought about using too:
The problem is that I don’t know how to set this up with all the devices that I am using and if, for example a Logitch Harmony would work? Or is there a “standard” universal remote that I could use to achieve what I am looking for?
My preferred solution would be still to get the TV (VIERA Link) working together with the Pi over HDMI. This way I don’t have to buy other Hardware.
They make a unit that plugs into the gpio and ads S/PDIF to the Pi. This does not provide for a volume control solution. It is a fixed output just like any normal piece of Hifi equipment. The audio over gpio does not suffer as it is all digital. If you are concerned with audio quality then the analog output on the Pi is the absolute worse thing you could use, and combining that with the volume control makes it even worse. With the volume in Kodi it is only LPCM and it is lowering the volume in the actual audio stream so the lower the volume the higher the noise floor and less the dynamic range.
I don’t have a recommend, and have never personally used one, but you should be able to find them pretty easy on Amazon or similar just by searching “hdmi s/pdif”. It just pulls the audio out from the hdmi and converts it. The way you would hook it up is source hdmi to switch/converter (depending on what you buy) then from there you send hdmi to TV and S/PDIF to your amplifier.
With more modern equipment with working CEC you can have a decent experience getting one device to control another. When your trying to integrate new school with old school your going to have some compromises.
The harmonies are fairly straightforward to setup as long as your not trying to do anything too crazy with them. For your setup you would just go into the app and tell it exactly what equipment you have, how you have it plugged in, and it walks you through setting up the relevant activities. They can be tweaked to the point where you can literally just push “Music” or “TV” and remote pushes all the buttons for you to start your activity and then switches the button to control the devices appropriate for what your doing. It may seem complicated on first blush but I have set them up for a number of elderly people with no knowledge of how any of this works and they “just worked” for them without it being confusing.
The Pi is able to be controlled just fine with CEC. CEC support with older equipment is very hit and miss though and if it is not working that is your TV’s fault, not the Pi. A lot of the early CEC “compatible” devices would only work with certain equipment or with limited functions. If you go for the universal remote route then you can use a FLIC or any cheap USB receiver that supports MCE RC6 to control the Pi.
Thanks again for your suggestions @darwindesign. I think I will buy a HifiBerry HAT and go with a universal remote, probably Harmony, together with a FLIRC USB receiver.
The only thing I am not really certain about is which HifiBerry HAT I should choose.
I am indecisive between the digital HiFiBerry Digi+ Pro and the analog HiFiBerry DAC+ Pro. Is the digital output preferred over the analog output? In my case it would make no difference regarding the amplifier because it supports both, also a coaxial (RCA) digital input. Which one would you suggest? I am tending to the digital version because the Vero seems to have one as well.
The answer kinds of spans the gamut between opinion and preference with lots of confusion to be had the more you research the topic. Basically if your AVR has a good DAC then you would probably want to just connect it digitally. The reasons for this would be to get your analog circuits away from the electrically noisier Pi, and add the ability to transfer multichannel bitstream (if your amp is surround sound). This option also allows for adding an external D/A converter if you wanted to in the future.
Analog would be the way to go if you lacked digital input on your amplifier or the D/A converter in your AVR sucked . Buying the device that has both options seems like a waste of money to me.
Regarding the optical vs. coax S/PDIF which is better thing, that would be coax, unless you have a ground loop problem, but you likely would never be able to tell the difference with your ears between the two. They are the same signal wise, but the light bouncing around in the optical cable can cause jitter, but has the advantage of being electrically isolated.