Odroid C2 HiFi Shield, DietPi and HQP NAA

(Latchezar Hristov) #1

I’ve done that (DietPi Jessie -> Stretch on Odroid C2) a few times - works without a glitch and I can install both Roon and HQPlayer.
After dist-upgrade one needs to add the armhf platform as per this page.
dpkg --add-architecture armhf and install networkaudiod and Roon

For me though, this is the end of the good news: the Odroid HiFi Shield 2 simply doesn’t work with HQPlayer - it gets Alsa underruns. The CPU at the time is 2-3% for one of the cores and nothing - for the others.
Roon works a bit better, but the sound disappears completely after 2-3 track changes.
I haven’t yet tested with a USB DAC, will report when I can.

In a nutshell, the upgrade runs fine, but the shield driver is misbehaving.

HQP NAA - Raspberry Pi
(Dan Knight) #2

Try increasing the buffer time (size) in HQplayer to 250ms:

Failing that, also on your Odroid C2, try setting NAA Daemon to a higher priority via realtime FIFO scheduler:
dietpi-process_tool > NAA Daemon

1 Like
(Latchezar Hristov) #3

@Dan_Knight - really appreciate your quick answer.

I know you don’t have Odroid C2 alpha (stretch), so I guess you can count me in for Alpha testing.

1 Like
(Latchezar Hristov) #4

@Dan_Knight, a bit more information.

First, I appreciate your help, but I think you and I are wasting our time. Of course, if you believe it is the distro and not the driver/hardware, I’d love your input:
I did what you suggested - increased the HQPlayer buffer and increased the priority. That helped. The first time.
The track played without glitches (only one ALSA attempting X-run recovery..., while before I had them every second or more frequently). Unfortunately, the up-sampled 96KHz -> 384KHz track played at what I’d suspect is half speed. Clocks issue maybe?

I paused and the next time it was garbled - with multiple ALSA attempting X-run recovery... per second.

Third time around there was no luck at all: NAA was at 100% CPU and I can’t play anything. Killed the process with kill -9, restarted. Same thing: playing twice slower.

Switched to roonbridge. This time I had more luck. It is not upsampled, but at least it works. I hear pops from time to time, but very rarely.

At the same time, I am using a much weaker hardware - BBB + Botic kernel + Hermes + Cronus/Rhea with HQPlayer and it works flawlessly.

It is a shame that such powerful hardware as Odroid C2 can’t be used as expected.

Thank you for your great work, @Dan_Knight!

Lucho

(Dan Knight) #5

Yep, appears to be a current issue, most likely in the C2 kernel. 192KHz seems to be the highest supported, functional output freq at this time.

Switched to roonbridge. This time I had more luck. It is not upsampled, but at least it works. I hear pops from time to time, but very rarely.

Which sound card are you using on the C2? Shield 1/2/+ ? I’ll see if we can replicate and run some tests.

1 Like
(Latchezar Hristov) #6

@Dan_Knight: I am using the HiFi Shield 2 with Odroid C2. Also, Above it I have the UPS module… I wonder if it was ever tested that way :slight_smile:

I swapped the repos to stretch and run dist-upgrade etc. the whole 9 yards.

Also, FYI, yesterday I installed the latest Volumio for C2 and I got a sound, but it was doing similar: there were pops when no signal in one of the channels and I couldn’t get it to work above 10% volume …
I wonder if I just pulled a short stick with the shield and something is wrong with it?

1 Like
(Latchezar Hristov) #7

P.S. Of course, one should not run dietpi-update ( or any dietpi-xxx for that matter) after upgrading to stretch: apt winds up in an unresolvable state (no way to upgrade or downgrade packages anymore) - at least to software developers like me, who are apprentice sysadmins :slight_smile:

That happened to me after upgrading to stretch and then pressing yes without much looking to update x39 to x41 release.

(Dan Knight) #8

Strange, i’ve yet to experience any popping, underruns on my Shield 2.

Some things that might be worth checking:

  • If USB powered, try another PSU. May be causing interference on Shield 2
  • Try removing the UPS, again, may be causing feedback on the Shield 2

Failing that, lets compare your mixer settings, here are mine:

root@DietPi:~# amixer -c 1
Simple mixer control 'DSP Program',0
  Capabilities: enum
  Items: 'FIR interpolation with de-emphasis' 'Low latency IIR with de-emphasis' 'High attenuation with de-emphasis' 'Fixed process flow' 'Ringing-less low latency FIR'
  Item0: 'Low latency IIR with de-emphasis'
Simple mixer control 'Analogue',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 1
  Mono:
  Front Left: Playback 0 [0%] [-6.00dB]
  Front Right: Playback 0 [0%] [-6.00dB]
Simple mixer control 'Analogue Playback Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 1
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Auto Mute',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Auto Mute Mono',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Auto Mute Time Left',0
  Capabilities: enum
  Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
  Item0: '21ms'
Simple mixer control 'Auto Mute Time Right',0
  Capabilities: enum
  Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
  Item0: '21ms'
Simple mixer control 'Clock Missing Period',0
  Capabilities: enum
  Items: '1s' '2s' '3s' '4s' '5s' '6s' '7s' '8s'
  Item0: '1s'
