How to record what the PC is playing?

New to Puppy and have questions? Start here

Moderator: Forum moderators

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing

Post by number77 »

backi wrote: Fri Jun 03, 2022 5:08 pm

@number77 :
Just in Case.......
To run Pulseaudio/Pavucontrol as root you have to type into Terminal:
pulseaudio -D

root# pulseaudio -D
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [pulseaudio] main.c: Daemon startup failed.

Any ideas

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing

Post by number77 »

bigpup wrote: Thu Jun 02, 2022 10:50 pm

pMusic
https://forum.puppylinux.com/viewtopic.php?t=5801

Try using pMusic -> PlayQueue -> Export Tracks in Queue.....

Problem is the stream is not being played in pmusic so does not appear in the playqueue

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 375 times
Been thanked: 1314 times
Contact:

Re: How to record what the PC is playing

Post by fredx181 »

number77 wrote: Fri Jun 03, 2022 5:18 pm
backi wrote: Fri Jun 03, 2022 5:08 pm

@number77 :
Just in Case.......
To run Pulseaudio/Pavucontrol as root you have to type into Terminal:
pulseaudio -D

root# pulseaudio -D
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [pulseaudio] main.c: Daemon startup failed.

Any ideas

For me pulseaudio --start works as root, you may get a warning "not supposed to run as root" but it's just a warning.
Btw, I think @wiak meant recording output directly from the soundcard, so probably is what you want.
You can try the capturing with ffmpeg that I posted about earlier too (with just Alsa), works great for me.
EDIT: Also you may want to try the application from @rcrsn51, required is also "lame" installed, see here: https://forum.puppylinux.com/viewtopic. ... 729#p58729
EDIT2: modification of rcrsn51's package that works better for me: https://forum.puppylinux.com/viewtopic. ... 764#p58764

User avatar
bigpup
Moderator
Posts: 6999
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 913 times
Been thanked: 1528 times

Re: How to record what the PC is playing

Post by bigpup »

number77 wrote: Fri Jun 03, 2022 5:29 pm
bigpup wrote: Thu Jun 02, 2022 10:50 pm

pMusic
https://forum.puppylinux.com/viewtopic.php?t=5801

Try using pMusic -> PlayQueue -> Export Tracks in Queue.....

Problem is the stream is not being played in pmusic so does not appear in the playqueue

It is not going to work unless you are using pMusic to play it.

pMusic can play stuff from many different sources.

Well it works OK for me.

Did you do the check for missing needed dependency stuff?
Help -> Dependency Check

This is my results:
.

Screenshot(1).jpg
Screenshot(1).jpg (43.43 KiB) Viewed 1915 times

.
You can see I do not have all possible ones, but I do have the minimum needed.
I mostly record from radio streams.

Also when you are playing something it will be listed in the pMusic main window on the right side list of stuff.
Right click on the one playing and choose send to export.
In the Export window make selections and click on Export button at bottom to start recording.

In main pMusic window:
Connecting to a streaming location on the internet can take a little time from when you select one.
(Select from left list by double clicking on listed item).
So if you select one and it shows on the right side list in the main pMusic window.
The one with the green arrow on it is trying to connect.
Should turn the middle button at the bottom to a play button.
Click it to play.
May have to do it several different times before it starts playing because it is not fully connected to the location yet.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing?

Post by number77 »

My dependency check came out as follows.

Attachments
capture12421.png
capture12421.png (89.07 KiB) Viewed 1892 times
User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How to record what the PC is playing

Post by wiak »

fredx181 wrote: Fri Jun 03, 2022 5:31 pm

Btw, I think @wiak meant recording output directly from the soundcard, so probably is what you want.
You can try the capturing with ffmpeg that I posted about earlier too (with just Alsa), works great for me.

Yes, indeed, I was explaining how to record from soundcard (and particularly if you have pulseaudio installed and working), which is what I believe mikewalsh was also having difficulties with. Alsa method can also be used, per fredx181 comments, though may depend on your system and what controls you find in alsamixer.

Of course there is also the method of using something like steamripper to rip digital streams from the Internet, but that is an entirely different thing! (though I leave it to others to explain the difference - fact is, you won't always be able to find a stream to rip, but recording directly from soundcard can always be used)

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How to record what the PC is playing

Post by wiak »

number77 wrote: Fri Jun 03, 2022 4:47 pm

I don't really want to record from the speakers as they are analogue so you can hear them with ears.
Also I didn't think digital microphones exist, they are analogue and need to be converted to digital with an analogue to digital converter for use on the pc. So inferior quality unless A/D converter costs a fortune. Not usually the case in PCs.

Well of course a microphone and speakers are analogue devices! I was using the names my HP laptop gives the pulseaudio streams, which is 'digital microphone' and 'Speakers'. No time to state the obvious and not important to my post.
Recording streams via streamripper is old news and obvious - that's what Pmusic is acting as a frontend to, but OP was talking about the likes of Audacity recording from soundcard as far as I understood it, and later posters such as mikewalsh were certainly referring to that, which is what my answer was about. Just ask rockedge to delete my post if you think it is confusing or not useful to anyone else on this forum. That will be fine.

EDIT: okay, I see now you wanted digital. I suspect I noticed the posts following that. Just have my post deleted will clear any confusion up. I can do that (mind you I think a ton of posts in this thread would have to be removed too, since many are not concerning themselves with ripping internet streams).

Note that digital streams do not 'clip' (unless scaled up to high digitally) since just binary numbers and not analogue, of course. Also, I stand by my comment that just because you hear sound from your PC doesn't mean you can get a digital stream for it - not that I know anyway - different when it is an Internet radio 'stream' of course, which steamripper will rip exactly for you.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@wiak :-

No, I know how to use PulseAudio, Will.....but I do NOT have it installed anywhere. Can't stand it, TBH; hate the damn thing.

See, I can record any 'live' stream.....like through the webcam's microphones, or through my headset's mike. But what's giving ME problems is trying to capture any output that's playing through the main, system card.....whether from a music app, or on t'internet. I tried Fred's suggestion last night, but that just gives me a blank file at the end of it. The file is created, but it has no content. Even Bill's alsa-capture thingy doesn't work for me; same result.....the file is created, and 'Properties' says there's something there, but there's no discernible content to it.

In fact, when using alsa-capture, I got a terminal message saying there was a binary mis-match.....which I can't understand, because Bill's package is just a bunch of scripts. There's no 'binary' items at all. Unless it IS designed to work only with a 64-bit OS; I was trying it out in 32-bit Xenialpup 7.5, so.....I don't really know.

There's a couple of items in the included .asoundrc.capture file which look to be identified by some numerical code; are these 'descriptors' of some sort for strictly 64-bit items? Or are they specific to Bill's own hardware?

Code: Select all

# output device
pcm.loopout {
    type dmix
    ipc_key 328211
    slave.pcm "hw:Loopback,0,0"
}

# input device
pcm.loopin {
    type dsnoop
    ipc_key 686592
    slave.pcm "hw:Loopback,1,0"
}

Hm. Just had a thought. I would need to modify those card identifiers to match where my own 'loopback' device is. I've literally just this second realised that the included file gives hw:1.0.....whereas my own is at either hw:4,0 OR hw:4,1. (Of course, Fred's own ffmpeg command would also need modifying, too. I must be going 'brain-dead'..! :roll: )

Let's see what happens.....

Mike. ;)

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How to record what the PC is playing?

Post by wiak »

mikewalsh wrote: Sat Jun 04, 2022 11:40 am

Hm. Just had a thought. I would need to modify those card identifiers to match where my own 'loopback' device is. I've literally just this second realised that the included file gives hw:1.0.....whereas my own is either w:4,0 OR hw:4,1. (Of course, Fred's own ffmpeg command would also need modifying, too. I must be going 'brain-dead'..! :roll:

Let's see what happens.....

Mike. ;)

It's too hard! I give up. ;-)

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

wiak wrote: Sat Jun 04, 2022 11:43 am
mikewalsh wrote: Sat Jun 04, 2022 11:40 am

Hm. Just had a thought. I would need to modify those card identifiers to match where my own 'loopback' device is. I've literally just this second realised that the included file gives hw:1.0.....whereas my own is either w:4,0 OR hw:4,1. (Of course, Fred's own ffmpeg command would also need modifying, too. I must be going 'brain-dead'..! :roll:

Let's see what happens.....

Mike. ;)

It's too hard! I give up. ;-)

^^^ Lololol!! Join the club, mate..... :D That's exactly how I've been feeling about it for long enough..!

Mike. ;)

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 375 times
Been thanked: 1314 times
Contact:

Re: How to record what the PC is playing?

Post by fredx181 »

Don't give up !!!
Ok , I'll try to come to the resque :mrgreen: (see below)

wiak wrote:

EDIT: okay, I see now you wanted digital. I suspect I noticed the posts following that. Just have my post deleted will clear any confusion up

I see recording directly from the soundcard as "digital" as can be, but ok opinions may differ.

@mikewalsh , the approach I suggested with ffmpeg and modified .asoundrc depends on that the soundcard is "card 0" (or hw:0,0) to work properly, sorry should have mentioned that, perhaps your soundcard is card 1 or card 2, or 3 ? .
Bill's program should work OK btw, the important thing is that before you start capturing (where it says "press Enter") the application playing the audio e.g. browser should be restarted (if already active) to make use of the new created ~/.asoundrc.
Anyway... please try my new modification of Bill's program, it gives choice of which soundcard to use and some other fixes: https://forum.puppylinux.com/viewtopic. ... 764#p58764
Required is "lame" to be installed (and alsa-utils, but that's probably standard installed already).

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

@mikewalsh: I tried the alsa-capture thingy in Xenial and it works. So here are some trouble-shooting suggestions.

1. Run it on a different machine so you can see how it should work.
2. Run it on the Xenial machine with a temporary clean install. I don't know what you mean by "my own loopback device".
3. Take a screen shot of the terminal window with the "binary mismatch" error message.
4. When you ran it, did you see the volume meter in action or did it abort right away?
5. Did the resulting mp3 file have non-zero length?
6. I doubt if changing numbers in the .asoundrc.capture will fix anything.

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How to record what the PC is playing?

Post by wiak »

fredx181 wrote: Sat Jun 04, 2022 3:17 pm
wiak wrote:

EDIT: okay, I see now you wanted digital. I suspect I noticed the posts following that. Just have my post deleted will clear any confusion up

I see recording directly from the soundcard as "digital" as can be, but ok opinions may differ.

Actually I'm not sure either. Depends if original audio stream already gone through a DAC (digital to analog convertor stage) at soundcard and then loopback sampled at some frequency or other prior to these samples being converted back to digital, which would lose some audio quality. Don't ask me why that might be.... I have not read up on it so just guessing. Read this now, but still not sure if DAC involved in what we are discussing:

https://www.makeuseof.com/what-is-a-sound-card/

When your computer plays audio, it sends a signal to the sound card via the PCIe interface. That signal passes through the DAC before being pumped out of the output connection.

Recording audio on your computer follows the same process but in reverse. Your sound card receives signals via the input connection. It's then converted in 1s and 0s via the ADC. Afterward, the card sends the signal through the PCIe into your CPU for processing.

The question is: does loopback mean going through DAC, sampled, and then loopback via ADC... that would be a quality-loss issue.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing

Post by number77 »

wiak wrote: Sat Jun 04, 2022 11:00 am
number77 wrote: Fri Jun 03, 2022 4:47 pm

I don't really want to record from the speakers as they are analogue so you can hear them with ears.
Also I didn't think digital microphones exist, they are analogue and need to be converted to digital with an analogue to digital converter for use on the pc. So inferior quality unless A/D converter costs a fortune. Not usually the case in PCs.

Well of course a microphone and speakers are analogue devices! I was using the names my HP laptop gives the pulseaudio streams, which is 'digital microphone' and 'Speakers'. No time to state the obvious and not important to my post.
Recording streams via streamripper is old news and obvious - that's what Pmusic is acting as a frontend to, but OP was talking about the likes of Audacity recording from soundcard as far as I understood it, and later posters such as mikewalsh were certainly referring to that, which is what my answer was about. Just ask rockedge to delete my post if you think it is confusing or not useful to anyone else on this forum. That will be fine.

EDIT: okay, I see now you wanted digital. I suspect I noticed the posts following that. Just have my post deleted will clear any confusion up. I can do that (mind you I think a ton of posts in this thread would have to be removed too, since many are not concerning themselves with ripping internet streams).

Note that digital streams do not 'clip' (unless scaled up to high digitally) since just binary numbers and not analogue, of course. Also, I stand by my comment that just because you hear sound from your PC doesn't mean you can get a digital stream for it - not that I know anyway - different when it is an Internet radio 'stream' of course, which steamripper will rip exactly for you.

It's a problem to me knowing how to get original digital stream.
I will have a look at streamripper.
Your HP laptop has a digital mic, but that is probably an analogue mic feeding in to an analogue to digital convertor to be called a digital mic. HP may use the best a/d converters but also may not.
If there is an a/d converter is the loop I would like it to be the best that say, the BBC, uses. So I need an original stream.

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 375 times
Been thanked: 1314 times
Contact:

Re: How to record what the PC is playing?

Post by fredx181 »

wiak wrote:

The question is: does loopback mean going through DAC, sampled, and then loopback via ADC... that would be a quality-loss issue.

Ok, let there be some quality loss, but still the quality is nearly perfect when recording from soundcard, perhaps only real audiophiles will complain, btw streams on the web almost always are using compressed format e.g. mp3, mp4, ogg etc.., so not for audiophiles anyway.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

@number77: Here is a project for you:

1. Select a Youtube video with good quality audio.
2. Use a Youtube downloader app to download the audio track.
3. Use a tool like alsa-capture to play the video and capture the audio.
4. Play each file with good headphones.
5. See if you can detect a significant difference.

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing?

Post by number77 »

fredx181 wrote: Sat Jun 04, 2022 5:38 pm
wiak wrote:

The question is: does loopback mean going through DAC, sampled, and then loopback via ADC... that would be a quality-loss issue.

Ok, let there be some quality loss, but still the quality is nearly perfect when recording from soundcard, perhaps only real audiophiles will complain, btw streams on the web almost always are using compressed format e.g. mp3, mp4, ogg etc.., so not for audiophiles anyway.

I know what you mean but the best streams do use flac and bbc streams are pretty good. While my ears still work ok I would like to record best quality then compromise if I have to.
I have a usb sound card with digital input and it gives brilliant quality with Audacity but it's problem is it works on XP and I use linux all the time so it is not a simple process to record, needs reboot into xp then record.
If it's playing on my pc there must be a way to record in original digital quality.

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@rcrsn51 :-

rcrsn51 wrote: Sat Jun 04, 2022 3:17 pm

@mikewalsh: I tried the alsa-capture thingy in Xenial and it works. So here are some trouble-shooting suggestions.

1. Run it on a different machine so you can see how it should work.
2. Run it on the Xenial machine with a temporary clean install. I don't know what you mean by "my own loopback device".
3. Take a screen shot of the terminal window with the "binary mismatch" error message.
4. When you ran it, did you see the volume meter in action or did it abort right away?
5. Did the resulting mp3 file have non-zero length?
6. I doubt if changing numbers in the .asoundrc.capture will fix anything.

Let me answer these for you, Bill, then I'll explain what happened. It DOES work - beautifully! - but it wasn't the software, OR hardware, that was at fault.....it was me. :oops:

  • 1. I used my "daily driver" for this.....Barry's old Quirky64 April 7.0.1.

  • 2. I ran it in Xenial 7.5, too, though I didn't need a clean install.....just a clear head that wasn't acting as though it was stuffed with cotton wool! What I meant by "my own loopback device" was what appeared after using BootManager to load the "snd_aloop" module at boot; not one, but TWO 'loopback' devices.....each with 8 separate sub-devices. VERY confusing. I've now removed the "snd_aloop" module, because with your package I no longer need it.

  • 3. I don't quite know how or why that "binary mismatch" message popped-up. At any rate, I can't duplicate it.

  • 4. The VU meter shows as fully operational. That's all working as it should.

  • 5. The /root/alsa-capture.mp3 file had a fair amount of data in it; the test ran for a couple of minutes or more, and was nearly 2 MB in total.

  • 6. As you say; no need to change anything.

------------------------------------

Like I said; no fault attaches to the hardware, or your package. The fault lay with my not understanding quite what was going on, AND with the way I run my default audio player.

To clarify.....

I use DeaDBeeF as my default audio player - specifically, the 'portable' package I built, which is shared between several Pups, though that's not relevant here.

One thing that DeaDBeeF will let you do is to set it so that, when you 'close' it, it minimizes down to an icon in the notification area on the right side of the tray.....having done which, you can then control it from the tray-icon's context menu. Now, I usually start it shortly after booting for the day, and listen to a bit of music while catching up on the various forums I belong to. I then 'switch it off', but for the best part of the day it's still 'open' (though dormant) in the tray. To fully close it, you have to do so from the tray-icon's context menu. With me so far?

Now; the bit I couldn't understand was this; the alsa-capture.mp3 file existed in /root, it obviously had content in it, and when playing it back, not only was DeaDBeeF's run-time indicator 'clocking-up' the seconds, but the spectrogram plug-in I have installed definitely showed the content was playing. Yet there was NO SOUND COMING OUT OF THE SPEAKERS.

-----------------------------

I had a look at the alsa-capture file your package places in /usr/local/bin, and I could see what was going on! The script doesn't hand control back to the original ~/.asoundrc file until the app you recorded from has been fully shut-down.....yes? Naturally, with the way I run DeaDBeeF all day long, and the fact that it never gets completely "shut-down", the original ~/.asoundrc file never gets re-instated.

It's no wonder I had no sound from the speakers.... Image

----------------------------

Top & bottom of the matter boils down to this:- Now that I properly understand how to use it, this little package has "fixed" one of the very few niggles I've had with this HP rig in the now 2½ years I've had it.....albeit a fairly major one.

You're a bloody genius, Bill! As always, short & simple.....and it just "works". THANK you. :D :thumbup:

(I might have attempted something like this myself, eventually......but I loathe trying to mess around with ALSA config scripts. The very few times I've tried such in the past, I've ended up more or less borking the system, and having to re-install).

Never again. I'm learning to leave what I don't understand well alone.

Cheers, mate.

-----------------------------------

EDIT:- One question, while I think about it? Is there any way to let the user "monitor" what they're recording? It's a bit like guesswork with no sound coming from the speakers, although I understand why it's absent....

No criticism! Just curious, really.

Mike. ;)

User avatar
fredx181
Posts: 3085
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 375 times
Been thanked: 1314 times
Contact:

Re: How to record what the PC is playing?

Post by fredx181 »

mikewalsh wrote:

EDIT:- One question, while I think about it? Is there any way to let the user "monitor" what they're recording? It's a bit like guesswork with no sound coming from the speakers, although I understand why it's absent....

What works for me to monitor, is using "alsaloop" after the recording started (with Bill's program):
In another terminal;
alsaloop -C Loop -P hw:0,0 -t 50000 # playback from card 0
or from card 1:
alsaloop -C Loop -P hw:1,0 -t 50000 # playback from card 1

Question, do you hear dropouts in the capture that has been recorded from Deadbeef as audio source, I do (also in the monitored output (with alsaloop), btw).

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

Excellent.

Yes, you must start the script first, then the player so the player can use the new .asoundrc that enables capturing. You must FULLY stop the player after the capture so it can revert back to using the original .asoundrc.

Fred's version uses a more complicated .asoundrc.capture that also sends the playback to the default output device (your speakers) during the capture.

Last edited by rcrsn51 on Sat Jun 04, 2022 10:10 pm, edited 2 times in total.
User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@fredx181 :-

Mm......dropouts, not so much, Fred. What I do get is LOTS of clipping..! :roll:

I've tried addressing this by lowering the PCM level - this is normally set at 100%, as is the 'Front' slider (without which I get no audio at all!) :(

It reduces the clipping, yes.....but at the expense of also cutting the top-end sound quality, which leaves everything sounding a bit "woolly". Kinda like the difference between listening to FM radio on a decent hi-fi, and AM radio on an old valve radio.....lotsa warm, rich, bass, some mid-range, and absolutely NO treble at all.

I LIKE my treble to be nice & sharp, y'know?

I'm definitely not criticising Bill's approach; I now have the ability to record from the internal card, where I had none at all before. It's a very good starting-point; probably there's room for improvements, though I get completely lost with the vast array of ALSA options & how they all work together!

I'll try your suggestion, vis-a-vis "monitoring".

Mike. ;)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

