384 kHz/32bit Kernel support

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Janis
Posts: 28
Joined: Sun Oct 30, 2016 9:42 am

384 kHz/32bit Kernel support

Post by Janis » Mon Nov 28, 2016 9:04 pm

Hi,

Is DietPi supporting or planning to support 384 kHz/32bit audio via ALSA?

More and more HiFi DACs are coming out that support 384 kHz/32bit from HW side, but seems only moodeaudio is having kernel compiled to support this audio resultion on Raspberry Pi.

https://www.allo.com/sparky/piano-dac.html

http://www.audiophonics.fr/en/diy-dac/a ... 11500.html

Janis

User avatar
Fourdee
Site Admin
Posts: 2789
Joined: Tue Feb 06, 2007 12:36 pm

Re: 384 kHz/32bit Kernel support

Post by Fourdee » Tue Nov 29, 2016 8:08 pm

Hi Janis,

The limitation with 384khz is at kernel level. The Raspberry Pi kernel only supports 192khz max at this time: https://www.pi-supply.com/product/justboom-dac-hat/
Please note that due to Linux driver restrictions, max frequency is limited to 192kHz on the Raspberry Pi
I did try and implement 384khz myself, but failed to follow the gravy train. I'am not too knowledged with the kernel source code, so, unfortunately, we'd have to wait for RPi devs to make the change.
Another user attempting to push 384khz to kernel source code: https://github.com/raspberrypi/linux/pull/1460

The Odroid's kernel support 384khz, however, we currently experience half playback speed in MPD. This could be an issue with the MPD we compiled, but not sure at the moment. Will need to take another look.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

Janis
Posts: 28
Joined: Sun Oct 30, 2016 9:42 am

Re: 384 kHz/32bit Kernel support

Post by Janis » Wed Nov 30, 2016 12:21 am

THX

FYI, I just downloaded and tested Moode v3.0.
https://sourceforge.net/projects/moodea ... p_redirect

384 kHz/32bit audio, when switched to Linux Kernel - Advanced, works perfect even for basic user setting up the system in web interface.

So, it is possible to achieve it and easy to use.

Have a look - would be great if you could add the same to DietPi!

User avatar
Fourdee
Site Admin
Posts: 2789
Joined: Tue Feb 06, 2007 12:36 pm

Re: 384 kHz/32bit Kernel support

Post by Fourdee » Wed Nov 30, 2016 4:32 pm

Janis wrote:THX

FYI, I just downloaded and tested Moode v3.0.
https://sourceforge.net/projects/moodea ... p_redirect

384 kHz/32bit audio, when switched to Linux Kernel - Advanced, works perfect even for basic user setting up the system in web interface.

So, it is possible to achieve it and easy to use.

Have a look - would be great if you could add the same to DietPi!
I'd be very surprised if 384Khz is actually outputting 384Khz. You can check by playing a some music and listing the ALSA stream values:

Code: Select all

cat /proc/asound/card*/pcm0p/sub0/hw_params
Moode looks impressive, however, its a complete and custom image. So, unless we know every customization/setting made for the Moode image, we cant add it to dietpi-software. Also looks like there is no documentation, or sourcecode for this either: https://github.com/moodeaudio
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

Janis
Posts: 28
Joined: Sun Oct 30, 2016 9:42 am

Re: 384 kHz/32bit Kernel support

Post by Janis » Thu Dec 01, 2016 10:48 am

I don't have 384 files, but I have a lot of 352, and DSD 64, 128, 256 music that are down converted to PCM 352 for playback by Roon.

So, I tested ALSA stream values, and can confirm it really works. I also have Allo Kali reclocker that shows status with LEDs and confirms correct I2S 352 signal being fed to it on HW level.

This is on both 352 and DSD over PCM 352 playback:
[email protected]:~ $ cat /proc/asound/card*/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 352800 (352800/1)
period_size: 7056
buffer_size: 14112

This is on 176 file playback:
[email protected]:~ $ cat /proc/asound/card*/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 176400 (176400/1)
period_size: 3528
buffer_size: 7056

This is on 192 file playback:
[email protected]:~ $ cat /proc/asound/card*/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 3840
buffer_size: 7680

Janis

User avatar
Fourdee
Site Admin
Posts: 2789
Joined: Tue Feb 06, 2007 12:36 pm

Re: 384 kHz/32bit Kernel support

Post by Fourdee » Thu Dec 01, 2016 1:19 pm

Janis wrote:So, I tested ALSA stream values, and can confirm it really works. I also have Allo Kali reclocker that shows status with LEDs and confirms correct I2S 352 signal being fed to it on HW level.


rate: 352800 (352800/1)
Well, i'am surprised :D lol.

I'll download and try moode, now i'am curious :)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

User avatar
Fourdee
Site Admin
Posts: 2789
Joined: Tue Feb 06, 2007 12:36 pm

Re: 384 kHz/32bit Kernel support

Post by Fourdee » Thu Dec 01, 2016 2:21 pm

Janis,

When using the 4.4.30 kernel from moode on DietPi:

Code: Select all

[email protected]:~# cat /proc/asound/card*/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 384000 (384000/1)
period_size: 16384
buffer_size: 65536
Works a charm, full credit to Moode.

I've uploaded their 384khz kernel, you can install it on RPi 2/3 (ARMv6 not supported) with:

Code: Select all

# - Prevent kernel/firmware/bootloader upgrades from Raspbian repo
apt-mark hold raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin

wget http://dietpi.com/downloads/binaries/rpi/rpi2plus-4.4.30_384khz.7z -O package.7z
7z x -aoa package.7z -o/
rm package.7z
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

Janis
Posts: 28
Joined: Sun Oct 30, 2016 9:42 am

Re: 384 kHz/32bit Kernel support

Post by Janis » Thu Dec 01, 2016 8:42 pm

@Fourdee - genial!!!

Just did it also in my DietPi installation. It works.

Roon Community will love you. The super light DietPi now 384/32 and DSD compatible - this is ACHIEVEMENT!
Would be great if you could add this to your next release dietpi-config options. I will already now report this achievement in Roon Community forum for members to start using and testing.

One more thing you could simply fix is the issue of AirPlay and Squeeze coexistence on same RPI.
See a lot of discussion on it in your forum.
http://dietpi.com/phpbb/viewtopic.php?f=11&t=841

I found the key "-C <timeout>" in Squeezelite v1.8 settings that allows to release audio card if not used by Squeezelite.
Squeezelite v1.8, Copyright 2012-2015 Adrian Smith, 2015-2016 Ralph Irving.
Usage: squeezelite [options]
-C <timeout> Close output device when idle after timeout seconds, default is to keep it open while player is 'on'

Unfortunately, the Squeezelite version you have added to DietPi is different and missing this -C key.
However, in the moode I managed to use this key successfully "-C 5" with 5 seconds release, and I had the Room, AirPlay, and Squeezelite all three coexisting & working perfectly on the same RPI.

Please have a look, I hope you can change the Squeezelite to v1.8 also on DietPi?

User avatar
Fourdee
Site Admin
Posts: 2789
Joined: Tue Feb 06, 2007 12:36 pm

Re: 384 kHz/32bit Kernel support

Post by Fourdee » Fri Dec 02, 2016 1:35 pm

Janis wrote:Would be great if you could add this to your next release dietpi-config options. I will already now report this achievement in Roon Community forum for members to start using and testing.
In our next update v138, 384kHz kernel can be installed from dietpi-config > Audio Options
Please have a look, I hope you can change the Squeezelite to v1.8 also on DietPi?
Yep, i'll take a look, git ticket: https://github.com/Fourdee/DietPi/issues/620


EDIT: You may be interested, also coming in v138, CAVA audio vis: http://dietpi.com/phpbb/viewtopic.php?f ... t=80#p3928
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

Janis
Posts: 28
Joined: Sun Oct 30, 2016 9:42 am

Re: 384 kHz/32bit Kernel support

Post by Janis » Fri Dec 02, 2016 9:15 pm

Perfect!

See my post in Roon Community
https://community.roonlabs.com/t/raspbe ... back/16529

Please engage with Allo and Audiophonics teams to get their DACs in DietPi configuration menu.
They are not broadly known HiFiBerry or IQaudIO, but certainly are outperforming these two mass market brands in HiFi quality.

Allo has two amazing DACs:
https://www.allo.com/sparky/piano-dac.html
https://www.allo.com/sparky/piano-dac-2-1.html

Boosted by Allo reclocker:
https://www.allo.com/sparky/kali-reclocker.html

Audiophonics has average performing DAC (better than HiFiBerry DAC+ Pro but worse than both Allo DACs in my hearing):
http://www.audiophonics.fr/en/diy-dac/a ... 10657.html

However, Audiophonics has new promising DSD compatible DAC coming out hopefully Dec 2016 (not yet shipping, as they yet are struggling to finalize firmware):
http://www.audiophonics.fr/en/diy-dac/a ... 11500.html

Janis

Post Reply