Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Support in piCorePlayer #4

Closed
paul-1 opened this issue Jun 28, 2020 · 17 comments
Closed

Support in piCorePlayer #4

paul-1 opened this issue Jun 28, 2020 · 17 comments

Comments

@paul-1
Copy link

paul-1 commented Jun 28, 2020

Have quite a few users that would like to use this card with piCorePlayer. Being a minimal OS, we only load what we have to. I’m getting no sound. Kernel is 4.19.122. Driver loads fine according to dmesg and lsmod. aplay -l reports the card is seen by Alsa, and all of the mixers are shown in Alsa mixer. All of the error mixers report OK.

So there must be some soft dependency somewhere? @AMuszkat Any thoughts?

I did test the board with the latest Raspberry OS, and it does work, so hardware is okay.

@AMuszkat
Copy link
Contributor

Hi Paul,

I'll be glad to help here. Is there any way I can have acces to the image you are using? or can I compile it myself with any source code so I can have a closer look at it?

Feel free to write me to [email protected]

Best,
Ariel

@paul-1
Copy link
Author

paul-1 commented Jun 28, 2020

This is our current image. https://repo.picoreplayer.org/insitu/piCorePlayer6.1.0/piCorePlayer6.1.0.zip

Here is a quick getting started: https://www.picoreplayer.org/main_getting_started.shtml

I don't have any mixers setup in the web interface, but ssh and alsamixer should all work as planned.

@AMuszkat
Copy link
Contributor

AMuszkat commented Jul 1, 2020

Hi Paul,

Is it possible that I don't have access to alsamixer in piCore?

I would like to take a look at the errors labels. It takes my attention that I can not even generate audio with speaker-test.

Best,
Ariel

@AMuszkat
Copy link
Contributor

AMuszkat commented Jul 1, 2020

This is what I get from speaker-test

speaker-test 1.1.9

Playback device is hw:1,0
Stream parameters are 44100Hz, S32_LE, 1 channels
Sine wave rate is 1000.0000Hz
Playback open error: -16,Device or resource busy

is it normal? I suppose other stuff is using the I2S of the BCM?

@paul-1
Copy link
Author

paul-1 commented Jul 1, 2020

Squeezelite will start by default, and will tie up the audio device. You can stop if from the web interface, or just kill the process.

alsamixer is should be availiable from a ssh or console session.

@AMuszkat
Copy link
Contributor

AMuszkat commented Jul 1, 2020

is squeezelite upsampling or working at more than 48KHz of smaple rate? Currently the Merus Amp HAT supports up to 48KHz only

@paul-1
Copy link
Author

paul-1 commented Jul 1, 2020

By default squeezelite does not resample. But I noticed the card did not report supported sample rates, so I was forcing squeezelite to use 48k as the max sample rate. It's an option on the squeezelite page.

@AMuszkat
Copy link
Contributor

AMuszkat commented Jul 6, 2020

Hi Paul,

I was not able to find anything yet, but I suppose that it is smth around alsa resources....

@paul-1
Copy link
Author

paul-1 commented Aug 19, 2020

There was a user in the LMS forums that made an observation. He mentioned the Enable pin is being left high.

https://forums.slimdevices.com/showthread.php?111787-ANNOUNCE-piCorePlayer-6-0-0&p=985144&viewfull=1#post985144

@AMuszkat
Copy link
Contributor

Hi Paul,

Could not reproduce this last time. did you have anytime for further investigation on this?

@paul-1
Copy link
Author

paul-1 commented Sep 21, 2020

I have never been able to make it work. I'm not aware of anyone on the forums getting this going either. It seems like an initialization sequence issue.

@paul-1
Copy link
Author

paul-1 commented Nov 10, 2020

Finally figured out what was wrong. You cannot have the rpi SPI interface enabled with this card. That should really be in the documentation.

I have it running now.

@shawaj
Copy link

shawaj commented Dec 26, 2020

Nice one @paul-1 ... I was having this same issue and tearing my hair out a little bit until I chanced upon this issue! Definitely agree this should be explicitly mentioned in the docs.

image

@AMuszkat what was the reasoning behind using pin 24 / GPIO8 for the MSEL0 pin? It blocks SPI CE0 - and also means if you have the SPI interface on the Pi turned on the audio board doesn't work - could this not be wired to another pin? (also, just FYI, the pinout on the above image is reversed - it has even and odd pins on the wrong sides)

In any case, I have raised a PR here - raspberrypi/linux#4027 - so that for any other boards using this chip they can wire the MSEL0 / MSEL1 pins to different GPIOs on the Pi.

@AMuszkat
Copy link
Contributor

Hi @shawaj ,

This will be upgraded on hardware on the next revision of the board. For now ovverriding looks ok to me, or we can even turn off the SPI port from the overlay file.

@shawaj
Copy link

shawaj commented Dec 28, 2020

@AMuszkat ok sounds great. My thought on the overrides for msel0 / msel1 was that then if anyone is using the ma12070 in the future with different pins they can change that but use the same overlay.

I guess the SPI thing in the overlay could be good, but then wouldn't be needed in different/future designs. Maybe could have an override for turning SPI off - i.e. dtoverlay=merus-amp,spi-off or something like that.

What do you think?

Also, @AMuszkat is there any specific reason to have MSEL0 / 1 tied to a GPIO? Can it just be pulled up to 5v without using GPIO? Or is it required that it's a GPIO for some configuration reason?

@AMuszkat
Copy link
Contributor

AMuszkat commented Jan 4, 2021

Hi @shawaj,

Turning off SPI on this specific overlay will be the solution.

Regarding MSEL0 and MSEL1, sometimes they are required to be tied to a GPIO as they define if the amplifier is in BTL / PBTL / 2.1 / 4xSE modes and you want to control the operation mode from software. For example, the merus-amp supports BTL and PBTL modes by just pulling GPIO 8., without the need of hand soldering small smd resistors. The right solution will be to move the GPIO8 to another one.

If you agree I will continue this discussion in #7 and close this issue

@paul-1
Copy link
Author

paul-1 commented Jan 4, 2021

I'm fine with closing.....will tag the rpi pull requests here too.

raspberrypi/linux#4027

@paul-1 paul-1 closed this as completed Jan 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants