ubuntu-touch icon indicating copy to clipboard operation
ubuntu-touch copied to clipboard

The microphone does not work after a call, except for calls

Open stanwood77 opened this issue 2 years ago • 43 comments

General informations:

  • Device: Volla Phone
  • Channel: Stable
  • Build: OTA-23

Steps to reproduce

Open any app that uses microphone - except calls - a few hours after the last boot, and use it.

Expected behavior

The app / webpage is supposed to capture the sound normally

Actual behavior

There's no audio recording at all. For example, when capturing a video, there is only the image on playback, no sound. Recording via the Dictaphone application only records silence.

Sometimes plugging and unplugging a wired handsfree fixes the issue.

Microphone works again after a reboot (for 1 or 2 hours at least).

A complete reinstall did not fix the problem.

This seems to occur since OTA-23 release.

A few users on the French Telegram group, with various devices, confirmed the same problem (especially with FairPhone 3).

Logfiles and additional information

None

stanwood77 avatar Aug 05 '22 18:08 stanwood77

Microphone works again after a reboot (for 1 or 2 hours at least).

I recognize having noticed the phenomenon yesterday on my Volla (RC 54). However, since the restart about 21 hours ago, the audio recording is still active.

gbdomubpkm avatar Aug 06 '22 08:08 gbdomubpkm

Same for me with a FP3+

RedXXIII avatar Aug 07 '22 12:08 RedXXIII

So, maybe this always happens, after a phone call took place?

luksus42 avatar Aug 13 '22 20:08 luksus42

No idea if it's related, as phone calls is the only feature that is not affected by the microphone outage.

I will make some tests when I will be back in my country.

Le sam. 13 août 2022 à 22:01, luksus42 @.***> a écrit :

So, maybe this always happens, after a phone call took place?

— Reply to this email directly, view it on GitHub https://github.com/ubports/ubuntu-touch/issues/2022#issuecomment-1214214920, or unsubscribe https://github.com/notifications/unsubscribe-auth/APATS76CAI3UWCZB2YHRUZ3VY75KTANCNFSM55W3PW3Q . You are receiving this because you authored the thread.Message ID: @.***>

stanwood77 avatar Aug 14 '22 10:08 stanwood77

To put it simply, yes now as i have tested, I confirm that making a call breaks the use of the microphone on the Volla for the recorder and the camera.

gbdomubpkm avatar Aug 14 '22 11:08 gbdomubpkm

OK thank you. Nice to go further on a reliable diagnosis. I will share the info on the French Telegram group as well...

Le dim. 14 août 2022 à 13:03, gbdomubpkm @.***> a écrit :

To put it simply, yes now as i have tested, I confirm that making a call breaks the use of the microphone on the Volla for the recorder and the camera.

— Reply to this email directly, view it on GitHub https://github.com/ubports/ubuntu-touch/issues/2022#issuecomment-1214339398, or unsubscribe https://github.com/notifications/unsubscribe-auth/APATS76RTJ5QDDIEQQ7GZALVZDHBLANCNFSM55W3PW3Q . You are receiving this because you authored the thread.Message ID: @.***>

stanwood77 avatar Aug 14 '22 11:08 stanwood77

Impossible to say, however, since when this malfunction has been present: I restart my smartphone quite often so this bug has gone unnoticed on my side 😉

gbdomubpkm avatar Aug 14 '22 13:08 gbdomubpkm

Possible workaround without rebooting (from the ubports forum):

  1. Start a call (ringing is enough, no connection is not needed to be established).
  2. Start a record in the recorder.
  3. Stop the call.
  4. Stop the record.

luksus42 avatar Aug 18 '22 07:08 luksus42

@stanwood77 maybe we could change the issue topic name to The microphone does not work after a call except for calls ?

luksus42 avatar Aug 18 '22 07:08 luksus42

I don't confirm the workaround for the Volla : as i said on the forum, the recorder works only during ringing or a call. When ringing or the call is stopped, the microphone stop working. A reboot is necessary for the microphone works fully normally.

gbdomubpkm avatar Aug 18 '22 08:08 gbdomubpkm

I can confirm these issue also on OnePlus 5T. I've switched from stable to devel, but nothing changed with this issue.

playforvoices1 avatar Aug 19 '22 07:08 playforvoices1

I had again the problem of the stop of the microphone. I have this time tried restarting only lomiri via UT TT to see what happens : this does not unmute the microphone. Confirmation that only a restart or reboot solves the problem on the Volla.

Hello @Flohack74 . Is there a linux command line to re-enable the internal microphone?

gbdomubpkm avatar Aug 20 '22 09:08 gbdomubpkm

@stanwood77 maybe we could change the issue topic name to The microphone does not work after a call except for calls ?

I changed the title of the issue on your advice.

Still no reliable solution / workaround has been found so far....

Is there a path to resolution, or an initial diagnosis of the trouble?

stanwood77 avatar Aug 31 '22 21:08 stanwood77

Hi guys! I encounter this problem on Poco X3 NFC and Poco F1. Following @luksus42 idea - i wrote little script:

while true 
do
  status=$(pacmd list-source-outputs | awk 'NR == 1 {print $1}')
  if [[ $status -eq 0 ]]
  then
    checked=0
  fi
  if [[ $status > 0 && checked -eq 0 ]]
    then
    parecord -r > /dev/null &
    pid=$!
    sleep 1
    kill $pid
    checked=1
  fi
  sleep 2
done

Run it with nohup bash script.sh & - when running it will check if apps use mic and force pulseaudio to open mic directly.

niaproxy avatar Sep 13 '22 11:09 niaproxy

Thanks for your help. Can you please detail a little more in steps the procedure to test? What to do and when to do it?

gbdomubpkm avatar Sep 13 '22 12:09 gbdomubpkm

Thanks for your help. Can you please detail a little more in steps the procedure to test? What to do and when to do it?

Hi! Open terminal app on your phone and enter:


cat << EOF > sound-script.sh
while true 
do
  status=$(pacmd list-source-outputs | awk 'NR == 1 {print $1}')
  if [[ $status -eq 0 ]]
  then
    checked=0
  fi
  if [[ $status > 0 && checked -eq 0 ]]
    then
    parecord -r > /dev/null &
    pid=$!
    sleep 1
    kill $pid
    checked=1
  fi
  sleep 2
done
EOF

After that run it with nohup bash sound-script.sh &. System may ask permission to access mic - allow it. Now try using sound record app after mobile call. Run script at system start - with the way it works battery drag must be minimal.

niaproxy avatar Sep 13 '22 15:09 niaproxy

@stanwood77 maybe we could change the issue topic name to The microphone does not work after a call except for calls ?

I changed the title of the issue on your advice.

Still no reliable solution / workaround has been found so far....

Is there a path to resolution, or an initial diagnosis of the trouble?

Talking about diagnosis - i notice one thing: During call pacmd list-source-outputs don't show any apps using microphone.

I think Ofono-telepathy telephone stack used in Utouch speaks directly to hardware via libhybris and somehow break pulseaudio connect to it. And going back to OTA-23 release - when problem first appeared - there was some changes made for Bluetooth headset to work in calls. I will try to dig deeper.

niaproxy avatar Sep 13 '22 16:09 niaproxy

Thanks again for your work but, personally, I don't prefer to test right away because I won't really understand what I will do on my main stable phone. Is the script supposed to fix the mic issue on the camera and other apps ? Will the script launch automatically each time the smartphone is restarted or does the procedure have to be repeated each time? Even if it has nothing to do, maybe an automated procedure following this approach would be great for the time being : https://forums.ubports.com/topi/\6211/howto-alternate-way-of-saving-battery-when-using-4g-lte

gbdomubpkm avatar Sep 13 '22 17:09 gbdomubpkm

Thank you for the tip!

So if I well understand, I first copy - paste the big block in the terminal, and then "enter"?

And then, how do I do: "nohup bash sound-script.sh &" ? Also copy - paste this sequence in the terminal + "enter"?

Just a few questions:

Will this script resist to the next reboot?

Will this script resist to the next OTA update?

Will this script be merged in a future OTA update?

Anyway, a big hope to solve this very annoying issue. Thanks so much for this!

stanwood77 avatar Sep 13 '22 21:09 stanwood77

Thanks for feedback!

Is the script supposed to fix the mic issue on the camera and other apps ?

Yes.

