diff mbox

[1/2] ARM: DTS: kirkwood-openrd-client: fix audio

Message ID 1453588600-14831-2-git-send-email-aaro.koskinen@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Aaro Koskinen Jan. 23, 2016, 10:36 p.m. UTC
Fix audio on kirkwood-openrd-client:

1) The audio-controller was left disabled.

2) The probe fails because cs42l51 is missing #sound-dai-cells.

	/sound/simple-audio-card,codec: could not get #sound-dai-cells for /ocp@f1000000/i2c@11000/cs42l51@4a
	asoc-simple-card sound: parse error -22
	asoc-simple-card: probe of sound failed with error -22

3) The mapping is incorrect:

	asoc-simple-card sound: cs42l51-hifi <-> spdif mapping ok

   should be:

	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok

Reported-by: Rick Thomas <rbthomas@pobox.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/boot/dts/kirkwood-openrd-client.dts | 6 +++++-
 arch/arm/boot/dts/kirkwood.dtsi              | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Andrew Lunn Jan. 24, 2016, 5:37 p.m. UTC | #1
On Sun, Jan 24, 2016 at 12:36:39AM +0200, Aaro Koskinen wrote:
> Fix audio on kirkwood-openrd-client:
> 
> 1) The audio-controller was left disabled.
> 
> 2) The probe fails because cs42l51 is missing #sound-dai-cells.
> 
> 	/sound/simple-audio-card,codec: could not get #sound-dai-cells for /ocp@f1000000/i2c@11000/cs42l51@4a
> 	asoc-simple-card sound: parse error -22
> 	asoc-simple-card: probe of sound failed with error -22
> 
> 3) The mapping is incorrect:
> 
> 	asoc-simple-card sound: cs42l51-hifi <-> spdif mapping ok
> 
>    should be:
> 
> 	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok
> 
> Reported-by: Rick Thomas <rbthomas@pobox.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

It would be good to have a Tested-by: from Rick.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

	     Andrew

> ---
>  arch/arm/boot/dts/kirkwood-openrd-client.dts | 6 +++++-
>  arch/arm/boot/dts/kirkwood.dtsi              | 2 +-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-openrd-client.dts b/arch/arm/boot/dts/kirkwood-openrd-client.dts
> index 887b9c1..96ff59d 100644
> --- a/arch/arm/boot/dts/kirkwood-openrd-client.dts
> +++ b/arch/arm/boot/dts/kirkwood-openrd-client.dts
> @@ -20,6 +20,9 @@
>  	compatible = "marvell,openrd-client", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
>  
>  	ocp@f1000000 {
> +		audio-controller@a0000 {
> +			status = "okay";
> +		};
>  		i2c@11000 {
>  			status = "okay";
>  			clock-frequency = <400000>;
> @@ -27,6 +30,7 @@
>  			cs42l51: cs42l51@4a {
>  				compatible = "cirrus,cs42l51";
>  				reg = <0x4a>;
> +				#sound-dai-cells = <0>;
>  			};
>  		};
>  	};
> @@ -37,7 +41,7 @@
>  		simple-audio-card,mclk-fs = <256>;
>  
>  		simple-audio-card,cpu {
> -			sound-dai = <&audio0>;
> +			sound-dai = <&audio0 0>;
>  		};
>  
>  		simple-audio-card,codec {
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 7b5a4a1..7445a15 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -381,7 +381,7 @@
>  
>  		audio0: audio-controller@a0000 {
>  			compatible = "marvell,kirkwood-audio";
> -			#sound-dai-cells = <0>;
> +			#sound-dai-cells = <1>;
>  			reg = <0xa0000 0x2210>;
>  			interrupts = <24>;
>  			clocks = <&gate_clk 9>;
> -- 
> 2.4.0
>
Rick Thomas Jan. 24, 2016, 8:56 p.m. UTC | #2
On Jan 24, 2016, at 9:37 AM, Andrew Lunn <andrew@lunn.ch> wrote:

> On Sun, Jan 24, 2016 at 12:36:39AM +0200, Aaro Koskinen wrote:
>> Fix audio on kirkwood-openrd-client:
>> 
>> 1) The audio-controller was left disabled.
>> 
>> 2) The probe fails because cs42l51 is missing #sound-dai-cells.
>> 
>> 	/sound/simple-audio-card,codec: could not get #sound-dai-cells for /ocp@f1000000/i2c@11000/cs42l51@4a
>> 	asoc-simple-card sound: parse error -22
>> 	asoc-simple-card: probe of sound failed with error -22
>> 
>> 3) The mapping is incorrect:
>> 
>> 	asoc-simple-card sound: cs42l51-hifi <-> spdif mapping ok
>> 
>>   should be:
>> 
>> 	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok
>> 
>> Reported-by: Rick Thomas <rbthomas@pobox.com>
>> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> 
> It would be good to have a Tested-by: from Rick.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
> 	     Andrew


If someone will make a .deb I can download, I'll be happy to install it and test it.  Please be explicit in describing what and how you want tested.


Rick
Martin Michlmayr Jan. 24, 2016, 9:40 p.m. UTC | #3
* Rick Thomas <rbthomas@pobox.com> [2016-01-24 12:56]:
> > It would be good to have a Tested-by: from Rick.
> > 
> If someone will make a .deb I can download, I'll be happy to install
> it and test it.  Please be explicit in describing what and how you
> want tested.

Check your email. :)
Rick Thomas Jan. 25, 2016, 3:26 a.m. UTC | #4
On Jan 24, 2016, at 1:40 PM, Martin Michlmayr <tbm@cyrius.com> wrote:

> * Rick Thomas <rbthomas@pobox.com> [2016-01-24 12:56]:
>>> It would be good to have a Tested-by: from Rick.
>>> 
>> If someone will make a .deb I can download, I'll be happy to install
>> it and test it.  Please be explicit in describing what and how you
>> want tested.
> 
> Check your email. :)
> 
> -- 
> Martin Michlmayr
> http://www.cyrius.com/
> 


Got it.

Looks like mmc works with that kernel.  I was able to mount /dev/mmcblk0p1 and read files from it.

Sound we have some progress:

> root@base:~# ls -l /dev/snd
> total 0
> drwxr-xr-x 2 root root       60 Jan 24 18:23 by-path
> crw-rw---- 1 root audio 116,  2 Jan 24 18:23 controlC0
> crw-rw---- 1 root audio 116,  4 Jan 24 18:23 pcmC0D0c
> crw-rw---- 1 root audio 116,  3 Jan 24 18:23 pcmC0D0p
> crw-rw---- 1 root audio 116,  1 Jan 24 18:23 seq
> crw-rw---- 1 root audio 116, 33 Jan 24 18:23 timer
> root@base:~# cat /proc/asound/devices 
>   2: [ 0]   : control
>   3: [ 0- 0]: digital audio playback
>   4: [ 0- 0]: digital audio capture
>  33:        : timer
> root@base:~# cat /proc/asound/cards   
>  0 [i2scs42l51hifi ]: i2s-cs42l51-hif - i2s-cs42l51-hifi
>                       i2s-cs42l51-hifi

Full of hope, I did "aptitude install mp321" which went without any visible problems.

Then hooked up a pair of earphones to the "speaker" plug on the Client and ran

> root@base:~# mpg321 -v /tmp/Jersey.mp3 
> High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
> Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
> now maintained by Nanakos Chrysostomos and others.
> Uses code from various people. See 'README' for more!
> THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
> Title	: The Jersey Bounce              Artist : Zazuzaz                       
> Album	: An Evening with ZaZuZaz        Year	 : 2000
> Comment : Amazon.com Song ID: 201809221  Genre : Jazz                          
> 
> Directory: /tmp
> Playing MPEG stream from Jersey.mp3 ...
> MPEG 1.0, Layer: III, Freq: 44100, mode: Joint-Stereo, modext: 0, BPF : 2560
> Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
> Bitrate: 128 Kbits/s, Extension value: 0
> Audio: 1:1 conversion, rate: 44100, encoding: signed 16 bit, channels: 2
> ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
> ^C                                                                            
> [0:20] Decoding of Jersey.mp3 finished.

So it seemed to be running OK...  But there was no sound in the earphones.  I also tried adding option "-g 50" to set the gain explicitly.  Still no sound.

Is there a hardware jumper I need to set to activate sound on the OpenRD Client board?

Do I need to install another package? For example, "aptitude search '~i alsa'" gives no output, indicating, I believe, that there are no installed packages with "alsa" in their name.

The message:
> ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
seems suspicious.

Any thoughts?
Rick
Aaro Koskinen Jan. 25, 2016, 6:24 p.m. UTC | #5
Hi,

On Sun, Jan 24, 2016 at 07:26:43PM -0800, Rick Thomas wrote:
> > root@base:~# cat /proc/asound/devices 
> >   2: [ 0]   : control
> >   3: [ 0- 0]: digital audio playback
> >   4: [ 0- 0]: digital audio capture
> >  33:        : timer
> > root@base:~# cat /proc/asound/cards   
> >  0 [i2scs42l51hifi ]: i2s-cs42l51-hif - i2s-cs42l51-hifi
> >                       i2s-cs42l51-hifi
> 
> Full of hope, I did "aptitude install mp321" which went without any visible problems.
> 
> Then hooked up a pair of earphones to the "speaker" plug on the Client and ran
> 
> > root@base:~# mpg321 -v /tmp/Jersey.mp3 
> > High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
> > Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
> > now maintained by Nanakos Chrysostomos and others.
> > Uses code from various people. See 'README' for more!
> > THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
> > Title	: The Jersey Bounce              Artist : Zazuzaz                       
> > Album	: An Evening with ZaZuZaz        Year	 : 2000
> > Comment : Amazon.com Song ID: 201809221  Genre : Jazz                          
> > 
> > Directory: /tmp
> > Playing MPEG stream from Jersey.mp3 ...
> > MPEG 1.0, Layer: III, Freq: 44100, mode: Joint-Stereo, modext: 0, BPF : 2560
> > Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
> > Bitrate: 128 Kbits/s, Extension value: 0
> > Audio: 1:1 conversion, rate: 44100, encoding: signed 16 bit, channels: 2
> > ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
> > ^C                                                                            
> > [0:20] Decoding of Jersey.mp3 finished.
> 
> So it seemed to be running OK...  But there was no sound in the
> earphones. I also tried adding option "-g 50" to set the gain explicitly.
> Still no sound.
> 
> Is there a hardware jumper I need to set to activate sound on the
> OpenRD Client board?

On my board I need to say "amixer set PCM on". Can you post the full
output from "amixer" without any parameters?

Also check if you have this line in dmesg:

	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok

If it says "spdif" the player runs but is silent.

A.
Rick Thomas Jan. 26, 2016, 1:55 a.m. UTC | #6
On Jan 25, 2016, at 10:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> Hi,
> 
> On Sun, Jan 24, 2016 at 07:26:43PM -0800, Rick Thomas wrote:
>>> root@base:~# cat /proc/asound/devices 
>>>  2: [ 0]   : control
>>>  3: [ 0- 0]: digital audio playback
>>>  4: [ 0- 0]: digital audio capture
>>> 33:        : timer
>>> root@base:~# cat /proc/asound/cards   
>>> 0 [i2scs42l51hifi ]: i2s-cs42l51-hif - i2s-cs42l51-hifi
>>>                      i2s-cs42l51-hifi
>> 
>> Full of hope, I did "aptitude install mp321" which went without any visible problems.
>> 
>> Then hooked up a pair of earphones to the "speaker" plug on the Client and ran
>> 
>>> root@base:~# mpg321 -v /tmp/Jersey.mp3 
>>> High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
>>> Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
>>> now maintained by Nanakos Chrysostomos and others.
>>> Uses code from various people. See 'README' for more!
>>> THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
>>> Title	: The Jersey Bounce              Artist : Zazuzaz                       
>>> Album	: An Evening with ZaZuZaz        Year	 : 2000
>>> Comment : Amazon.com Song ID: 201809221  Genre : Jazz                          
>>> 
>>> Directory: /tmp
>>> Playing MPEG stream from Jersey.mp3 ...
>>> MPEG 1.0, Layer: III, Freq: 44100, mode: Joint-Stereo, modext: 0, BPF : 2560
>>> Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
>>> Bitrate: 128 Kbits/s, Extension value: 0
>>> Audio: 1:1 conversion, rate: 44100, encoding: signed 16 bit, channels: 2
>>> ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
>>> ^C                                                                            
>>> [0:20] Decoding of Jersey.mp3 finished.
>> 
>> So it seemed to be running OK...  But there was no sound in the
>> earphones. I also tried adding option "-g 50" to set the gain explicitly.
>> Still no sound.
>> 
>> Is there a hardware jumper I need to set to activate sound on the
>> OpenRD Client board?
> 
> On my board I need to say "amixer set PCM on". Can you post the full
> output from "amixer" without any parameters?
> 
> Also check if you have this line in dmesg:
> 
> 	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok
> 
> If it says "spdif" the player runs but is silent.
> 
> A.

