Go to advanced search

by HiassofT
Tue Jan 16, 2018 2:28 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

Please, is there anyone out there who could give me a hand how to properly define master/slave in the HiassofT-Overlay Just use the bitclock-master and frame-master properties. See the bindings documentation for details and examples https://github.com/raspberrypi/linux/blob/rpi-4.9.y/Documentation/...
by HiassofT
Mon Jan 08, 2018 3:30 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

Full duplex mode is supported by the hardware, only limitation is that playback and capture configuration (rate, format) must be the identical. But there's a bug in the driver that prevents this from working when the RPi is configured as I2S clock master - hence the "busy" error from the latency che...
by HiassofT
Mon Nov 13, 2017 1:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

When using the "simple-card " driver you can use the frame-master and bitclock-master properties in DT. See https://github.com/raspberrypi/linux/bl ... e-card.txt

so long,

Hias
by HiassofT
Fri Nov 10, 2017 9:58 am
Forum: Device Tree
Topic: Adding Device Tree to EEPROM config file.
Replies: 30
Views: 6236

Re: Adding Device Tree to EEPROM config file.

I think you might also need #sound-dai-cells = <0>; like in the rpi-dac overlay https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts#L15-L24 Plus better change the name of the node. eg: fragment@1 { target-path = "/"; __overlay__ { codec_out: pcm1794a-co...
by HiassofT
Thu Nov 09, 2017 5:25 pm
Forum: Device Tree
Topic: Adding Device Tree to EEPROM config file.
Replies: 30
Views: 6236

Re: Adding Device Tree to EEPROM config file.

I don't think that's possible via .asoundrc. I'm only aware of the rate alsa plugin which allows you to use a fixed rate. The only thing you can do in the simple-card overlay is to use a different codec driver which comes with the correct constraints.- but I'm also not aware of any "generic" driver ...
by HiassofT
Thu Nov 09, 2017 11:24 am
Forum: Device Tree
Topic: Adding Device Tree to EEPROM config file.
Replies: 30
Views: 6236

Re: Adding Device Tree to EEPROM config file.

Handling of sample rates is the same as for sample formats: the default (plughw) PCM will choose the best match available from the hardware (hw PCM), if there's no exact match it'll do software conversion - which usually isn't too great in case it needs to resample - also this needs a bit of CPU pow...
by HiassofT
Wed Nov 08, 2017 5:50 pm
Forum: Device Tree
Topic: Adding Device Tree to EEPROM config file.
Replies: 30
Views: 6236

Re: Adding Device Tree to EEPROM config file.

The available sample formats (plus numbers of channels and samplerates) are determined from what both the CPU dai (bcm2835-i2s) and the codec (in your case the spdif transmitter "codec" spdif-dit) support. The intersection of the capabilities then leads to 2 channels, 16 or 24 bit and the standard 8...
by HiassofT
Tue Oct 24, 2017 12:10 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

I forgot to add one important thing: During development it might be better to provide separate BCLK outputs (one for RPi, one for codec) on the FPGA. Not sure if that'll actually be needed, but if during testing you find out that you eg should start codec BCLK before RPi BCLK you can simply handle t...
by HiassofT
Tue Oct 24, 2017 7:53 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

Phil's explanation is correct, here's how the I2S and clock signals wiring will look like: FPGA is the clock master and provides the following clock outputs: - a single BCLK output, this is connected to both RPI and codec BCLK inputs. - a MCLK output to the codec - a LRCLK_RPI output to the RPi - a ...
by HiassofT
Wed Oct 18, 2017 8:21 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

Yes, your summary is correct. Using a CPLD or a small FPGA (like for example a Lattice MachXO2) for clock generation would be the best approach. This'll allow you to generate all 4 clocks (MCLK, BCLK, LRCLK for BCM and LRCLK for DAC) in a single device and make sure all clocks are synchronized. Disc...
by HiassofT
Mon Oct 16, 2017 11:10 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

The thing that's missing is the hardware and software (codec driver) to generate proper LRCLK signals for the CPU and DAC. The Alsa plugin (or manual conversion with sox) is only one of the part that's needed. I'll start from scratch and try a different approach to explaining what we have to do. Dat...
by HiassofT
Tue Oct 10, 2017 12:15 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

Forgot to add: if you don't want to tackle the alsa plugin yet but rather start with the hardware side you can do the conversion manually, eg using sox. For example: if you have an 8-channel wav file using S32_LE format with 48kHz sample rate like this: mediainfo 8-channel.wav General Complete name ...
by HiassofT
Tue Oct 10, 2017 9:47 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

The existing alsa plugins won't help you much, you will have to write one on your own. Plus you'll also need to build the clock generation hardware and write a codec driver for it. So all this isn't going to be an easy task. The basic idea of the plugin is that it exposes an 8-channel endpoint but c...
by HiassofT
Mon Oct 09, 2017 1:21 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