Simple mixer control 'Deemphasis',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: P▒▒▒{&▒> [on]
Simple mixer control 'Digital',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 201 [79%] [-3.00dB] [on]
  Front Right: Playback 201 [79%] [-3.00dB] [on]
Simple mixer control 'Volume Ramp Down Emergency Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Down Emergency Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '4dB/step'
Simple mixer control 'Volume Ramp Down Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Down Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '1dB/step'
Simple mixer control 'Volume Ramp Up Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Up Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '1dB/step'

P.S. Of course, one should not run dietpi-update ( or any dietpi-xxx for that matter) after upgrading to stretch: apt winds up in an unresolvable state (no way to upgrade or downgrade packages anymore) - at least to software developers like me, who are apprentice sysadmins

Our patch system assumes if your running Stretch, its our RPi image. This is the only Stretch image we currently offer.
So yes, avoid updating if your manually switching to Stretch, at least until we can offer an image.
Also, dietpi-backup is a great way to create a system restore point, just incase your brave enough to dietpi-update your Stretch installation :slight_smile:, it offers a way to revert your system.

1 Like
(Latchezar Hristov) #9

@Dan_Knight - I will report tonight when I get home.

I really appreciate your help and seriously count me in for alpha testing :slight_smile: I have BBB 2GB and 4GB, RPI 2 and 3 and ODROID 2.

1 Like
(Dan Knight) #10

Will do, thanks for offering.

We still have a lot to do for the RPi stretch support 1st, as thats our test-bed into Stretch. Once thats improved (fixes here will also take effect on other devices), we’ll look at releasing the Stretch image for C2.

RPi Stretch status: https://github.com/Fourdee/DietPi/issues/475

1 Like
(Latchezar Hristov) #11

@Dan_Knight, I compared our outputs and this is what I got:

luchoh@LatchezsMacBook ~/TEMP> diff mine.txt dan.txt
1c1
< amixer -c 1
---
> root@DietPi:~# amixer -c 1
45c45
<   Mono: Playback [on]
---
>   Mono: P▒▒▒{&▒> [on]

I checked: the only difference is your output which somehow got garbled… so it seems they are identical.

With NAA it’s unlistenable at 192KHz. I didn’t even try at native resolution.

After that, I tried RAAT. Pops at native resolution.

Next, I happen to have an iFi DSD Micro BL. I connected it via USB to the Odroid C2 and RAAT. I hear the occasional pops - same as HIFI Shield 2 via I2S, so I suspect my initial hypothesis was incorrect - it is not the shield, but rather the configuration.

By the way, I used to have the same device, but with Ubuntu Xenial and it worked great with a USB DAC. Unfortunately I can’t figure out where I found this Xenial distro for C2. I’ll look and if I can - I’ll install it again and report.

1 Like
(Dan Knight) #12

I’ll run some tests today and see if I can replicate on my Shield 2.

I checked: the only difference is your output which somehow got garbled… so it seems they are identical.

I love this forum, but it really doesn’t handle code formatting that well lol :slight_smile:

(Andrew Cox) #13

Hi Dan,

Roon Forum uses Discourse, another open source initiative :sunglasses:.

1 Like
(Latchezar Hristov) #14

@Dan_Knight - it’s the shield.

So I switched to USB and still had trouble as you remember. Which is not what my experience was before.

So, there were two more possibilities left: the distro or the hardware.

I installed Xenial/RAAT/NAA. Same problem.

Then I removed the shield. I can play 384KHz and DSD256 without problems now. Higher frequencies are garbled, but most likely due to my transcoding hardware.

Case closed. I’ll re-flash my SD Card to DietPi Stretch and report.

As always - thank you! Your efforts are greatly appreciated!

1 Like
(Dan Knight) #15

Gutted. Does sound like a possible faulty unit.

Before thinking of sending it back for a replacement, last things i’d recommend checking:

  • Shield 2 (odroid-hifishield-2) is selected in dietpi-config > Audio Options > sound card
  • Check for any i2s/c errors in dmesg (Can ignore all entries below 12s as thats boot, look for enties after that, one should appear for each time you start/stop playback)

Unable to test NAA daemon + HQPlayer, trial expired :cry:

#16

Hi Dan,
It does if code tags are use when posting

[code]This is code[/code]

I’ve just updated @Latchezar_Hristov post to include them, and your previous post was updated yesterday.
There both look a lot better now.

1 Like
(Latchezar Hristov) #17

@Dan_Knight, my situation is quite a soap opera…

So, I installed DietPi again, migrated to stretch, gave the NAA Nice of -5, policy of SCHED_FIFO and priority of 64 the pops were still there. With USB DAC and without the HIFI Shield.
I removed the HDMI cable. Same thing.
I removed the UPS.

Gone. Pops are gone.

I can upsample (hardly) to 784KHz and DSD256, though there are interruptions.
DSD128 and PCM384 plays without any glitches.

So I’d say we have an Alpha Debian Stretch DietPi for Odroid C2. Of course, that is as much as NAA/RAAT are concerned. I understand how much work remains to test the rest of the scripts, etc.

Next I will test the HIFI Shield without the UPS and report.

Perhaps we should branch our part of the thread to a separate one - HQP NAA - Odroid C2? Moderators?

(Jussi Laako (Signalyst)) #18

NAA manages it’s own internal thread priorities by itself with different threads running at different priorities on purpose. So no need to adjust anything externally…

Upsampling to 768k PCM is not heavy, much lighter than upsampling to DSD128. So likely this is more like network bandwidth issue or the NAA device running out of steam (you could check with “top”).

1 Like
(Latchezar Hristov) #19

You’re absolutely correct, that was the issue. Working fine directly out of the Mac without network.

I’d agree as the CPU stays below 6-7% at any time.

Thank you @jussi_laako for your input!

(Latchezar Hristov) #20

Quick update for those who use Odroid C2.
I am able to play all rates that my iDSD Micro BL supports: PCM768 and DSD512.

The trick was to install ARMBIAN Ubuntu 16.04.1 LTS 3.14.79-odroidc2 and add armhf architecture.
From time to time I need to reboot the unit as NAA fails with Failed to set scheduling parameters: (1) Operation not permitted and no number of networkaudiod restarts would help.
Other than that, it works fine and I’m quite happy.

1 Like
DietPi: creating a lean-and-mean Roon Bridge