On 18/12/2020 12:41, Terry Coles wrote:
> Hi,
>
> Some of you are aware that I've been re-engineering the Minster Bells and 
> Music Player at Wimborne Mode Town.  Amongst other things I split the 
> functionality into two Pis (the original Pi 3 and a Pi Zero); both are 
> equipped with an Adafruit Stereo 3 W Amplifier Bonnet:
>
> https://thepihut.com/products/adafruit-i2s-3w-stereo-speaker-bonnet-for-raspberry-pi
>
> The Pi 3 takes care of the music that plays in the Nave and I configured that 
> first and using a cut-down version of the original code,  it has been running 
> satisfactorily for a week or two.
>
> I then backed up its SD Card and created a new one using the Music Player 
> image as a starting point.  Again, using a cut-down version of the original 
> code installed on the pi Zero,  I have now got the bells to ring (almost) 
> perfectly.
>
> The one problem that I have is the volume setting command.  In both programs 
> I 
> have a line:
>
>     subprocess.call(['amixer', '-c', '0', 'set', 'PCM', 'playback', nave_vol])
>
> In the music program this works perfectly every time, but in the bells 
> program 
> it fails intermittently with:
>
>     amixer: Invalid command!
>
> After this failure alsamixer has no control over the volume level.  However, 
> once the amixer command is working so is alsamixer.
>
> Any ideas on what I should check?  AFAIK there is no difference between the 
> two 
> devices other than the underlying Pi type.  I've tried all sorts of 
> combinations of amixer command from the man page, but when it works it works 
> and when it doesn't it seems to refuse to do anything.

Quick thought:

Print out the exact commandline of:

['amixer', '-c', '0', 'set', 'PCM', 'playback', nave_vol]

Every time just in case some previous error or something is getting into
those variables?

You've probably already checked that the commandline is the same when it
stops working I guess, in which case this isn't very useful, but it's
the first thing I'd try.

Hamish

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-01-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to