Bug 7431 - amixer audio - sound on/off - is failing
Summary: amixer audio - sound on/off - is failing
Status: VERIFIED FIXED
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-tools (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.9 M3
Assignee: Jussi Kukkonen
QA Contact: Cristina Agurida
URL:
Whiteboard:
Depends on: 7517
Blocks:
  Show dependency tree
 
Reported: 2015-03-09 13:36 UTC by Ionut Chisanovici
Modified: 2017-06-22 16:27 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
qemux86_log (33.62 KB, application/octet-stream)
2017-06-22 15:57 UTC, oscar lopez arandas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ionut Chisanovici 2015-03-09 13:36:19 UTC
Hi,

For core-image-sato-sdk on NUC the amixer return the below error when trying to run one of the 'STEPS TO REPRODUCE' commands:
amixer: Unable to find simple control 'Master',0

BUILD: meta-intel: 367fd4758d23318b3adab8021d7bdc8b56e04917
ENVIRONMENT: NUC(Next Unit of Computing)
STEPS TO REPRODUCE: 1. check if amixer is installed
2. Run "amixer set Master on" to turn on audio device
3. Run "amixer set Master 64" to adjust to maxium volumn
4. Run "amixer set Master off" to turn off audio device
5. Run "amixer set Speaker on" to turn on speaker (when Speaker is available)
6. Run "amixer set Speaker 64" to adjust to maxium volumn (when Speaker is available)
7. Run "amixer set Speaker off" to turn off speaker (when Speaker is available)

EXPECTED OUTCOME: Above commands can run without problem .

Cheers,
Ionut C
Comment 1 Cristian Iorga 2015-03-19 11:12:39 UTC
Investigation started.
Comment 2 Jussi Kukkonen 2015-03-24 15:40:38 UTC
This is a NUC with both HDMI audio (in the back) and a headphone port (in the front), right?

My D54250WYK plays no audio through the headphones by default because there are two alsa cards, and the wrong one is the default. "aplay -l" shows two "HDMI" devices on card 0 and a "PCM" analog device on card 1. The HDMI devices do not seem to have any volume control capabilities so the amixer commands fail.

I'm not sure if this should work out of the box (without pulseaudio) but you can either change the default card (see bug 7430) or use the amixer option "-c 1" or "-c PCM" to make the amixer commands work:

    amixer -c 1 set Master on
Comment 3 Cristian Iorga 2015-03-24 17:01:15 UTC
Issue is reproducible on 1.7.1 and coupled meta-nuc release also, so I am not really sure about the "regression" part.
Comment 4 Cristian Iorga 2015-03-24 17:14:30 UTC
Hi Jussi, what MACHINE have you used to build the image?

Also, the recommended NUC machine to test this on and supported by meta-nuc is "Next Unit of Computing Kit DC3217IYE"
with Intel Centrino Advanced-N 6235 Wireless mini PCI Express card.
This specific NUC does not have any audio output except via HDMI.
I also tested this with Intel® NUC Kit D54250WYK, issue is still reproducible.
Comment 5 Jussi Kukkonen 2015-03-25 09:05:48 UTC
(In reply to comment #4)
> Hi Jussi, what MACHINE have you used to build the image?

I build for "intel-corei7-64".

> Also, the recommended NUC machine to test this on and supported by meta-nuc
> is "Next Unit of Computing Kit DC3217IYE"

Unfortunately what I have on the desk is not that one.

> with Intel Centrino Advanced-N 6235 Wireless mini PCI Express card.
> This specific NUC does not have any audio output except via HDMI.
> I also tested this with Intel® NUC Kit D54250WYK, issue is still
> reproducible.

Ok, good to know. Testing HDMI output has proven difficult here. I still don't have the right cables...

Have you checked if your device still shows up as two alsa cards ("aplay -l")?
Comment 6 Jussi Kukkonen 2015-03-25 12:00:37 UTC
Ok, I think I've figured out how to get the HDMI audio working. I'll explain that in the other bug but this bug is in my opinion not really a bug:


> 2. Run "amixer set Master on" to turn on audio device

The mixer is not called Master for the HDMI device, but IEC958. So this should work:
 "amixer set IEC958 on"

> 3. Run "amixer set Master 64" to adjust to maxium volumn

This should not work because the card does not seem to support volume adjustment.

> 4. Run "amixer set Master off" to turn off audio device

"amixer set IEC958 off"

> 5. Run "amixer set Speaker on" to turn on speaker (when Speaker is available)
> 6. Run "amixer set Speaker 64" to adjust to maxium volumn (when Speaker is available)
> 7. Run "amixer set Speaker off" to turn off speaker (when Speaker is available)

There are no other controls than IEC958.
Comment 7 Cristian Iorga 2015-03-25 16:17:23 UTC
Comment from Ross Burton:
"So this is exactly the sort of thing that the "machine autoconfiguration" was meant to help with, but that means writing configuration files for every machine, which sucks.

I'm rapidly thinking that for 1.9 we should integrate PulseAudio properly into the Sato images and let PA deal with this.

For 1.8 we have to admit that raw ALSA on modern hardware is a losing battle and we can't fix this generally, and fixing it for one NUC breaks for another NUC."
Comment 8 Cristian Iorga 2015-06-18 17:33:05 UTC
Hi Alex,

This bug should be re-tested, because PulseAudio has now been integrated into Sato. Can someone recheck this on master with core-image-sato image, please?
Comment 9 Tanu Kaskinen 2015-06-22 11:53:00 UTC
I had a look at the test case, and I have a couple of notes about it now that amixer goes through PulseAudio by default:

Setting the Master volume to 64 will result in very low volume, because PulseAudio exposes a very fine-grained volume scale. Since the success condition of the test is just that the command can be run without errors, maybe this doesn't matter.

The optional steps that modify the Speaker volume will not work, because PulseAudio doesn't expose a volume control named "Speaker".
Comment 10 Jussi Kukkonen 2015-08-27 15:04:06 UTC
Marking this NEEDINFO as it should be retested now that pulseaudio is handling things.

See Tanus comment 9 for possibly needed changes in the test procedure.
Comment 11 Jussi Kukkonen 2015-08-27 15:07:10 UTC
Tanu: if you think other tools than alsamixer (like some pulseaudio tool) should be used for tests like this, please comment.
Comment 12 Tanu Kaskinen 2015-08-27 16:48:21 UTC
My proposal would be to modify step 3 to use command "amixer set Master 30%", and to drop steps 5-7.

I chose 30%, because it's likely to be easily audible, but not annoyingly loud, although the exact loudness is very much hardware dependent.

I'm not proposing to use pulseaudio tools, because "amixer set Master 30%" has the nice feature that it will modify the default sink volume. Doing the same with pactl would require a bit more complicated scripting (first getting the default sink name, which requires grepping, and then another command for setting the volume of the default sink).
Comment 13 Stephen K Jolley 2015-09-14 16:27:44 UTC
Needinfo answer given.
Comment 14 Jussi Kukkonen 2015-09-15 08:37:55 UTC
Stephen, I marked it needinfo because it should be retested/re-evaluated. Tanus comment does not change that.


I'm resetting NEEDINFO. If there's actually another way I should be marking 'needs testing', please let me know.
Comment 15 Cristina Agurida 2015-09-16 14:11:43 UTC
Verified on latest master, and the issue is not present anymore. For better using it is good to set the value as a percentage just as Tanu said in the above comments.
Comment 16 Jussi Kukkonen 2015-09-17 08:03:36 UTC
That's fixed then, thanks Cristina.
Comment 17 Cristina Agurida 2015-09-17 08:15:29 UTC
As per last comments set it as verified.
Comment 18 oscar lopez arandas 2017-06-22 15:57:21 UTC
Created attachment 3840 [details]
qemux86_log
Comment 19 Jussi Kukkonen 2017-06-22 16:27:18 UTC
(In reply to comment #18)
> Created attachment 3840 [details]
> qemux86_log

wrong bug?