To be clear - my solution is merely are workaround. Bug still need to be fixed. So no merge in upstream OTA.

Following @gbdomubpkm link i rewrite script from scratch and automated procedure via upstart - it much easier this way. Open terminal app on phone and copy-paste text inside blocks.

  1. Create script file in user home dir:
cat << EOF > /home/phablet/sound-script.sh
#!/bin/bash
interface=core.trust.dbus.Agent
member=AuthenticateRequestWithParameters

dbus-monitor --session "type=method_call,interface='${interface}',member='${member}'" |
while read -r line; do
      if [[ ${line} == *"string"* ]]; then
         parecord -r > /dev/null &
         pid=$!
         sleep 1
         kill $pid
      fi
done

EOF
  1. Make script executable chmod u+x sound-script.sh

  2. Create new upstart job

cat << EOF > /home/phablet/.config/upstart/check-audio.conf
description "Fix pulseaudio"

start on started pulseaudio
stop on stopped pulseaudio

exec /home/phablet/sound-script.sh
EOF
  1. Start the job start check-audio

or reboot phone

This script setup will launch after reboot and next OTA update.

niaproxy avatar Sep 14 '22 06:09 niaproxy

Thanks. It's exactly the right methodology and it's crystal clear. 👍 I tested only with the recorder for the moment and it's ok. I'll check more widely when I'm not at work. I referred to your work on the forum : https://forums.ubports.com/topic/8004/fp3-dev-channel-video-recording-no-audio/23

gbdomubpkm avatar Sep 14 '22 08:09 gbdomubpkm

Thank you @niaproxy

However I'm not able to run the step 3:

  1. I first did create the script with gedit and save it as "sound-script.sh" but I could not copy it directly in "Home" folder, so I put it in "Home/Downloads".

  2. From terminal I ran cd Downloads

  3. I successfully made chmod u+x sound-script.sh

  4. I modified the "new upstart job" line as follows: exec /home/phablet/Downloads/sound-script.sh

  5. I copy / paste in terminal in one block the whole "new upstart job" text in the terminal and pressed "enter" No return message was displayed. Complete return was:

phablet@ubuntu-phablet:~$ cat << EOF > /home/phablet/.config/upstart/check-audio.conf
> description "Fix pulseaudio"
> 
> start on started pulseaudio
> stop on stopped pulseaudio
> 
> exec /home/phablet/Downloads/sound-script.sh
> EOF
phablet@ubuntu-phablet:~$  start check-audio
check-audio stop/waiting
phablet@ubuntu-phablet:~$ 

  1. In terminal I ran: start check-audio

  2. I did reboot the device. Make an outgoing call, and tried to capture a video: Still no sound.

So I guess I've done something wrong (?)

Sorry for my poor technical level. Thank you for your help.

EDIT: Something has however improved: While microphone is down, now if I plug a handset, the microphone works again. If I unplug the handset, sound is STILL working. So with this workaround, no need to reboot the device. (at least on my last test).

stanwood77 avatar Sep 14 '22 19:09 stanwood77

Hi @stanwood77

First check if job running: status check-audio

Also check if dbus-monitor is working ps -A | grep dbus-monitor

And please provide output of pacmd list-sources I think Vollaphone handles sound in different way - maybe script need some adjustments.

niaproxy avatar Sep 14 '22 19:09 niaproxy

Thank you for your so quick answer.

So here's the return indications: (not that I ran it when mic is working (before any phone call))


