How to play audio from ffmpeg?
#1
Hi

System Mobian.
I run in terminal
ffmpeg -i file.wav -f alsa hw:0
but nothing is heard

How to configure?
How to switch between handset and loudspeaker?
  Reply
#2
Use -f pulse, not -f alsa. You want to output through PulseAudio/Pipewire, not directly through ALSA, because the raw ALSA device is normally already opened and reserved by PulseAudio or Pipewire. (Note that Pipewire supports the PulseAudio protocol, so -f pulse will work for both.)
  Reply
#3
(08-28-2023, 05:59 PM)Kevin Kofler Wrote: Use -f pulse, not -f alsa. You want to output through PulseAudio/Pipewire, not directly through ALSA, because the raw ALSA device is normally already opened and reserved by PulseAudio or Pipewire. (Note that Pipewire supports the PulseAudio protocol, so -f pulse will work for both.)

I did as you wrote, but still no sound.


Attached Files Thumbnail(s)
   
  Reply
#4
The file is "xxx.way" or "xxx.wav"?
  Reply
#5
(08-29-2023, 08:27 AM)Gumur Wrote: The file is "xxx.way" or "xxx.wav"?
Of course xxx.wav :-) My mistake.

(08-28-2023, 05:59 PM)Kevin Kofler Wrote: Use -f pulse, not -f alsa. You want to output through PulseAudio/Pipewire, not directly through ALSA, because the raw ALSA device is normally already opened and reserved by PulseAudio or Pipewire. (Note that Pipewire supports the PulseAudio protocol, so -f pulse will work for both.)

Unfortunately using pulse still doesn't work.
I installed Kali System and it plays sound on the speaker using alsa and pulse.
How do I switch to built-in headphones?
  Reply
#6
What do you mean by "built-in headphones"? The earpiece? Or the headphone port (but then the headphones are not "built-in", only the port is)?

The former can be selected with:
pactl set-sink-port 0 '[Out] Earpiece'
the latter with:
pactl set-sink-port 0 '[Out] Headphones'
and to switch back to the speaker, use:
pactl set-sink-port 0 '[Out] Speaker'
  Reply
#7
(08-29-2023, 07:31 PM)Kevin Kofler Wrote: What do you mean by "built-in headphones"? The earpiece? Or the headphone port (but then the headphones are not "built-in", only the port is)?

The former can be selected with:
pactl set-sink-port 0 '[Out] Earpiece'
the latter with:
pactl set-sink-port 0 '[Out] Headphones'
and to switch back to the speaker, use:
pactl set-sink-port 0 '[Out] Speaker'

Yes, I mean the earpiece.
  Reply
#8
(08-30-2023, 02:18 AM)Manieck71 Wrote:
(08-29-2023, 07:31 PM)Kevin Kofler Wrote: What do you mean by "built-in headphones"? The earpiece? Or the headphone port (but then the headphones are not "built-in", only the port is)?

The former can be selected with:
pactl set-sink-port 0 '[Out] Earpiece'
the latter with:
pactl set-sink-port 0 '[Out] Headphones'
and to switch back to the speaker, use:
pactl set-sink-port 0 '[Out] Speaker'

Yes, I mean the earpiece.
Thank you, it works!
  Reply
#9
It works on Kali and Ubuntu but won't work on Mobian.
I have silence all the time
  Reply
#10
Well, open up a volume control GUI (on Plasma Mobile, it is in the settings under "Audio", I don't know where it is on Phosh) and check that the earpiece is not muted and that its volume is not zero. Normally, if you set a reasonable volume once, it should remember it next time you switch to the earpiece. Though I have seen various volume control bugs resetting some volumes to zero for whatever reason, so I cannot promise that it will not end up back at zero at some point in the future.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Modem audio settings jack1 2 1,790 02-04-2023, 04:01 PM
Last Post: jack1
  3.5mm jack audio quality? orbital 3 2,546 06-27-2022, 02:05 AM
Last Post: wibble
  scratchy phone audio KABA 3 3,746 06-24-2021, 01:15 PM
Last Post: jameslauren11
  Audio quality GloriousCoffee 5 8,153 10-24-2020, 12:00 PM
Last Post: GloriousCoffee

Forum Jump:


Users browsing this thread: 2 Guest(s)