Martin suggested that I install alsa-utils and run alsamixer in order to remove any extraneous "mute" setting.  I did that (I didn't realize alsamixer was runnable from the command line -- good to know!)

I did that and it worked!  "The Jersey Bounce" never sounded so good!

I'll do the tests that Aaro suggest, just for completeness, but it will have to wait til later tonight.

So we can add -- 

Tested-by: Rick Thomas <rbthomas@pobox.com>

Enjoy!
Rick
Rick Thomas Jan. 26, 2016, 3:50 a.m. UTC | #7
On Jan 25, 2016, at 10:24 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> 
> On my board I need to say "amixer set PCM on". Can you post the full
> output from "amixer" without any parameters?
> 
> Also check if you have this line in dmesg:
> 
> 	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok
> 
> If it says "spdif" the player runs but is silent.
> 
> A.
> 

Here's the output of "amixer"
This is after having run alsamixer (per Martin's suggestion) and un-mute-ing everything I could find.

And here's the output of "dmesg"
In particular

> rbthomas@base:~$ dmesg | grep sound    
> [   11.777850] asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok

Everything is working fine now.

Thanks for all the help!
Rick
Gregory CLEMENT Jan. 26, 2016, 8:58 a.m. UTC | #8
Hi Aaro,
 
 On sam., janv. 23 2016, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> Fix audio on kirkwood-openrd-client:
>
> 1) The audio-controller was left disabled.
>
> 2) The probe fails because cs42l51 is missing #sound-dai-cells.
>
> 	/sound/simple-audio-card,codec: could not get #sound-dai-cells for /ocp@f1000000/i2c@11000/cs42l51@4a
> 	asoc-simple-card sound: parse error -22
> 	asoc-simple-card: probe of sound failed with error -22
>
> 3) The mapping is incorrect:
>
> 	asoc-simple-card sound: cs42l51-hifi <-> spdif mapping ok
>
>    should be:
>
> 	asoc-simple-card sound: cs42l51-hifi <-> i2s mapping ok
>
> Reported-by: Rick Thomas <rbthomas@pobox.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>

Applied on mvebu/dt with Reviewed-by tag from Andrew Lunn and Tested-by
tag from Rick Thomas.

Thanks,

Gregory

> ---
>  arch/arm/boot/dts/kirkwood-openrd-client.dts | 6 +++++-
>  arch/arm/boot/dts/kirkwood.dtsi              | 2 +-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/kirkwood-openrd-client.dts b/arch/arm/boot/dts/kirkwood-openrd-client.dts
> index 887b9c1..96ff59d 100644
> --- a/arch/arm/boot/dts/kirkwood-openrd-client.dts
> +++ b/arch/arm/boot/dts/kirkwood-openrd-client.dts
> @@ -20,6 +20,9 @@
>  	compatible = "marvell,openrd-client", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
>  
>  	ocp@f1000000 {
> +		audio-controller@a0000 {
> +			status = "okay";
> +		};
>  		i2c@11000 {
>  			status = "okay";
>  			clock-frequency = <400000>;
> @@ -27,6 +30,7 @@
>  			cs42l51: cs42l51@4a {
>  				compatible = "cirrus,cs42l51";
>  				reg = <0x4a>;
> +				#sound-dai-cells = <0>;
>  			};
>  		};
>  	};
> @@ -37,7 +41,7 @@
>  		simple-audio-card,mclk-fs = <256>;
>  
>  		simple-audio-card,cpu {
> -			sound-dai = <&audio0>;
> +			sound-dai = <&audio0 0>;
>  		};
>  
>  		simple-audio-card,codec {
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 7b5a4a1..7445a15 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -381,7 +381,7 @@
>  
>  		audio0: audio-controller@a0000 {
>  			compatible = "marvell,kirkwood-audio";
> -			#sound-dai-cells = <0>;
> +			#sound-dai-cells = <1>;
>  			reg = <0xa0000 0x2210>;
>  			interrupts = <24>;
>  			clocks = <&gate_clk 9>;
> -- 
> 2.4.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

diff --git a/arch/arm/boot/dts/kirkwood-openrd-client.dts b/arch/arm/boot/dts/kirkwood-openrd-client.dts
index 887b9c1..96ff59d 100644
--- a/arch/arm/boot/dts/kirkwood-openrd-client.dts
+++ b/arch/arm/boot/dts/kirkwood-openrd-client.dts
@@ -20,6 +20,9 @@ 
 	compatible = "marvell,openrd-client", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
 	ocp@f1000000 {
+		audio-controller@a0000 {
+			status = "okay";
+		};
 		i2c@11000 {
 			status = "okay";
 			clock-frequency = <400000>;
@@ -27,6 +30,7 @@ 
 			cs42l51: cs42l51@4a {
 				compatible = "cirrus,cs42l51";
 				reg = <0x4a>;
+				#sound-dai-cells = <0>;
 			};
 		};
 	};
@@ -37,7 +41,7 @@ 
 		simple-audio-card,mclk-fs = <256>;
 
 		simple-audio-card,cpu {
-			sound-dai = <&audio0>;
+			sound-dai = <&audio0 0>;
 		};
 
 		simple-audio-card,codec {
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 7b5a4a1..7445a15 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -381,7 +381,7 @@ 
 
 		audio0: audio-controller@a0000 {
 			compatible = "marvell,kirkwood-audio";
-			#sound-dai-cells = <0>;
+			#sound-dai-cells = <1>;
 			reg = <0xa0000 0x2210>;
 			interrupts = <24>;
 			clocks = <&gate_clk 9>;