Raspberry Pi and HDMI Sample Rates

Get help for Volumio here!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

Raspberry Pi and HDMI Sample Rates

Postby Tristan » Mon Feb 16 2015 21:12

Hi,

I recently purchaced a "Volumio supported GPIO header solution (I2S) DAC" for my new Raspberry Pi2 because my AV Receiver was only picking up 48kHz on higher sample rate files via HDMI. After some testing and fiddling around I have come to the conclusion that the sound was far superior (clearer with no noise) through HDMI (ALSA) to my AV Receiver. Even my self-proclaimed tone-deaf wife came through to the lounge and commented that is was better before. Obviously now I am thinking of going back to HDMI, but I still have the same problem 48 kHz ceiling problem????

After some research I found that the Raspberry Pi supports HDMI v1.3a which as far as I believe supports up to 192kHz. I then thought maybe it is the software (Volumio, driver or something) and then found this https://github.com/raspberrypi/linux/issues/494 which states the ALSA driver to be limited to 48kHz, so I assume this is my problem?

My research therefore brings me to the obvious questions; Is the limitation of ALSA true? If so, are there any plans for Volumio to support a higher sample rate through ASLA/HDMI?

Cheers,
Tristan
Random avatar
Tristan
Sunday DIYer
Sunday DIYer
 
Posts: 20
Joined: Mon Jan 26 2015 14:16

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


Raspberry Pi and HDMI Sample Rates

Postby Tristan » Sun Feb 22 2015 09:56

So after some research it seems ALSA may be downsampling to 48kHz. Does anyone have any idea how to output anything above 48khz?

Code: Select all
root@volumio:~# tvservice -a
     PCM supported: Max channels: 2, Max samplerate: 192kHz, Max samplesize 24 bits.
     AC3 supported: Max channels: 6, Max samplerate:  48kHz, Max rate  640 kb/s.
     DTS supported: Max channels: 6, Max samplerate:  48kHz, Max rate 1536 kb/s.


Thanks,
Tris
Random avatar
Tristan
Sunday DIYer
Sunday DIYer
 
Posts: 20
Joined: Mon Jan 26 2015 14:16


Raspberry Pi and HDMI Sample Rates

Postby envagyok » Thu Mar 26 2015 13:03

Hy,

I have this problem too...
My raspberry pi i use hearing music over hdmi output to receiver. With openelec my pi can output 88,96,192khz 2 channel flac, and multichannel 96khz 5.1 flac with the equal sample rate displayed at av receiver.
When i install volumio, everything played at 48khz, and multichannel flac has strong distortions.
What can make to use volumio the correct sample rate output to play lossless this musics?

Another problem:
With 100% volume music is distorted.. I maked reserch , and hear some info volumio hdmi output is amplified +4db.
So manually set the volume to 96, or at ssh turning off the 4db amplifiing ( all of above make a same result volume go to 96) stop the distortion, but how can this make default settings at boot up?
Random avatar
envagyok
Fresh off the boat
Fresh off the boat
 
Posts: 6
Joined: Thu Mar 26 2015 12:46


Raspberry Pi and HDMI Sample Rates

Postby Tristan » Fri Mar 27 2015 21:26

Hi,
I am still having the problem. I have not tried anything else, but thanks for the confirmation. Many have said that it is a limitation on the PI but I guess your testing proves otherwise? I thought the clock was unable to produce bit perfect sound over hdmi at 192khz. I solved my distortion by disabling volume control in Volumio and now using my AV Receiver or it.
Random avatar
Tristan
Sunday DIYer
Sunday DIYer
 
Posts: 20
Joined: Mon Jan 26 2015 14:16


Raspberry Pi and HDMI Sample Rates

Postby envagyok » Thu Apr 02 2015 04:39

Thanks,
Disabling the volume control solve my distortion problem.
Only 2 things I missed :
Playback at 88,96,192khz via hdmi :)

Handling cue files (this is partially solved when used mpdroid)
Random avatar
envagyok
Fresh off the boat
Fresh off the boat
 
Posts: 6
Joined: Thu Mar 26 2015 12:46


Raspberry Pi and HDMI Sample Rates

Postby Stephane » Thu Apr 02 2015 07:10

Hi,

I made a custom kernel with a patch to push the limits to 192kHz. I tried it yesterday on a Pi1 with a semi-success: I could see the rate changing to 192kHz on my but sound was very because it was 24bits and the patch I made could not handle it.
Resampling the file to 16bits did the job but I did not have enough time to further test the system, I will do it on my Pi2B when I'll receive the SD cards.
So in a near future I will provide all the files needed to update the kernel, stay tuned!
Random avatar
Stephane
Audiophile
Audiophile
 
Posts: 120
Joined: Fri Mar 13 2015 20:20


Raspberry Pi and HDMI Sample Rates

Postby icai » Thu Apr 02 2015 15:11

+1

Stephane wrote:Hi,

I made a custom kernel with a patch to push the limits to 192kHz. I tried it yesterday on a Pi1 with a semi-success: I could see the rate changing to 192kHz on my but sound was very because it was 24bits and the patch I made could not handle it.
Resampling the file to 16bits did the job but I did not have enough time to further test the system, I will do it on my Pi2B when I'll receive the SD cards.
So in a near future I will provide all the files needed to update the kernel, stay tuned!
Random avatar
icai
Sunday DIYer
Sunday DIYer
 
Posts: 42
Joined: Wed Dec 18 2013 02:09


Raspberry Pi and HDMI Sample Rates

Postby Stephane » Sat Apr 04 2015 08:34

Hi,

I finally found the time to test the new patched kernel on my Pi 2 B and it works, I could get 192/24 files played without any problem. I even tried to play a 5.1 file but only two channels are decoded (files can be found here: http://www.2l.no/hires).
The status on my Denon AVR1911 displays correctly the bitrate, tested with a 44.1, 96 and 192kHz file.
While listening to a 44.1kHz stream (SomaFM) I could hear distortion, it was due to the +4dB amplification that Alsa do when the volume is full. Changed it with alsamixer (volume set to 86) and distortion is gone.

So here are the files to put on your system for both versions of Pi (1 and 2). There are two compressed tarball files, modules-SA.tgz and boot-SA.tgz, to be extracted in /. Please make a backup of /boot in case you want to come back to the stock Volumio kernel. My kernels are named kernel7-SA.img and kernel-SA.img, you will need to edit the /boot/config.txt and add the line «kernel=kernel-SA.img» (Pi1) or«kernel=kernel7-SA.img» (Pi2) . All other options remain the same.

boot-SA.tgz: http://ovh.to/GndmzkA
modules-SA.tgz: http://ovh.to/YEgWS5b (download links are active for 30 days)

So, to summarize:
* make yourself God (or at least su -)
* do a backup of the /boot directory (*.bin, *.img, *.elf, *.dat, *.dtb, overlays/)
* remove the old files
* copy the tarball files in /run/shm
* cd / ; tar xvzf /run/shm/modules-SA.tgz
* cd / ; tar xvzf /run/shm/boot-SA.tgz
* edit /boot/config.txt
* reboot
* test a 192kHZ 24 bits file
* enjoy
* report any success or failure

If this patched kernel is working on others systems, I will make a self-extracting archive that will simplify the update process (download it, run it, it will do the backup, test if it's a Pi1 or Pi2 and change the config.txt).

Edit: the tarball files now contains both versions for Pi1 and Pi2
Last edited by Stephane on Tue Apr 07 2015 12:52, edited 1 time in total.
Random avatar
Stephane
Audiophile
Audiophile
 
Posts: 120
Joined: Fri Mar 13 2015 20:20


Raspberry Pi and HDMI Sample Rates

Postby PatrickB » Sat Apr 04 2015 15:27

If you can tell the Volumio team exactly which patches/changes you have done to the kernel, they can decide if they can put those in the Volumio kernel of an upcoming version. Then it will work by default :D
Raspberry PI B+ with Hifiberry Digi+ (Audio-GD DAC) and NAD A/V receiver with Dali speakers.
Also working on a Pi 3A+ connected over USB to in-car DSP
User avatar
PatrickB
Objectivist
Objectivist
 
Posts: 359
Joined: Thu Jan 01 2015 20:52
Location: The Netherlands


Raspberry Pi and HDMI Sample Rates

Postby Stephane » Sat Apr 04 2015 16:08

The kernel is from Cirrus Logic, it includes the driver for the Wolfson cards (https://github.com/CirrusLogic/rpi-linux.git). I took this one because the version matches the latest realtime patches ( https://www.kernel.org/pub/linux/kernel ... 5.patch.gz). The RT patches applies without any warning or error.
Then I changed some lines in the sound/arm/bcm2835-pcm.c file (http://www.raspberrypi.org/forums/viewt ... 1&p=486574) to push the 48kHz limit and support 32 bits coding: (around line 25)
Code: Select all
        .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
        .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
        .rate_min = 8000,
        .rate_max = 192000,


That's it.
Random avatar
Stephane
Audiophile
Audiophile
 
Posts: 120
Joined: Fri Mar 13 2015 20:20

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest