Skip to contentSkip to conversation

bytcht-es8316: fix Speaker or Headphone no sound if enable Mic or Headset

PATCH In review youling257 3 participants 12 messages Apr 13, 2020 – Apr 15, 2020

lore
Share & tools
lore

youling257

author
#0 lore raw

PATCH 1/1 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.

---
 ucm2/codecs/es8316/EnableSeq.conf | 2 --
 1 file changed, 2 deletions(-)
ucm2/codecs/es8316/EnableSeq.conf +0 -2
index 551b79b..53bb115 100644
@@ -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"
 
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 2 lines · 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

Quoted 18 lines
---
  ucm2/codecs/es8316/EnableSeq.conf | 2 --
  1 file changed, 2 deletions(-)
ucm2/codecs/es8316/EnableSeq.conf +0 -2
index 551b79b..53bb115 100644
@@ -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"
 
#2 lore raw

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 9 lines

Hi,

Quoted 2 lines · 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

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#3 lore raw

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 <[email protected]>:

Quoted 39 lines

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 11 lines

Hi,

Quoted 4 lines · 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 <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

#4 lore raw

please remove es8316 cx2072x rt5672 Disable all inputs / outputs.

2020-04-15 14:26 GMT+08:00, youling 257 <[email protected]>:

Quoted 48 lines

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 <[email protected]>:

Quoted 42 lines

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 9 lines

Hi,

Quoted 5 lines · 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.

Quoted 3 lines

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 <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

#5 lore raw

Hi,

Quoted 1 line · 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

Quoted 51 lines

2020-04-15 14:26 GMT+08:00, youling 257 <[email protected]>:

Quoted 48 lines

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 <[email protected]>:

Quoted 42 lines

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 9 lines

Hi,

Quoted 5 lines · 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.

Quoted 3 lines

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 <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

#6 lore raw
In reply to youling 257

Hi,

Quoted 2 lines · 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

Quoted 43 lines

2020-04-14 16:07 GMT+08:00, Jaroslav Kysela <[email protected]>:

Quoted 39 lines

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 11 lines

Hi,

Quoted 4 lines · 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 <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

#7 lore raw

2020-04-15 16:04 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 7 lines

Hi,

Quoted 2 lines · 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?

Quoted 62 lines

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

Quoted 46 lines

2020-04-14 16:07 GMT+08:00, Jaroslav Kysela <[email protected]>:

Quoted 42 lines

Dne 13. 04. 20 v 17:46 Hans de Goede napsal(a):

Quoted 9 lines

Hi,

Quoted 5 lines · 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.

Quoted 3 lines

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 <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

#8 lore raw

Hi,

Quoted 9 lines · On 4/15/20 10:18 AM, youling 257 wrote:

2020-04-15 16:04 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 7 lines

Hi,

Quoted 2 lines · 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

#9 lore raw

2020-04-15 16:45 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 10 lines

Hi,

Quoted 7 lines · On 4/15/20 10:18 AM, youling 257 wrote:

2020-04-15 16:04 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 6 lines

Hi,

Quoted 2 lines · 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.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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

Quoted 11 lines

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

#10 lore raw

Hi,

Quoted 11 lines · On 4/15/20 4:50 PM, youling 257 wrote:

2020-04-15 16:45 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 10 lines

Hi,

Quoted 7 lines · On 4/15/20 10:18 AM, youling 257 wrote:

2020-04-15 16:04 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 6 lines

Hi,

Quoted 2 lines · 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.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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

#11 lore raw
In reply to Hans de Goede

2020-04-13 23:46 GMT+08:00, Hans de Goede <[email protected]>:

Quoted 3 lines

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."

Quoted 2 lines

so as long as
you only use pulse things should work.

Disable all inputs / outputs, pulseaudio sound not work.

Quoted 28 lines

Regards,

Hans

Quoted 19 lines
---
  ucm2/codecs/es8316/EnableSeq.conf | 2 --
  1 file changed, 2 deletions(-)
ucm2/codecs/es8316/EnableSeq.conf +0 -2
index 551b79b..53bb115 100644
@@ -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"