Jump to content
giseleznev

pisound + tinker board 2

Recommended Posts

Hi team, I'm trying to make pisound(https://blokas.io/pisound/) work with tinker board 2.

I'm using pisound repo to get pisound.c kernel module file, and dts file: https://github.com/BlokasLabs/pisound

Changes for tinker board(not 2) are available here: https://github.com/BlokasLabs/pisound/compare/master...tinkerboard, and it works: https://community.blokas.io/t/pisound-on-tinker-board/1015

I changed .dts file, so that it suits tinker board 2. Dmesg is correct(https://pastebin.com/Cfdz5ct0), it is attached lower. I can see pisound in aplay -l and arecord -l lists.

But when I run "speaker-test -D hw:pisound -c 2 -r 48000", I get:

Can you look at pisound.c file please, is it ok for tinker board 2 ? Should I change something in a dts file or in pisound.c file ? How can I solve this problem ? Thanks a lot!

(Linux linaro-alip 4.4.194)

speaker-test 1.1.8

Playback device is hw:pisound
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 65536
Using max buffer size 131072
Periods = 4
was set period_size = 32768
was set buffer_size = 131072
 0 - Front Left
 1 - Front Right
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>

/ {
	compatible = "rockchip,rk3399";
	
	fragment@0 {
		target-path = "/spdif-sound";
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@1 {
		target-path = "/hdmi-dp-sound";
		__overlay__ {
			status = "disabled";
		};
	};
	fragment@2 {
		target-path ="/i2s@ff880000";
		__overlay__ {
			#sound-dai-cells = <0>;
			status = "okay";
		};
	};
	fragment@3 {
		target = <&spi2>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			spidev@0 {
				status="okay";
			};
			spidev@1 {
				status="okay";
			};
			pisound_spi: pisound_spi@0{
				compatible = "blokaslabs,pisound-spi";
				reg = <0>;
				spi-max-frequency = <100000>;
			};
		};
	};

	fragment@4 {
		target-path = "/";
		__overlay__ {
			pcm5102a-codec {
				#sound-dai-cells = <0>;
				compatible = "ti,pcm5102a";
				status = "okay";
			};
		};
	};

	fragment@5 {
		target = <&pinctrl>;
		__overlay__ {
			pisound_pins: pisound_pins {
				rockchip,pins =
					<&gpio4 22 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio4 21 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio2 18 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio4 18 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio2 23 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio3 28 RK_FUNC_GPIO &pcfg_pull_none>,
					<&gpio2 19 RK_FUNC_GPIO &pcfg_pull_none>;
			};
		};
	};

	fragment@6 {
		target-path = "/sound-ext-card";
		__overlay__ {
			compatible = "blokaslabs,pisound";
			i2s-controller = <&i2s0>;
			status = "okay";

			pinctrl-names = "default";
			pinctrl-0 = <&pisound_pins>;

			osr-gpios =
				<&gpio4 22 GPIO_ACTIVE_HIGH>, // GP7C6
				<&gpio4 21 GPIO_ACTIVE_HIGH>, // GP7B0
				<&gpio2 18 GPIO_ACTIVE_HIGH>; // GP7A7

			reset-gpios =
				<&gpio4 18 GPIO_ACTIVE_HIGH>, // GP7C7
				<&gpio2 23 GPIO_ACTIVE_HIGH>; // GP5B3

			data_available-gpios = <&gpio3 28 GPIO_ACTIVE_HIGH>; // GP5C3

			button-gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; // GP5B4
		};
	};
};

 

Edited by giseleznev

Share this post


Link to post
Share on other sites

hello @giseleznev

what is the os version you're using and can we have the screenshot of the aplay -l result for checking?

the 'hdmi-dp-sound' is an old structure that does not exist anymore, i don't have a pisound but if its chip is pcm5102a then 'overlay=hifiberry-dac' may work. please use v.2.1.6 (debian 10, kernel 4.19) or later versioin Tinker Board 2 Debian 10 V2.1.6

 

Share this post


Link to post
Share on other sites
5 hours ago, tooz said:

hello @giseleznev

what is the os version you're using and can we have the screenshot of the aplay -l result for checking?

the 'hdmi-dp-sound' is an old structure that does not exist anymore, i don't have a pisound but if its chip is pcm5102a then 'overlay=hifiberry-dac' may work. please use v.2.1.6 (debian 10, kernel 4.19) or later versioin Tinker Board 2 Debian 10 V2.1.6

 

image.png

image.png

currently using Linux linaro-alip 4.4.194 #1 SMP Tue Aug 23 06:14:15 UTC 2022 aarch64 GNU/Linux, I'll try new release today

that's true 'overlay=hifiberry-dac' works for dac, but thing I need from pisound is adc, there is the same problem with adc:

image.png

pisound.c file seems not board-specific, so thing that might differ is .dts file, can you see any more mistakes ?
what should I use instead of 'hdmi-dp-sound'?

Edited by giseleznev

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...