I found everywhere but these steps helped me to resolve my issue of connecting my earphones to both my mobile and ubuntu laptop at same time.
If your Bluetooth earphones connected successfully but are not showing up in the output section of the sound settings, you can try the following steps to troubleshoot the issue:
Check for updates: Make sure your Ubuntu system is up to date. Open a terminal and run the following commands:
sudo apt update
sudo apt upgrade
Restart Bluetooth services: Restart the Bluetooth services by running these commands in the terminal:
sudo systemctl restart bluetooth
sudo /etc/init.d/bluetooth restart
Install additional Bluetooth packages: Make sure all necessary Bluetooth packages are installed. Run the following commands in the terminal:
sudo apt install --reinstall pulseaudio-module-bluetooth
sudo apt install bluez blueman pavucontrol
Restart PulseAudio: Restart the PulseAudio sound server by running these commands:
pulseaudio -k
pulseaudio --start
Connect your earphones: If you haven't connected your earphones already, do so now by going to the Bluetooth settings in the system settings menu. If you have already connected them, disconnect and reconnect them.
Check sound settings: Open the sound settings and see if your earphones are now listed as an output device. If they are still not showing up, open PulseAudio Volume Control (pavucontrol) and check under the "Configuration" tab if your earphones are listed and set to the correct profile (usually "High Fidelity Playback (A2DP)"). If you don't have pavucontrol installed, you can install it using the command:
sudo apt install pavu