User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Thu Feb 27, 2020 7:59 am

Hello,
tvjon wrote:
Tue Feb 25, 2020 8:48 pm
I have had the mp3 conversion working, but alsa decided it wanted to only do it in mono, so more work still necessary I'm afraid. It would be nice to not have to cater for "special case" applications.
Is there some improvements that I could include in the code ?
Asar-v1.2.png
Asar-v1.2.png (40.05 KiB) Viewed 397 times
Pulsar33 wrote:The icon of the window differs when launch from the shell (left picture) or the taskbar shortcut (right picture)
However, the taskbar shortcut itself has the good icon ... :shock:
Does someone know why ?

BR
Pulsar33
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

tvjon
Posts: 751
Joined: Mon Jan 07, 2013 9:11 am

Re: RPi4 : How to record desktop audio ?

Thu Feb 27, 2020 10:06 am

Pulsar33 wrote:
Thu Feb 27, 2020 7:59 am
Hello,
...
Is there some improvements that I could include in the code ?

...
BR
Pulsar33
Bonjour Pulsar33,

Possibly, but I need time to check out a couple of ideas, & then formulate a question :)

I haven't done a lot with GTK, but perhaps there's some "theme" involved. Attached is what I see here.
Attachments
not-elliptical.png
not-elliptical.png (7.69 KiB) Viewed 384 times

User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Thu Feb 27, 2020 10:28 am

Well, sure it depends on the Window Manager and the settings.
Here is what I see on Mint 19-3 Desktop :
Asar-v1.2-Mint.png
Asar-v1.2-Mint.png (10.2 KiB) Viewed 375 times
No icon is displayed at all for any application, not only mine.

However, for one window manager and one setting, having two different look according to the way you launch the command is strange.
This is the case and I'm looking for the reason ...

Have a nice day
Pulsar33
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

tvjon
Posts: 751
Joined: Mon Jan 07, 2013 9:11 am

Re: RPi4 : How to record desktop audio ?

Fri Feb 28, 2020 1:31 pm

@Pulsar33,

In vlc, ctrl p

to see the pref's window.

Select Audio resampler & disable it as per attached png.

select Save

Try recording.
Attachments
disable-resampler.png
disable-resampler.png (63.54 KiB) Viewed 353 times

tvjon
Posts: 751
Joined: Mon Jan 07, 2013 9:11 am

Re: RPi4 : How to record desktop audio ?

Fri Feb 28, 2020 2:17 pm

Actually, you will probably need my modified .asoundrc
Attachments
.asoundrc.zip
(344 Bytes) Downloaded 12 times

User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Fri Feb 28, 2020 2:55 pm

Hi,

Will try to look at that this night ...

In the meantime, I've solved the icon problem :

Code: Select all

// V1.3   : use argv[0] to always find the icon file
BR
Pulsar33

PS : Warning => double-spaces in your .asoundrc file not compliant with Asar modification process
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Sun Mar 01, 2020 8:58 am

Hello,
The new .asoundrc creates a 44.1 khz mp3 file wathever the input audio format is (this is a good news)
=> I have better to remove the Sampling Rate chooser in Asar

Changing VLC preference is not necessary IMHO
This method works with MPV too (mp3 or wav 44.1 khz), and also with Chromium for Youtube videos (48 khz)
So, the problems we were facing at the beginning are solved ! Well done !

However, there's a problem I didn't notice before but which is there since the beginning
This method records one file for each audio source as soon as it starts playing.
There is no convenient way to synchronise the multiple recorded files, except the "poor" filetime solution.
And this needs postprocessing. In that sense, the initial request of the subject is not solved ...

Who's an idea ?
BR
Pulsar33
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

tvjon
Posts: 751
Joined: Mon Jan 07, 2013 9:11 am

Re: RPi4 : How to record desktop audio ?

Sun Mar 01, 2020 9:41 am

Bonjour Pulsar33.

Thank you again for your constructive feedback.

I don't have MPV installed currently, & rarely use VLC; in fact I use RPi 3's more for video, until the video section on Pi 4 is more mature. That way I don't have to waste time redoing things because of yet more system changes.

"However, there's a problem I didn't notice before but which is there since the beginning..."

Yes, I kept quiet about that, as I was sure you'd discover it, & wanted to read your thoughts about it first.

It occurred to me that it could be the basis of a poor man's multi-track recorder.

As you point out though, it could do with synchronisation: so lots to think about but so little time...

User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Mon Mar 02, 2020 3:57 pm

Hello,

Here is the simplest and improved version of Asar.
Asar-v1.4.png
Asar-v1.4.png (6.02 KiB) Viewed 251 times
You have to use the included .asoundrc_on file instead of the previous one
Asar-v1.4.zip
(5.35 KiB) Downloaded 12 times

Code: Select all

// V1.4   : remove Sampling Rate chooser and use new .asoundrc_on file
// V1.3   : use argv[0] to always find the icon file
No idea to solve the general problem of this thread (recording all sounds in the same file)
Best regards
Pulsar33
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

User avatar
Pulsar33
Posts: 174
Joined: Sun Aug 25, 2019 4:06 pm
Location: Bordeaux France

Re: RPi4 : How to record desktop audio ?

Wed Mar 04, 2020 8:00 am

Hello
bls wrote:
Thu Feb 20, 2020 12:54 am
You're correct that the source shouldn't matter. I wanted to check, though, because I found some references on some alsa web pages about some apps not picking up the default device correctly. I did my testing with Youtube on Chromium, and still mystified that it didn't work for you. Hoping to get back to it soon, sort out the play-while-recording question, and test it on more than one system :lol:
The .asoundrc solution has been explored and works but creates a new audio file as soon as an audio source starts playing, containing only this audio source and not the whole desktop audio. A simple GUI is available above.

@bls : did you find some improvement and have you some clue to help me succeeding with your method (or another one) ?

BR
Pulsar33
Pi 4 with 4Gb memory, DVB TV pHAT ------------------- Desktop : Core i5 Linux MINT 19.3

bls
Posts: 452
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: RPi4 : How to record desktop audio ?

Thu Mar 05, 2020 4:07 am

Pulsar33 wrote:
Wed Mar 04, 2020 8:00 am

@bls : did you find some improvement and have you some clue to help me succeeding with your method (or another one) ?

BR
Pulsar33
No, sorry, I've been tied up for the last 2 weeks. I'll try to get back to it in the next day or two.

Return to “Graphics, sound and multimedia”