@Fred: I suspect that your version may sometimes work better because its .asoundrc.capture defines larger buffers that hold the audio data between playback and recording.

It may not be a problem when the audio source is from the Internet because the process is inherently slower.

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@rcrsn51 :-

rcrsn51 wrote: Sat Jun 04, 2022 10:04 pm

@Fred: I suspect that your version may sometimes work better because its .asoundrc.capture defines larger buffers that hold the audio data between playback and recording.

It may not be a problem when the audio source is from the Internet because the process is inherently slower.

Actually, Bill, you may be right. I have a paid RadioTunes a/c - one of the very few things I do subscribe to - for two reasons:-

- One, no adverts!
- Two, one of the perks of a subscription is that you're not limited to listening in the webapp itself. You can download a .pls file with your 'Favourites' + 'listen key', and then use that to listen in any suitable audio-/media-player that supports a .pls stream. This is mostly what I use Deadbeef for, because it just sounds so much better that way.

Okay...

Question:- Would your package still work if I was to substitute Fred's ~/.asoundrc.capture file for the one you've supplied? I guess what I really want to know is whether I would need to start loading "snd_aloop" at boot-time again.....or will the modprobe command in your script take care of it?

Mike. ;)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

mikewalsh wrote: Sat Jun 04, 2022 10:28 pm

Question:- Would your package still work if I was to substitute Fred's ~/.asoundrc.capture file for the one you've supplied?

No. Fred's script is slightly different. You need his full package.

I guess what I really want to know is whether I would need to start loading "snd_aloop" at boot-time again.....or will the modprobe command in your script take care of it?

It doesn't matter where the snd_aloop module gets loaded - at bootup or at the start of the script. And if a module is already loaded, loading it again does no harm. The purpose of snd_aloop is to create a virtual sound card named Loopback that lets you pass audio data between playback and record operations.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

@Fred and Mike: Just for fun, I modified my script like this:

Code: Select all

trap QUIT SIGINT
killall alsaloop 2>/dev/null #just in case
alsaloop -C Loop -P hw:0,0 -t 50000 &
echo "Start playing some audio ..."

That gets me simultaneous playback during capture. However, some Puppies may not have alsaloop.

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@rcrsn51 :-

Hm. "Alsaloop", huh? What exactly is it; a kernel module, or does it reside in one of the "bins"..? Can it be installed, or is it something either your version of ALSA has, or it doesn't?

One thing I realised long ago about the 'Quirkies'. Since they were Barry's test-beds for no end of different ideas, and since the "PuppyMaster" just always seemed that little bit more 'thorough' when it came to putting Puppies together.....I've found no end of wee 'gems' contained therein which I just haven't found anywhere else!

That's why I ask if 'alsaloop' is a package that can be download & installed, or whether it's something that's specified at build-time when ALSA's compiled.....

(Be no good anybody asking me, 'cos I really don't have a clue..!) :lol:

Mike. ;)

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

Open a terminal and type: which alsaloop

The alsaloop command is part of the alsa-utils package. Some Puppies may not have it.

User avatar
rcrsn51
Posts: 1390
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 357 times

Re: How to record what the PC is playing?

Post by rcrsn51 »

I have posted v1.1 of alsa-capture here.

This one uses alsaloop (if present) to provide simultaneous audio playback.

User avatar
mikewalsh
Moderator
Posts: 6163
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 795 times
Been thanked: 1983 times

Re: How to record what the PC is playing?

Post by mikewalsh »

@rcrsn51 :-

Hey, nice one, Bill!

I've added those two additional lines into both Xenial's 'alsa-capture' AND Quirky's 'alsa-capture'. That, my son, works a treat.

At least I can now tell when I want to start & stop... :D

Xenial comes with alsa-utils installed OOTB. (At least, I think it does.....it's entirely possible I may have added it myself at some point over the last couple of years. I don't remember; my mind is getting like a sieve these days...) :oops:

--------------------------------------------

Quirky 'April', however, didn't. Not a problem; this thing is roughly Tahrpup-era.....at any rate, I've got a lot of Tahrpup apps installed here with minimal fuss. When jrb published this 'lite' version that I use, I think I kinda 'swamped' him with all the stuff I was finding/re-building for his 'baby'..!

I tracked down a Tahrpup-era alsa-utils package at https://old-releases.ubuntu.com/ubuntu/pool/main. Had to re-build it into a .pet; this sometimes happens here.....some .debs refuse to install. Others install without a murmur. Heigh-ho...

Anyway, it installed, and Quirky appears perfectly content with it. "Monitoring" works sweetly here, too.

(I've more or less 'fixed' the clipping issue, by juggling the PCM slider in Retrovol AND DeaDBeeF's 'pre-amp' slider. That, and re-jigging my equalizer settings a shade.....little bit TOO much bass & treble, I think. Just smoothed the curve off a bit...)

Did I say "Nice one"? Well, I'll say it again. Nice one..! :thumbup:

Cheers, mate. You're a star!

(*sotto voce - All it needs to finish it off now would be a wee GUI...*) Noooo..! It wasn't me..!! I didn't say it....!!! :lol: :lol: I may try my hand at building one, actually. You've done more than your fair share already, Bill.

Thanks again.

Mike. :D

number77
Posts: 378
Joined: Tue Jul 14, 2020 3:14 pm
Has thanked: 4 times
Been thanked: 12 times

Re: How to record what the PC is playing?

Post by number77 »

rcrsn51 wrote: Sun Jun 05, 2022 12:18 am

Open a terminal and type: which alsaloop

The alsaloop command is part of the alsa-utils package. Some Puppies may not have it.

I tried alsaloop and pc went into positive feedback oscillation about 5khz and loud. Does that mean alsaloop is taking the audio output for the speakers and returning it to the input. If so does that not mean you are working with audio, not digital.
Still have this problem I do not want to record audio as it's well mucked about with pc sound system.
I tried turning all mic inputs off in alsa but still oscillation with alsaloop.

Post Reply

Return to “Beginners Help”