Closed PiotrKlimczak closed 3 years ago
Thanks for the interesting post.
I have not really looked into the use of the HDMI port on the Raspberry Pi. I tried it a long time ago and found that it worked, but like yourself, found that the quality was poor.
Regarding ALSA and bit perfection, if you direct your output to an ALSA hardware device (one whose name begins with hw:
) then no transcoding or other manipulations will be applied – the bit stream supplied from your app is provided to the hardware driver. OTOH, if your app outputs to a non-hardware device, (e.g. thedefault
ALSA device), then the bit stream your app provides may be transcoded or mixed before it reaches the real ALSA hardware driver. So, as long as you specify an ALSA hardware interface, the bit stream supplied by Shairport Sync is what the ALSA hardware device driver will see.
Unfortunately we don't really know what then happens when the PI's ALSA HDMI driver gets hold of the bit stream. I do not know what goes on "behind the scenes" in the Pi's HDMI driver, except that I think it is taken care of by an opaque onboard library – the same library that is responsible for driving the onboard DAC, which, as we know, is not great.
Regarding the RPiPlay library – is it possible that it outputs at 48,000 frames per second (fps)? It would be interesting to try something like aplay
and see how is does, both with 44,100 fps material and with 48,000 fps material.
Finally, I have no plans to build an OpenMAX back end. The standard has been around for a long time but is not, AFAIK, widely used. So far, ALSA has been very widely supported and very stable. By and large it has worked very well.
@PiotrKlimczak did you make any progress on this?
I have a setup pretty similar to yours. Even when I set the output device to hw:0,1
I'm still able to change the volume in alsamixer, which shouldn't be possible.
I read somewhere that if you set the gain to exactly 0.00 dB, which for some reason corresponds to a volume level of 96%, the audio stream will bypass the mixer. You can do so with amixer cset numid=1 0
. I can't tell a difference so I don't know if it's true.
I tried playing a DTS-encoded track using omxplayer with the passthrough flag (-p
). In this case the AVR indicated that it was receiving a DTS stream and the volume coming out of the speakers was the same regardless of what i set alsamixer to. This proves that the Pi can play an audio file and pass the raw stream over HDMI.
This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.
First of all, thanks a lot for this great project. I am finding it very stable and feature rich.
Long story short I have Harman/Kardon AVR460- which I really like, paired with Dali Iknon MK2 loudspeakers. I like how it sounds when paired with AppleTV 4K, but as my AVR is now 7 years old, it does not support 4K. Therefore I started looking for streaming sound to AVR only while image to TV only.
For this purpose I am using Raspberry Pi 3B+ which is connected to AVR via HDMI- I don't want to use cheap DAC with PI, but rather use the one in AVR which I really like.
I was reading for few days already about bit perfect sound with HDMI and Shairport-sync and I am still having issues with high frequencies which doesn't sound natural- it is a little difference but noticeable for me. Low frequencies seems to be ok.
My setup
In my PI 3B+ I am using ALSA over HDMI:
Assuming this is the one for bit perfection.
My config:
Shairport cloned yesterday from master, built with: ./configure --sysconfdir=/etc --with-alsa --with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-apple-alac
I was trying also to play with output_rate and output_format but it was only getting things worse. I tried also basic interpolation- no difference. I've set ALSA mixer to 100% and disabled volume control- no difference.
Interestingly I also tried RPiPlay project which uses OpenMax instead of ALSA and sound is as it should be. Unfortunately RPiPlay does not support sound only stream and overall the project itself seems to be in its infancy. The other difference is that because RPiPlay is mirroring only, it is actually using AAC for audio encoding rather than ALAC, but I would not expect this to cause such a difference as stream to AppleTV sounds ok (assuming audio only stream to AppleTV is using ALAC too).
I was reading also about ALSA bit perfection for other projects (linux audio players) and conclusion was that audio player app should "instruct" ALSA to enforce bit perfection- apologies but I am not an expert, so I might be talking bull**.
Therefore three questions:
Please note that I am not using any custom ALSA plugins nor have any ALSA configuration customisations - all standard.