[PATCH] bytcht-es8316: fix Speaker or Headphone no sound if enable Mic or Headset
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
Signed-off-by: youling257 youling257@gmail.com --- ucm2/codecs/es8316/EnableSeq.conf | 2 -- 1 file changed, 2 deletions(-)
diff --git a/ucm2/codecs/es8316/EnableSeq.conf b/ucm2/codecs/es8316/EnableSeq.conf index 551b79b..53bb115 100644 --- a/ucm2/codecs/es8316/EnableSeq.conf +++ b/ucm2/codecs/es8316/EnableSeq.conf @@ -1,6 +1,4 @@ # Disable all inputs / outputs -cset "name='Speaker Switch' off" -cset "name='Headphone Switch' off" cset "name='Headset Mic Switch' off" cset "name='Internal Mic Switch' off"
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
If we drop the default off of both switched and then shutdown the machine with no headphones inserted, so the speakers being used, then the 'Speaker Switch' on state will be saved on shutdown and restored on boot.
If we then boot with headphones inserted then AFAIK pulseaudio will run the global EnableSequence + the HeadPhones EnableSequence, leaving the 'Speaker Switch' on and now we get audio on both.
The problem seems to be that alsaucm not only runs the EnableSequence for the selected device but also the global one, which pulseaudio normally only does once at bootup.
I might be wrong here, maybe pulse will run the global EnableSeq + EnableSeq of active devices + DisableSeq of inactive devices when it starts. In that case the running of the DisableSeq of inactive devices will take care of turning off the speaker-switch when booting with the headphones inserted. In which case the default off of all switches can indeed be removed. Note in that case we should also remove the default off for the Headset + Internal Mic Switch, so a nack to this patch regardless.
Jaroslav, can you give us some guidance on how this is supposed to work ?
Also you say you use pulseaudio for your testing, AFAIK pulse does not suffer from the problem the alsaucm commands you mention do, so as long as you only use pulse things should work.
Regards,
Hans
Signed-off-by: youling257 youling257@gmail.com
ucm2/codecs/es8316/EnableSeq.conf | 2 -- 1 file changed, 2 deletions(-)
diff --git a/ucm2/codecs/es8316/EnableSeq.conf b/ucm2/codecs/es8316/EnableSeq.conf index 551b79b..53bb115 100644 --- a/ucm2/codecs/es8316/EnableSeq.conf +++ b/ucm2/codecs/es8316/EnableSeq.conf @@ -1,6 +1,4 @@ # Disable all inputs / outputs -cset "name='Speaker Switch' off" -cset "name='Headphone Switch' off" cset "name='Headset Mic Switch' off" cset "name='Internal Mic Switch' off"
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
2020-04-14 16:07 GMT+08:00, Jaroslav Kysela perex@perex.cz:
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an
idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
please remove es8316 cx2072x rt5672 Disable all inputs / outputs.
2020-04-15 14:26 GMT+08:00, youling 257 youling257@gmail.com:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
2020-04-14 16:07 GMT+08:00, Jaroslav Kysela perex@perex.cz:
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an
idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Hi,
On 4/15/20 8:30 AM, youling 257 wrote:
please remove es8316 cx2072x rt5672 Disable all inputs / outputs.
No not going to happen. We need sane defaults.
There is something wrong with your setup lets try to figure out what is wrong rather then change these UCM profiles in a way which only makes things worse.
Regards,
Hans
2020-04-15 14:26 GMT+08:00, youling 257 youling257@gmail.com:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
2020-04-14 16:07 GMT+08:00, Jaroslav Kysela perex@perex.cz:
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an
idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Hi,
On 4/15/20 8:26 AM, youling 257 wrote:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
Which version of pulseaudio does the Ubuntu you are using have?
There was a bug in pulseaudio 13.99.1 wrt the handling of UCM profiles. The pulseaudio from Fedora 31 updates has a fix for this, maybe Ubuntu's version is missing this fix?
Regards,
Hans
2020-04-14 16:07 GMT+08:00, Jaroslav Kysela perex@perex.cz:
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an
idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
2020-04-15 16:04 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 8:26 AM, youling 257 wrote:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
Which version of pulseaudio does the Ubuntu you are using have?
pulseaudio (1:13.99.1-1ubuntu2) packages.ubuntu.com/focal/pulseaudio what patch?
There was a bug in pulseaudio 13.99.1 wrt the handling of UCM profiles. The pulseaudio from Fedora 31 updates has a fix for this, maybe Ubuntu's version is missing this fix?
Regards,
Hans
2020-04-14 16:07 GMT+08:00, Jaroslav Kysela perex@perex.cz:
Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):
Hi,
On 4/13/20 4:59 PM, youling257 wrote:
alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Mic, Speaker will no sound. alsaucm -c bytcht-es8316 set _verb HiFi set _enadev Headset, Headphone will no sound.
I see the problem, so the idea of the global EnableSequence is to set defaults and then the EnableSequence of currently active devices run on top.
It's ok, it's just a wrong use of the alsaucm command. The PA should activate HiFi verb only once. Those two commands run the verb EnableSequence twice.
The correct test should be:
alsaucm -i -c bytcht-es8316 set _verb HiFi alsaucm>> set _enadev Speaker alsaucm>> set _enadev Headphone alsaucm>> set _enadev Mic alsaucm>> set _enadev Headset
... you may run the enable commands with a delay for tests.
The current UCM is designed for one task (application). I am playing with an
idea to extend the alsactl state daemon to preserve the UCM settings and state for multiple applications using an RPC mechanism (dbus?).
Jaroslav
-- Jaroslav Kysela perex@perex.cz Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Hi,
On 4/15/20 10:18 AM, youling 257 wrote:
2020-04-15 16:04 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 8:26 AM, youling 257 wrote:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
Which version of pulseaudio does the Ubuntu you are using have?
pulseaudio (1:13.99.1-1ubuntu2) packages.ubuntu.com/focal/pulseaudio
Ah yes then you are likely hitting the bug I was talking about.
Can you please file a bug against Ubuntu for this?
Here is the original Fedora bug for this: https://bugzilla.redhat.com/show_bug.cgi?id=1818883
And here are the patches fixing it: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/276/
Regards,
Hans
2020-04-15 16:45 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 10:18 AM, youling 257 wrote:
2020-04-15 16:04 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 8:26 AM, youling 257 wrote:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
Which version of pulseaudio does the Ubuntu you are using have?
pulseaudio (1:13.99.1-1ubuntu2) packages.ubuntu.com/focal/pulseaudio
Ah yes then you are likely hitting the bug I was talking about.
Can you please file a bug against Ubuntu for this?
open a bug, https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1872970
Here is the original Fedora bug for this: https://bugzilla.redhat.com/show_bug.cgi?id=1818883
And here are the patches fixing it: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/276/
Regards,
Hans
Hi,
On 4/15/20 4:50 PM, youling 257 wrote:
2020-04-15 16:45 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 10:18 AM, youling 257 wrote:
2020-04-15 16:04 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Hi,
On 4/15/20 8:26 AM, youling 257 wrote:
boot enter ubuntu no sound at all if EnableSeq.conf disable all output. “ The PA should activate HiFi verb only once.” i don't think so.
Which version of pulseaudio does the Ubuntu you are using have?
pulseaudio (1:13.99.1-1ubuntu2) packages.ubuntu.com/focal/pulseaudio
Ah yes then you are likely hitting the bug I was talking about.
Can you please file a bug against Ubuntu for this?
open a bug, https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1872970
Great, thank you.
Regards,
Hans
2020-04-13 23:46 GMT+08:00, Hans de Goede hdegoede@redhat.com:
Also you say you use pulseaudio for your testing, AFAIK pulse does not suffer from the problem the alsaucm commands you mention do,
I said "remove the EnableSeq.conf Disable all output, i can get speaker and headphone work on ubuntu focal with pulseaudio."
so as long as you only use pulse things should work.
Disable all inputs / outputs, pulseaudio sound not work.
Regards,
Hans
Signed-off-by: youling257 youling257@gmail.com
ucm2/codecs/es8316/EnableSeq.conf | 2 -- 1 file changed, 2 deletions(-)
diff --git a/ucm2/codecs/es8316/EnableSeq.conf b/ucm2/codecs/es8316/EnableSeq.conf index 551b79b..53bb115 100644 --- a/ucm2/codecs/es8316/EnableSeq.conf +++ b/ucm2/codecs/es8316/EnableSeq.conf @@ -1,6 +1,4 @@ # Disable all inputs / outputs -cset "name='Speaker Switch' off" -cset "name='Headphone Switch' off" cset "name='Headset Mic Switch' off" cset "name='Internal Mic Switch' off"
participants (4)
-
Hans de Goede
-
Jaroslav Kysela
-
youling 257
-
youling257