[SOLVED] Hifi Shield 2 problem

Hi
Firstly to introduce myself,
Hello all

I recently bought a C2 and a Hifi shield 2 with the intention of music playback through Volumio .
All was good it saw my dac correctly if I remember listed it as odroiddac2. I could also select hardware mixer.
After some music listening I was highly impressed, I rebooted and nothing no dac. Well it was listed but no output it was fine through the optical but no RCA output after numerous reinstalls and switching to Ubuntu mate the problem persisted.
I called the supplier, got an RMA number and shipped it off.

I received it back today and all is working, except it now lists it as odroiddac which I believe is the Hifi shield plus. Also no hardware mixer.
aplay -l lists it as odroid dac pcm5102
I think it should list odroid dac 2 pcm512x
So I installed Ubuntu mate and followed the install instructions for installing hifi shield 2 but nothing is listed except HDMI audio I cannot see the Dac at all.
In volumio odroid dac log it says it couldn’t find pcm5242 and loading default pcm5102
I am no Linux guru and have googled till my fingers bleed but can see nothing to point me in the right direction as to why my dac thinks its something else.
BTW it is definitely a Hifi shield 2 not a Hifi shield plus
I have reinstalled volumio 3 times with no change I also found an image of Runeaudio for the C2 and tried that with the same results. Not listed at all in Ubuntu mate
The dac works fine in Volumio it just lists it as the older version of the Hifi shield. Which would lead me to believe that it has the wrong drivers/firmware installed and not working at its best.

Any help would be greatly appreciated
Thanks in advance

Edit
I now have it working in Ubuntu mate I followed the instructions for a hifi shield plus and it loads up in aplay -l

Last login: Sat Jan 28 11:51:53 2017 from 192.168.1.10
odroid@odroid64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
odroid@odroid64:~$ sudo modprobe snd-soc-pcm5102
[sudo] password for odroid:
odroid@odroid64:~$ sudo modprobe snd-soc-odroid-dac
odroid@odroid64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: ODROIDDAC [ODROID-DAC], device 0: I2S pcm5102-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0
odroid@odroid64:~$ su
Password:
root@odroid64:/home/odroid# echo “snd-soc-pcm5102” >> /etc/modules
root@odroid64:/home/odroid# echo “snd-soc-odroid-dac” >> /etc/modules
root@odroid64:/home/odroid# exit
exit
odroid@odroid64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: ODROIDDAC [ODROID-DAC], device 0: I2S pcm5102-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
odroid@odroid64:~$

But as said it is definetly a Hifi Shield 2
hardkernel.com/main/_Files/p … 082474.jpg

Hi,
I’m not a guru either but have all known HiFi Shields and a few Odroids.
As you describe it, the software does not think it is a Shield 2.
I wrote the DAC detection service you see in your volumio log, it is probing the DAC for its I2C capabilities.
If this does not work, the service assumes it is a PCM5102 DAC (Shield or Shield+).
Does the print on the shield say it is a HiFi Shield 2?
Edit: Your attempt with ubunutu mate were for the pcm5102 dac, you should use the pcm5142 instructions from the wiki
We’ll find it, don’t worry…

– Gé –

Hi and thank you for the quick response
I tried with the pcm5242 (Hifi shield 2) instructions from the wiki before I tried anything else, I also tried the script they refer you to at the bottom of the wiki, nothing happens when I tried.
aplay -l just lists HDMI audio
As in it didn’t see the dac.
When I run the instructions for the pcm5102 (Hifi Shield plus) it installs perfectly and plays back audio.
It is definitely a Hifi shield 2 it is printed on the board and doesn’t have the 2 big caps also no headphones jack just RCA and optical.
For some reason it thinks it is a Hifi shield plus

thanks

Could it be an older kernel not recognizing the DAC, the kernel you use must be one from October or later.
Which version of Volumio and/or Ubuntu are you using. Could you do a cat /proc/version
– Gé –

Volumio Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
volumio@volumio:~$ cat /proc/version
Linux version 3.14.79 (odroidc2@VolumioOS) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #3 SMP PREEMPT Sat Oct 15 16:15:17 CEST 2016
volumio@volumio:~$

Should be ok, to make sure, do cat /etc/os-release ls -l /lib/modules/3.14.79/kernel/sound/soc/aml/m8

volumio@volumio:~$ cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 8 (jessie)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“8”
VERSION=“8 (jessie)”
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“http://www.raspbian.org/RaspbianForums
BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs

VOLUMIO_VARIANT=“volumio”
VOLUMIO_TEST=“FALSE”
VOLUMIO_BUILD_DATE=“Sat Nov 19 16:54:21 CET 2016”

VOLUMIO_VERSION=“2.030”
VOLUMIO_HARDWARE=“odroidc2”

volumio@volumio:~$ ls -l /lib/modules/3.14.79/kernel/sound/soc/aml/m8
total 19
-rw-r–r-- 1 4294967294 4294967294 10666 Oct 15 14:16 snd-soc-odroid-dac.ko
-rw-r–r-- 1 4294967294 4294967294 8478 Oct 15 14:16 snd-soc-odroid-dac2.ko

Looks the way it should, can you try cat /var/log/odroiddac.log after a fresh start?

Starting Odroid DAC Detection
Remove the default
Try if PCM5242 loads
It did not, remove the mdules
Default to HiFi Shield (PCM5102)
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: ODROIDDAC [ODROID-DAC], device 0: I2S pcm5102-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

that’s after a restart
did you want that after a fresh install?

No, that would not make any difference.
But it is clear now that it could not load the driver for the pcm5242.
Presuming you don’t have another faulty DAC, you would need to do the following and see if you get an error somewhere
It will not have recognized the Hifi Shield, it just loads pcm5102 driver modules when a Shield 2 modprobe fails.
Could you use "sudo nano /opt/odroiddac.sh " to make a small change?
Add

set -x

just after the first line with "#!/bin/sh so it looks like this

[code]#!/bin/sh
set -x
echo “Starting Odroid DAC Detection” > /var/log/odroiddac.log
echo “Remove the default” >> /var/log/odroiddac.log
modprobe -r snd_soc_odroid_dac
modprobe -r snd_soc_pcm5102
echo “Try if PCM5242 loads” >> /var/log/odroiddac.log
modprobe aml_i2c
modprobe snd_soc_pcm512x
modprobe snd_soc_pcm512x_i2c
echo pcm5242 0x4c > /sys/class/i2c-adapter/i2c-1/new_device
modprobe snd_soc_odroid_dac2

DAC=$(aplay -l | grep ODROIDDAC2)

if [ -z “$DAC” ];then
echo “It did not, remove the mdules” >> /var/log/odroiddac.log
modprobe -r snd-soc-odroid-dac2
echo 0x4c > /sys/class/i2c-adapter/i2c-1/delete_device
modprobe -r snd_soc_pcm512x_i2c
modprobe -r snd_soc_pcm512x
modprobe -r aml_i2c

modprobe snd_soc_pcm5102
modprobe snd_soc_odroid_dac
echo “Default to HiFi Shield (PCM5102)” >> /var/log/odroiddac.log
else
amixer -c 1 sset Analogue 0
amixer -c 1 sset Digital 102
amixer -c 1 sset Deemphasis on
echo “Found HiFi Shield 2 (PCM5142)” >> /var/log/odroiddac.log
fi
aplay -l >> /var/log/odroiddac.log
[/code]

Then you should be able to run the script manually and see what it does

sudo /opt/odroiddac.sh

Please show us the output.

volumio@volumio:~$ sudo nano /opt/odroiddac.sh
[sudo] password for volumio:
volumio@volumio:~$ sudo /opt/odroiddas.sh
sudo: /opt/odroiddas.sh: command not found
volumio@volumio:~$ sudo /opt/odroiddac.sh

  • echo Starting Odroid DAC Detection
  • echo Remove the default
  • modprobe -r snd_soc_odroid_dac
  • modprobe -r snd_soc_pcm5102
  • echo Try if PCM5242 loads
  • modprobe aml_i2c
  • modprobe snd_soc_pcm512x
  • modprobe snd_soc_pcm512x_i2c
  • echo pcm5242 0x4c
  • modprobe snd_soc_odroid_dac2
  • aplay -l
  • grep ODROIDDAC2
  • DAC=
  • [ -z ]
  • echo It did not, remove the mdules
  • modprobe -r snd-soc-odroid-dac2
  • echo 0x4c
  • modprobe -r snd_soc_pcm512x_i2c
  • modprobe -r snd_soc_pcm512x
  • modprobe -r aml_i2c
  • modprobe snd_soc_pcm5102
  • modprobe snd_soc_odroid_dac
  • echo Default to HiFi Shield (PCM5102)
  • aplay -l
    volumio@volumio:~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: ODROIDDAC [ODROID-DAC], device 0: I2S pcm5102-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    volumio@volumio:~$

I think you may be right in that I have another faulty DAC.
oh well back on the phone to lilliput see what mo says.
I don’t suppose it could have the wrong firmware as it works fine just not as a a hifi shield 2 so i’m assuming its a software issue in the board as in volumio, rune and Ubuntu it has the same issue.
I think I may ask for a refund as it seems more hassle than it is worth although sound was very good.
I have just ordered the piano 2.1 and kali.
a shame as I would have liked to get it going (don’t like giving up)

thank you very much for your time and patience I will let you know the outcome of my phone call to Lilliput

thanks

Just out of curiosity, how are going to connect the kali, make an adapter for odroid’s i2s?
– Gé –

I have a RPI2 that I will use for that.
I run the RPI2powered with a 20000 mah battery with a phat dac great sound better than the hifi shield sound wise at less than 1/3 the price (more reliable it seems too)
I did modify the dac a little though took the 2 caps off near the headphone output bass is tighter and highs a little higher basically less muffled. I run it through a denon x2200 amp through analogue rca. sounds very very good for an av amp to be fair.
also run mpd on a dedicated core at 600mhz -6 undervolt to reduce cpu noise.
admittedly I do run it in Runeaudio as I mod the kernel a little and couldn’t find any instructions on volumio to do these mods I would assume they are basically the same OS.
I will run volumio with the new dac and clock as support is much better

the odroid is just for fun really thought I’d try it out with a dac but feel a little underwhelmed by the whole fiasco.

once again thanks for your time

I have a Question regarding the Hifi shield 2. Is Volumio supposed to activate a DSP profile for it’s 5142 chip? (as in the Allo Piano 2.1, which utilized the 5242)

If there is no DSP program for the HiFishiled2’s 5142 chip then I cannot think what difference it would make what DAC Volumio thinks it is sending data to. Volumio should send the same I2S data/clock regardless of what DAC chip is receiving it, similar to SPDIF over Toslink, there are no drivers…

Correct me if i am wrong…

No, Hardkernel did not develop any DSP programs the way Allo did, other then the ones considered standard
‘FIR interpolation with de-emphasis’
‘Low latency IIR with de-emphasis’
‘High attenuation with de-emphasis’
‘Fixed process flow’
‘Ringing-less low latency FIR’
Volumio does not offer any interface to select these (also valid for the similar ones from the Piano), you must use alsamixer or amixer to set them.

Volumio is not sendig any data to the DAC, Volumio only talks to alsa.

You asked for it :wink:
Apart from what Volumio or Alsa does, you are corrrect. As long as you don’t need the extras, the sound quality IS going to be just as perfect.
But you might be missing the point here. The poster payed for a HiFi Shield 2 and his Odroid has a problem with it.
If I were him, I would ask for a working one or my money back.

– Gé –

Not sure if I should start a new thread or I can continue in this one. Also having a problem with the hifi shield 2 on my C2.

First problem was that I could clearly hear the ethernet on the analog out but I solved that by using the dedicated power supply. It only occurred when connecting it to the power only connection of a usb3 hub. I use that in the room where I do the debugging. So maybe interesting to know for others.

Main problem now is the volume in volumio. Both volumio-2.030-2016-11-19-odroidc2 and volumio-2.062-2017-02-03-odroidc2 have this problem.
Both versions detect the shield correctly, gives ODROID-DAC2 as option. All modules seem to be loaded… In the official HK ubuntu distro volume is ok after setting up the shield 2 according to the wiki. Main difference I could see is that Ubuntu uses a newer kernel, I remember it ends in 105 so I guess it’s 3.14.105 but it could also be 3.14.79-105, not sure.

Anybody an idea how to fix this?
I tried changing mixer settings etc but no luck.

Changing mixer settings to digital did work this time, almost fell of my chair. Volume higher than 30 / 35 will distort and give too high volume.
So mixer set to analog gives insanely low volume and set to digital gives insanely high volume. Any idea about sane defaults?

I am reading up on DACs and volume control settings/methods to setup my shield 2 and I came across you DAC detector settings.
I wonder why you set Digital to 102 compared to 201 set by HK? I am trying to find the best setting for analog RCA output to an integrated amplifier. Main volume control will be the amplifier but an occasional volume change through the web ui would be nice.

Yes, dac volume is a known issue, I need to limit this in the driver according to a suggestion from HK. It’s on my list, I know what to do, just have not had the time yet because of other priorities.
Will be seen to soon, HK knows…
– Gé –

Nice! in the mean time it is always nice to learn more on DAC’s
I see the problem now. Maximum digital value for the hifi shield 2 DAC is 40, which is 0dB. You set it on detection to -7.5dB but the gui can change this too easy to 100 for example which is +24dB. You don’t want that coming out your RCA.
I set the maximum in the gui to 30 combined with natural. Startup value is 30 and only use it for occasional lowering of volume. Have to learn some more on alsa. I am using oss4 on my desktop, it’s a bit different. With oss4 (vmix enabled and disabled) master volume / gain is 0dB when set to 100 (or 255). Do not see a way to go above that.

The suggestion from hardkernel with a volume max (digital) set in the driver does not seem to have any effect.
I’ll get back to them.