Giter Club home page Giter Club logo

snd-i2s_rpi's People

Contributors

htruong avatar paulanthonycreaser avatar paulcreaser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snd-i2s_rpi's Issues

Volume

Is the volume low because the default data is 32bit whilst the mics are likely creating a 24bit data stream?

static const struct snd_soc_pcm_stream dai_params = {
      .formats = SNDRV_PCM_FMTBIT_S24_LE,
      .rate_min = 8000,
      .rate_max = 48000,
      .channels_min = 2,
      .channels_max = 2,
};

Haven't a clue how you define the format but generally with I2S its 24bit (the mics probably are) but looking at the Pi examples it would seem we have 32bit which is really only a computer mechanism for headroom and register ease.
I pasted the above as a pure guess but somewhere you should be able to define parameters then the source will always be 24 bit and when you resample the level will be equivalent to the original 24bit source as those extra 8 bits of 32bit will just drop the volume without scaling.
They will be the MSBs as well so likely to have much effect on volume as there is no difference with raw 24bit & 32bit data but how its assigned greatly affects volume which prob corresponds to the softvol with 30db gain as that is a lot of gain but does the job.

Does not show the fe203000.i2s mapping ok line in dmesg, doesn't work

I've tried compiling the module manually with kernel-headers installed and "make, make install".

Found out, that there is a small typo in the Makefile (missing "i"):
install: snd-2s_rpi.ko

While it should've been:
install: snd-i2s_rpi.ko

That one was easy to fix, however, after installing it still doesn't work, I don't see the line:
asoc-simple-card asoc-simple-card.0: snd-soc-dummy-dai <-> fe203000.i2s mapping ok

In dmesg and:
arecord -l

doesn't list any devices.

Could somebody please give a hint of what might be wrong or how to further debug?

Willing to update code for raspberry pi 5, help needed

Hi opencardev,
I am willing to put in efforts to update the drivers for rpi 5. I can write in C, though I am not a driver developer, have not done it before. If you could guide me as to what needs to be done, that would be very helpful.

On my Raspberrypi 3b+ I have this problem please help

When I execute this command:
pi@raspberrypi:~ $ sudo modprobe snd-i2s_rpi rpi_platform_generation=0
Just report an error:modprobe:FATAL: Module snd-i2s_rpi not found in directory /lib/modules/5.15.61-v8+

But it does have this under the folder:
drwxr-xr-x 3 root root 4096 Sep 22 10:51 5.15.61-v8+
drwxr-xr-x 3 root root 4096 Jan 13 21:43 5.15.84-v8+
pi@raspberrypi:/lib/modules $ pwd
/lib/modules
pi@raspberrypi:/lib/modules $

please help me

Unable to capture mono (single channel) audio

After adding sofvol in .asoundrc I can't change channel count from 2 to 1. I get this message from arecord:

$ arecord -D dmic_sv -c1 -r 44100 -f S32_LE -t wav mono audio/test.wav 
Recording WAVE 'mono' : Signed 32 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1270: Broken configuration for this PCM: no configurations available

This is the working .asoundrc file, if change is made here to "channels 1" the above error happens:

#This section makes a reference to your I2S hardware, adjust the card name
# to what is shown in arecord -l after card x: before the name in []
#You may have to adjust channel count also but stick with default first
pcm.dmic_hw {
	type hw
	card sndrpii2scard
	channels 2
	format S32_LE
}

#This is the software volume control, it links to the hardware above and after
# saving the .asoundrc file you can type alsamixer, press F6 to select
# your I2S mic then F4 to set the recording volume and arrow up and down
# to adjust the volume
# After adjusting the volume - go for 50 percent at first, you can do
# something like 
# arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
pcm.dmic_sv {
	type softvol
	slave.pcm dmic_hw
	control {
		name "Boost Capture Volume"
		card sndrpii2scard
	}
	min_dB -3.0
	max_dB 30.0
}

I'm able to record stereo audio with dead right channel, though.

Just a question

Does anyone no why the I2S mic driver seems to clash with Dac drivers and if its possible to get 2xI2s mics and a I2S dac working on a Pi.

As said just a question as tried it before and from what I have read in forums but always wondered why as there are 2x I2S interfaces?

Update for loading the module at boot

To quote from the README:

$ sudo modprobe snd-i2s_rpi rpi_platform_generation=0

# rpi_platform_generation=0 for Raspberry Pi 1 B/A/A+, 0
# do not add anything for everything else (2/3).

In order for arecord to detect the mic on bootup for Raspberry Pi 1 (as I had) and Zero, creating /etc/modprobe.d/snd-i2s_rpi.conf with the following line:

options snd-i2s_rpi rpi_platform_generation=0

should allow the module to load with that option by default.

Testing with sudo modprobe snd-i2s_rpi after generating that config should also work.

Module loading problem

First of all thank you so much for the support. Previously i was using this library over my Raspberry pi 3 and it was working 100% perfect but My project requirement is Raspberry pi Zero W and i am using the same memory card for the microphone but still it not working. Can you help me through ?

Thank You

snd-i2s_rpi: Setting platform to 3f203000.i2s
this has to look like this i guess
snd-i2s_rpi: Setting platform to 20203000.i2s

pi@raspberrypi:~ $ sudo modprobe snd-i2s_rpi rpi_platform_generation=0
pi@raspberrypi:~ $ dmesg | grep i2s
[    3.700989] snd_i2s_rpi: loading out-of-tree module taints kernel.
[    3.701747] snd-i2s_rpi: Version 0.0.2
[    3.701760] snd-i2s_rpi: Setting platform to 3f203000.i2s
[    7.208148] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[    8.664851] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[    8.666020] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[    9.171664] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[    9.236320] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[    9.429768] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[   10.534964] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[   10.557961] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[   18.255598] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry
[   18.260127] asoc-simple-card asoc-simple-card.0: ASoC: CPU DAI 3f203000.i2s not registered - will retry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.