Sound driver on Raspi 4

Matt Flax flatmax at flatmax.org
Sun Sep 27 16:56:20 EDT 2020


On 27/9/20 10:05 pm, Stefan Wahren wrote:
> Hi,
>
> Am 25.09.20 um 17:37 schrieb Axel Braun:
>> Hello Stefan,
>>
>> Am Freitag, 25. September 2020, 14:13:12 CEST schrieben Sie:
>>> Am 25.09.20 um 09:39 schrieb Axel Braun:
>>>> Hi,
>>>>
>>>> I was trying to get sound out of a Raspi 4 using openSUSE Tumbleweed
>>>> (currently 5.8.x kernel), but no driver could be determined that worked.
>>> since this is a mainline kernel list, we cannot give information about
>>> specific distributions.
>> Sure.
>> The focus was more on the latest kernel than on TW.
>>
>>>> Can anyone advise me about the correct driver, and when this hits the
>>>> standard kernel?
>>> AFAIK mainline kernel won't have audio support for RPi 4 until Linux
>>> 5.10. The HDMI audio support has been merged in linux-next recently.
>>>
>>> bcm2835-audio (VCHIQ audio) for the jack isn't supported yet and i don't
>>> have any information who is working on this.
>> By chance, do you know if the jack output works in Raspian?
> i assume you mean Raspbian / Raspberry Pi OS incl. the Raspberry Pi
> kernel (vendor kernel).
>
> I would be surprised, if it doesn't work.


To enable the standard onboard jack, the boot/config.txt file needs a 
little modification to add "dtparam=audio=on". There are various options 
for modifying the effect.

Here is some history of the board sound driver :

The file sound/soc/bcm/bcm2835-i2s.c does most of the I2S register 
configurations.

The driver has gone through a few different iterations, starting with a 
dedicated 2 channels setup. You see, the audio handling silicon on the 
Pi is reasonably flexible allowing left and right audio words to be 
shifted within a large bit block (range).

At one point the number of allowed audio channels was increased from 2 
to 8 - this allowed pseudo multichannel operation, where there are 
examples of software channel alignment to overcome the lack of a TDM 
bus. Some users report very stable operation in multichannel mode when 
the audio bus is started at boot time and perpetually on (i.e. using 
jackd to manage the audio fabric in user space).

TDM flexibility was later introduced to allow the I2S bus to lock to a 
TDM bus, shifting the locations of audio words w.r.t. to hardware frame 
clock edge. This shift strangled some modes of operation which broke 
lower sample rates (e.g. 8 kHz and 16 kHz) for certain audio codecs.

That is about where we stand today at the Kernel driver level.

For machine driver configuration, simple sound card setups require only 
a device tree overlay, such as the Audio Injector Ultra simple card 
overlay :

https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/boot/dts/overlays/audioinjector-ultra-overlay.dts

While a large number of soundcards use the combination of an overlay and 
a machine driver in C, such as the Audio Injector Isolated soundcard :

https://github.com/raspberrypi/linux/blob/rpi-5.4.y/arch/arm/boot/dts/overlays/audioinjector-isolated-soundcard-overlay.dts

https://github.com/raspberrypi/linux/blob/rpi-5.4.y/sound/soc/bcm/audioinjector-isolated-soundcard.c

Matt


>
>> Thanks
>> Axel
>>
>>
>>
>> _______________________________________________
>> linux-rpi-kernel mailing list
>> linux-rpi-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
> _______________________________________________
> linux-rpi-kernel mailing list
> linux-rpi-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel



More information about the linux-rpi-kernel mailing list