No idea what this allChannelCount plugin is doing but the "slave.channels 8;" setting looks like it might be trying to configure the pcm hw with 8 channels - which won't work of course, it should open it with 2 channels.

so long,

Hias
by HiassofT
Fri Oct 06, 2017 12:48 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

Looking through your code I noticed several important parts (startup, shutdown, hwparams) are still based on the octo driver. The hardest part in getting your driver right will be to forget most things you think you learned from the driver - several crucial parts are utterly wrong and lead you to wr...
by HiassofT
Thu Oct 05, 2017 9:50 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

Yes, this combination won't work. If that is a problem it's best to use a different codec, there's not much we can do about it.

so long,

Hias
by HiassofT
Thu Oct 05, 2017 9:26 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

You mentioned that you modified the upstream cs42xx8 driver - I'd start by dropping these modifications, quite certainly this is interfering with proper operation. As for clocking, there are a few things to keep in mind: Like most codecs the cs42448 requiires BCLK and LRCLK to be synchronously deriv...
by HiassofT
Wed Oct 04, 2017 10:06 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 14842

Re: I2S clocks, GPCLK0

A few comments: the CS42448 requires MCLK to run at 256x-1024x fs, depending on it's configuration - see the "MCLK Frequency Settings" tables on page 46/47 of the datasheet. Also you'll need to configure the CS42448 to drive BCLK (usually at 64x fs) and LRCLK. I have to add that the audioinjector oc...
by HiassofT
Tue Oct 03, 2017 9:58 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

Well, it worked for Fletch, not for Jessie, which still seems to need my-loader.ko Ah, you're right, the kernel in Raspbian Jessie is too old - I had thought it had been updated as well. In this case you can use "rpi-update" to get the latest kernel version - then the DT overlay will work on Jessie...
by HiassofT
Mon Oct 02, 2017 7:43 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

* then I edited /boot/config.txt to include: dtoverlay=dual dtoverlay=i2s-mmap dtoverlay=rpi-dac dtoverlay=snd-soc-rpi-dac dtoverlay=snd-soc-core dtoverlay=pcm1794a dtoverlay=snd-soc-pcm1794a dtoverlay=snd-soc-bcm2708-i2s dtoverlay=bcm2708-i2s dtoverlay=bcm2708-dmaengine (all the other dtoverlays, ...
by HiassofT
Thu Sep 28, 2017 11:00 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread.
Replies: 886
Views: 422821

Re: STICKY: The I2S sound thread.

With the current Raspbian Stretch and Jessie kernels you just need to use a devicetree overlay like this one: /dts-v1/; /plugin/; / { compatible = "brcm,bcm2708"; fragment@0 { target = <&sound>; __overlay__ { compatible = "simple-audio-card"; simple-audio-card,name = "Dual"; status="okay"; capture_l...
by HiassofT
Wed Sep 20, 2017 5:50 pm
Forum: Device Tree
Topic: lirc_rpi.c won't compile under latest media_tree & 4.9.28v7+
Replies: 28
Views: 6723

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

Today I built an IR transmitter and tested the gpio-ir-tx and pwm-ir-tx drivers mentioned above. Except for a minor issue (gpio polarity was wrong in gpio-ir-tx) they worked fine. Recent versions of v4l-utils include "ir-ctl" which provides a really easy way to send IR signals. It can encode the co...
by HiassofT
Fri Jul 28, 2017 9:40 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using a I2S amp and a I2S microphone together.
Replies: 3
Views: 1616

Re: Using a I2S amp and a I2S microphone together.

You can do that by using the simple-audio-card driver and a dts file. Here's an example dts file that uses the generic spdif receiver and transmitter codecs: /dts-v1/; /plugin/; / { compatible = "brcm,bcm2708"; fragment@0 { target-path = "/"; __overlay__ { dual_soundcard: dual-soundcard { compatible...
by HiassofT
Fri Jul 21, 2017 8:47 pm
Forum: Device Tree
Topic: lirc_rpi.c won't compile under latest media_tree & 4.9.28v7+
Replies: 28
Views: 6723

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

Today I built an IR transmitter and tested the gpio-ir-tx and pwm-ir-tx drivers mentioned above. Except for a minor issue (gpio polarity was wrong in gpio-ir-tx) they worked fine. Recent versions of v4l-utils include "ir-ctl" which provides a really easy way to send IR signals. It can encode the com...
by HiassofT
Thu Jul 06, 2017 9:49 am
Forum: Device Tree
Topic: lirc_rpi.c won't compile under latest media_tree & 4.9.28v7+
Replies: 28
Views: 6723

Re: lirc_rpi.c won't compile under latest media_tree & 4.9.2

FYI: A few days ago a patchset was posted on linux-media to add generic bit-banging and pwm-supported IR transmission:

http://www.mail-archive.com/linux-media ... 14958.html

so long,

Hias

Go to advanced search