Hi,
I have installed a fresh Raspbian on my Pi with the HifiBerry Digi+ card. I followed this instruction: https://www.hifiberry.com/guides/updating-the-linux-kernel/
sudo apt-get install rpi-update
sudo rpi-update
I think the card is recognised:
root@raspberrypi:~# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: sndrpihifiberry [snd_rpi_hifiberry_digi], Gerät 0: HifiBerry Digi HiFi wm8804-spdif-0 []
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
In Kodi I can select "ALSA: Default (snd_pri_hifiberry_digi Analog)", but I cant change the passthrough to the HifiBerry soundcard - it is greyed out to "PI: HDMI". When I installed Openelec on the Pi, I could select "ALSA: Default (snd_pri_hifiberry_digi S/Pdif)".
I would like to use passthrough, because my decoder can handle AC3 and DTS.
root@raspberrypi:~# dmesg | grep snd
[ 4.765601] snd-hifiberry-digi sound: ASoC: CPU DAI (null) not registered
[ 4.795982] snd-hifiberry-digi sound: snd_soc_register_card() failed: -517
[ 4.810270] platform sound: Driver snd-hifiberry-digi requests probe deferral
[ 4.845403] snd-hifiberry-digi sound: wm8804-spdif <-> 3f203000.i2s mapping ok
root@raspberrypi:~# cat /etc/asound.conf
###STARTDEFAULT
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
###ENDDEFAULT
root@raspberrypi:~# cat /boot/config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
dtparam=i2c1=on
dtoverlay=hifiberry-digi
gpu_mem=256
Date
Votes
10 comments
-
HiFiBerry team What distribution are you using? As far as I know a patch is needed in Kodi. This is included in OpenElec already.
Best regards
Daniel -
Pascal Weißhaupt I am using Raspbian. I downloaded it here: https://www.raspberrypi.org/downloads/
Where can I get this patch?
Debian Wheezy
Release date:2015-02-16
Default login:pi / raspberry
Kernel version:3.18
root@raspberrypi:~# uname -a
Linux raspberrypi 3.18.12-v7+ #782 SMP PREEMPT Tue Apr 28 19:54:13 BST 2015 armv7l GNU/Linux -
Pascal Weißhaupt Hi again,
I think I found it in the forums: https://www.hifiberry.com/forums/topic/arch-linuxkodi-with-hifiberry-digi-and-audio-passthrough/
I will try this later and give a response. -
HiFiBerry team Is there a specific reason you're not using OSMC or OpenElec? These are usually easier to setup than Kodi on Raspbian.
Best regards
Daniel -
Pascal Weißhaupt Yes, because I want to do more with the Pi than Kodi. OpenElec is too stripped down, so i can not use "apt-get" or so.
But i got it!
You need to download the source of kodi, patch the file xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp and compile it on your own. I used this tutorial to download the Kodi source and compile/configure it: http://not-guild.de/temp/kodi.txt
This is the patch. Use this patch before you configure or compile anything (after git clone git://github.com/xbmc/xbmc.git)
From 7c3357d9c9c6456e35927814af7d54cd4b11bff9 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 8 Mar 2014 15:36:06 +0000
Subject: [PATCH 04/56] [hifiberry] Hack: force it to be recognised as IEC958
capable to enable passthrough options
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index e22db7a..0120bd5 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -1342,6 +1342,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev
if (snd_card_get_name(cardNr, &cardName) == 0)
info.m_displayName = cardName;
+ // hack: hifiberry digi doesn't correctly report as iec958 device. Needs fixing in kernel driver
+ if (info.m_displayName == "snd_rpi_hifiberry_digi")
+ info.m_deviceType = AE_DEVTYPE_IEC958;
+
if (info.m_deviceType == AE_DEVTYPE_HDMI && info.m_displayName.size() > 5 &&
info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI")
{
Source: https://github.com/OpenELEC/OpenELEC.tv/blob/master/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch; https://github.com/OpenELEC/OpenELEC.tv/tree/master/projects/RPi/patches/kodi
Patch it via "patch < kodi-001-isengard-rpb-backports" and give the path to the AESinkALSA.cpp -
Al_ Al_ @Pascal: thanks for your post. I am in the same situation (using kodi on raspbian with HiFiBerry Digi+ on a RPi B+) and very grateful that you reported back the solution you identified.
Patching is easy. But when I continue to follow the instructions that you refer to (http://not-guild.de/temp/kodi.txt), I get a blocking config error after the ./configure command:CFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" CXXFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" LDFLAGS="-L/opt/vc/lib" FFMPEG_OPTS="--cpu=cortex-a7" ./configure --disable-gl --enable-gles --with-platform=raspberry-pi --disable-x11 --disable-vaapi --disable-vdpau --disable-avahi --enable-libcec --disable-pulse --disable-projectm --disable-optical-drive --disable-dvdcss --disable-vtbdecoder --enable-alsa --enable-player=omxplayer
The error is "cannot run C compiled programs". Then asking whether I meant to cross-compile; which I do not as I work directly on the RPi. Did you get this error, too? How did you overcome it? -
Pascal Weißhaupt Uhm no - I was by myself very suprised, that everything goes well...I did not get any error.
Did you run it as root? Did you ./configure in the correct directory? -
Pascal Weißhaupt Ah and I used the official master branch, kodi 15 alpha:
### now decide which source code of kodi we download to compile
## 1) official master branch, atm kodi 15 alpha
git clone git://github.com/xbmc/xbmc.git
and not
## alternatives are:
# 2) this is Kodi 15 alpha with newest raspberry pi (2) fixes from popcornmix, which is also used for openelec testbuilds, BUT need special libcec AND kodi sould be build with dependencies!
git clone -b newclock4 https://github.com/popcornmix/xbmc.git
## 3) latest stable kodi 14 'helix', sadly the exit bug is still present TODO pullrequest for that fix?
# git clone -b Helix git://github.com/xbmc/xbmc.git -
Al_ Al_ Thanks for your reply. I ended up manually modifying the file 'configure' to remove the ultimate cross-compiling check and simply replacing by "cross_compiling=no". Below the original and then my version (of course, the line numbers will differ depending on the system).*** 5656,5676 ****
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
! { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \$ac_pwd':" >&5
! $as_echo "$as_me: error: in \$ac_pwd':" >&2;}
! as_fn_error $? "cannot run C compiled programs.
! If you meant to cross compile, use \
--host'.
! See \config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }--- 5656,5672 ----
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
! cross_compiling=no
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; } -
Al_ Al_ Additionally, independent of this first issue, I had to
- hardcode the cec server and client versions in PeripheralCecAdapter.cpp
- increase my swap file to prevent a linker (LD) error
Then it compiled and linked until TexturePacker should run, which ended with an illegal instruction error.
At that point I gave up for the moment, and installed kodi from the raspbian repository (that will likely only have stereo sound). And now (so far unsuccessfully) I try to contact kodi with an android or an iOS remote control to the running kodi-standalone version. The issue seems that I would need to enable the JSON server on http in the GUI, but as my raspberry is headless, I do not manage to do this.
So far for my frustration ... I will go back to compiling kodi with surround sound support once I have the stock version running properly.
Please sign in to leave a comment.