phablet@ubuntu-phablet:~$ status check-audio
check-audio stop/waiting
phablet@ubuntu-phablet:~$ ps -A | grep dbus-monitor
phablet@ubuntu-phablet:~$ pacmd list-sources
4 source(s) available.
    index: 0
	name: <sink.primary_output.monitor>
	driver: <module-droid-card.c>
	flags: DECIBEL_VOLUME LATENCY 
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 1000
	volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 0 KiB
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	             Stéréo
	used by: 0
	linked by: 0
	fixed latency: 10,00 ms
	monitor_of: 0
	card: 0 <droid_card.primary>
	module: 4
	properties:
		device.description = "Monitor of Droid sink primary_output"
		device.class = "monitor"
		droid.hw_module = "primary"
		device.icon_name = "audio-card"
  * index: 1
	name: <source.droid>
	driver: <module-droid-card.c>
	flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME 
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 9000
	volume: front-left: 61680 /  94% / -1,58 dB,   front-right: 61680 /  94% / -1,58 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 0 KiB
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	             Stéréo
	used by: 0
	linked by: 0
	fixed latency: 20,00 ms
	card: 0 <droid_card.primary>
	module: 4
	properties:
		device.description = "Droid source droid"
		device.class = "sound"
		device.api = "droid-hal"
		droid.input.external = "true"
		droid.input.builtin = "true"
		droid.hw_module = "primary"
		device.icon_name = "audio-card"
	ports:
		input-builtin_mic: Input from builtin mic (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-bluetooth_sco_headset: Input from bluetooth sco headset (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-wired_headset: Input from wired headset (priority 200, latency offset 0 usec, available: no)
			properties:
				
		input-aux_digital: Input from aux digital (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-voice_call: Input from voice call (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-back_mic: Input from back mic (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-fm_tuner: Input from fm tuner (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-default: Input from default (priority 200, latency offset 0 usec, available: yes)
			properties:
				
		input-parking: Parking port (priority 50, latency offset 0 usec, available: yes)
			properties:
				
	active port: <input-builtin_mic>
    index: 2
	name: <sink.fake.sco.monitor>
	driver: <module-null-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 1000
	volume: mono: 65536 / 100% / 0,00 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 31 KiB
	sample spec: s16le 1ch 8000Hz
	channel map: mono
	             Mono
	used by: 0
	linked by: 0
	configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
	monitor_of: 1
	module: 7
	properties:
		device.description = "Monitor of Sortie vide"
		device.class = "monitor"
		device.icon_name = "audio-input-microphone"
    index: 3
	name: <source.fake.sco>
	driver: <module-null-source.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE 
	priority: 1000
	volume: mono: 65536 / 100% / 0,00 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 0,00 ms
	max rewind: 31 KiB
	sample spec: s16le 1ch 8000Hz
	channel map: mono
	             Mono
	used by: 0
	linked by: 0
	configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
	module: 8
	properties:
		device.description = "Null Input"
		device.class = "abstract"
		device.icon_name = "audio-input-microphone"
phablet@ubuntu-phablet:~$ 

stanwood77 avatar Sep 14 '22 19:09 stanwood77

Upstart indicates job not started, something must be wrong. Double check script content - notice what first line must be #!/bin/bash Double check all file paths with ls

On good news sound layout appears to be same as Poco's so nothing to change here.

You also can try launch script directly bash /home/phablet/Downloads/sound-script.sh if it will show any errors.

niaproxy avatar Sep 14 '22 19:09 niaproxy

First line of the script is: cat << EOF > sound-script.sh

Exactly as described on your tutorial. (I've just copy/paste all the lines)

Should I remove this line from the script?

stanwood77 avatar Sep 14 '22 20:09 stanwood77

На Wed, 14 Sep 2022 13:18:06 -0700, Steve писал:

First line of the script is: cat << EOF > sound-script.sh

Exactly as described on your tutorial.

Should I remove this line from the script?

Remove it. And last EOF too. I assume you will copy it directly in terminal not in gedit.

-- Sent with Dekko - the convergent email app

-- Sent with Dekko - the convergent email app

niaproxy avatar Sep 14 '22 20:09 niaproxy

Goaaal! It works! :+1:

Thank you so much!

I hope all of this will also help other (basic) users like me. And hope to see this implemented in a future OTA update.

Once again thank you @niaproxy

stanwood77 avatar Sep 14 '22 20:09 stanwood77

I must admit that I had also readjusted the scripts a little bit like the forum link that I put above, i.e. by deleting the two lines cat << EOF >..... and EOF scripts, once the scripts are created directly by copying the blocks into files using Fulvio's tedit OpenStore app and manually installing the files in the right places. And everything worked the first time and work well yet.

It's strange not to see this annoying bug referenced as a bug (in red) yet!

gbdomubpkm avatar Sep 15 '22 00:09 gbdomubpkm

Indeed. I assume this should be a critical P1 priority bug in terms of use constraints.

On the other hand, we don't know how many users are affected by this issue.

stanwood77 avatar Sep 15 '22 11:09 stanwood77