Skip to content

record voice calls when using headphones (or a headset) #2

@baptx

Description

@baptx

As I understand, this project only records audio though the microphone so the result would be similar to using another recording app that we start manually, for example gnome-sound-recorder (which will have the advantage to not miss recording the first seconds). Although, there is a large volume difference between the caller and callee so it would need post-processing.
It would be useful to have a way to record voice calls when using headphones (or a headset).

I tried these commands without luck using headphones (earphones) on the PinePhone with Mobian stable (bookworm) and the default modem firmware:

ffmpeg -f pulse -i alsa_output.platform-sound.HiFi__hw_PinePhone_0__sink.monitor record_output.mp3
ffmpeg -f alsa -i alsa_output.platform-sound.HiFi__hw_PinePhone_0__sink record_output.mp3
ffmpeg -f pulse -i alsa_output.platform-sound.Voice_Call__hw_PinePhone_0__sink.monitor record_output.mp3
ffmpeg -f alsa -i alsa_output.platform-sound.Voice_Call__hw_PinePhone_0__sink record_output.mp3

To get the audio source, I found the commands pacmd list-sinks on https://superuser.com/questions/1570333/how-can-i-record-audio-output-from-command-line-in-linux/1570367#1570367 and pactl list short sources on https://trac.ffmpeg.org/wiki/Capture/PulseAudio.

During a phone call, the input source alsa_output.platform-sound.HiFi__hw_PinePhone_0__sink is replaced by alsa_output.platform-sound.Voice_Call__hw_PinePhone_0__sink so we need to make the phone call first if we want to use this input source.
The alternative recording commands mentioned in the first link did not work either for me.

In the modem firmware documentation link https://wiki.pine64.org/images/1/1b/Quectel_EC2x%26EG9x%26EG2x-G%26EM05_Series_AT_Commands_Manual_V2.0.pdf that I found on https://wiki.pine64.org/index.php/PinePhone#AT_commands, I noticed a recording function "AT+QAUDRD Record Media File", maybe it can help?
Commands like echo 'AT+QAUDRD=1,"A.wav",13,0' | sudo atinout - /dev/ttyUSB2 - or echo 'AT+QAUDRD=1,"B.wav",13,1' | sudo atinout - /dev/ttyUSB2 - did not seem to record anything (the folder /data/ufs does not exist in my case).

Related issue: https://forum.pine64.org/showthread.php?tid=17048

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions