Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Aug 2018, 05:41
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
record streaming audio
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Author Message
robpeteuk

Joined: 22 Feb 2008
Posts: 40

PostPosted: Tue 19 Aug 2014, 11:23    Post subject:  record streaming audio
Subject description: alc888 integrated soundcard no capture mix on alsa
 

Hi I have been trying to set up my sound card to record streaming audio. I can do this with xp with no problem. I have a Realtek ALC888 with Intel 82801I HD Audio Controller intergrated sound card and am using slacko 5.6 I think the problem is that alsa does not have a capture mix slider for some reason. I presume it may be unable to configure itself for this card if that makes sense. Everything else works fine as far as I know. Wondered if I can't capture audio through alsa if I could through setting up pulse audio or something similar. I can do it by running xp but find it annoying to restart pc and also have to use xp. Any ideas thanks Rob
Back to top
View user's profile Send private message 
linus.cl

Joined: 02 Apr 2014
Posts: 127
Location: Germany

PostPosted: Tue 19 Aug 2014, 11:32    Post subject:  

use audacity:
http://puppylinux.org/wikka/Audacity
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Tue 19 Aug 2014, 15:51    Post subject:  

Hello @RobPeteuk. You are in luck of some timely effort shared over the last week in this forum.

See this thread for 3 explanations for audio capture.

Hope it helps in understanding and addresses your need(s) for recording audio.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
robpeteuk

Joined: 22 Feb 2008
Posts: 40

PostPosted: Tue 19 Aug 2014, 16:55    Post subject:  

Thanks for help. Unfortunately Audacity still does not record streaming audio. I think it is something to do with ALSA not being able to work fully with the on board audio of the Dell Vostro, a Realtec Alc 888. There is no mix on the Alsa sliders which there is on another pc running Slacko . The other PC records streaming audio fine. I have wondered about trying to install Pulse Audio but it seems to have lots of problems too from forums I have read.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11146

PostPosted: Wed 20 Aug 2014, 04:34    Post subject:  

hmm either there is no hardware mix on the card or the alsa driver is not 100%... If its the former then you can have software mixing which may be what windows is doing. These built in intel chipset type cards tend to be lacking.

There is that option with alsa...dmix etc but having never done it I am not one to advise...I vaguely recall that a config (.asoundrc? ) file is made to make it happen...one to google. I assume you want to capture the output since none of the available capture inputs does the job...alsamixer and tab..arrows and spacebar to select.

mike
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1661

PostPosted: Wed 20 Aug 2014, 07:50    Post subject:  

I have the same problem (lack of 'mix' under Linux on both of my laptops), but I found a partial workaround here:
https://bbs.archlinux.org/viewtopic.php?id=147852
You could try this. Here's more straightforward, step-by-step setup guide:

1. Load snd-aloop kernel module by typing in terminal:
Code:
modprobe snd-aloop

(later, if it turns out to be working well, you can add this module in Bootmanager, so it will be loaded at system boot)

2. Create (if doesn't exist) /etc/asound.conf and add the following content to it:
Code:
pcm.!default {
  type asym
  playback.pcm "LoopAndReal"
  #capture.pcm "looprec"
  capture.pcm "hw:0,0"
}

pcm.looprec {
    type hw
    card "Loopback"
    device 1
    subdevice 0
}


pcm.LoopAndReal {
  type plug
  slave.pcm mdev
  route_policy "duplicate"
}


pcm.mdev {
  type multi
  slaves.a.pcm pcm.MixReale
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}


pcm.MixReale {
  type dmix
  ipc_key 1024
  ipc_perm 0666
  slave {
    pcm "hw:0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

pcm.MixLoopback {
  type dmix
  ipc_key 1025
  ipc_perm 0666
  slave {
    pcm "hw:Loopback,0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

NOTE: it might be the case that your card has different index than 0.
For example in Acer AO 722 I had to replace all occurences of 'hw:0,0' with 'hw:1,0'.

3. Perform a quick test - turn on some music and type:
Code:
arecord -f dat -D looprec -V stereo > /root/test.wav

Keep recording for some time, press CTRL+C and type:
Code:
aplay /root/test.wav

to see (hear) if it's working.

Now, if you want to use e.g. mhWaveEdit for recording, you need to reconfigure it.
In 'Edit -> Preferences -> Sound -> (Driver: ALSA) Settings -> Recording device' enter looprec.
Also, sample format ('Play -> Record -> Sample format -> Other format') has to be:
- Channels: Stereo
- Sample type: 16 bit PCM
- Signedness: Signed
- Endianness: Little endian
- Sample rate: 48000

There are some side effects and shortcomings though:
- PCM slider in Alsamixer/Retrovol doesn't work anymore
- you can't record from microphone using this method (device: looprec)
- nor from PMusic, because it uses its own, custom ~/.asoundrc config file (probably needed by equalizer), but if you delete this file after starting PMusic and restart a track, it becomes recordable
- nor from apps that use OSS, unless they have an option to set ouput to ALSA

Apps I've tested to work fine are: DeaDBeeF, Gnome-mplayer (<-set output to ALSA), SMPlayer, Simple GTK Radio (by dejan555), aplay, ffplay and browser based stuff like YT and similar...

HTH
Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Wed 20 Aug 2014, 09:20    Post subject:  

Instead of configuring stuff that will disable play/recording ability of some applications, I recommend NOT to use the onboard sound cards in desktop PC's.

Disable the onboard sound cards in BIOS and use a PCI sound card like Creative Soundblaster etc.pp.

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
robpeteuk

Joined: 22 Feb 2008
Posts: 40

PostPosted: Wed 20 Aug 2014, 17:14    Post subject:  

Brilliant. Thanks so much. After searching and playing around for hours recording streaming audio now works great, at least in audacity. Thanks SFR ( and everyone else for suggestions. Rob
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11146

PostPosted: Thu 21 Aug 2014, 16:33    Post subject:  

Nice description SFR of what always seemed a bit of a black art....

I reckon it should become a how-to since I and others have needed to do this at some time or other Smile

mike
Back to top
View user's profile Send private message 
robpeteuk

Joined: 22 Feb 2008
Posts: 40

PostPosted: Fri 22 Aug 2014, 08:34    Post subject:  

Agree would have been good to have been on How to capture streaming audio. Would have saved me a lot of hassle.
After I created a asound.conf file and configured mhWaveEdit as described by SFR I had to add to the /etc/rc.d/rc.local file the line modprobe snd-aloop for audacity and mhWave Edit to reload with the correct configuration after shut down and bootup. There did not seem to be a snd-aloop module to add to bootmanager.
Back to top
View user's profile Send private message 
sheldonisaac

Joined: 21 Jun 2009
Posts: 725
Location: Philadelphia, PA

PostPosted: Sat 23 Aug 2014, 09:02    Post subject:  

Thank you, SFR. I did as you said, and indeed the test.wav does contain the audio.
But also it contains unpleasant repeating sounds like "PSSSS -PSSSS-PSSSS"
continued indefinitely.

Can someone help?

Thank you very much..

_________________
Dell E6410: Xenial, etc
Dell Mini 9, Acer Aspire One, EeePC 1018P, PowerBook G4
Intel D865GBF, Intel DQ35JOE
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1661

PostPosted: Sat 23 Aug 2014, 10:17    Post subject:  

mikeb wrote:
I reckon it should become a how-to since I and others have needed to do this at some time or other Smile

That was my thought too, a few months ago when I finally got it working, but was/am too lazy. Wink


robpeteuk wrote:
There did not seem to be a snd-aloop module to add to bootmanager.

Ah, if a module is already loaded, it won't be listed in BootManager.
BootManager wrote:
On the left pane is the complete list of modules available to be used by Puppy (and not currently loaded).

So, it's necessary to rmmod snd-aloop first, in order to make it visible in BM.


sheldonisaac wrote:
But also it contains unpleasant repeating sounds like "PSSSS -PSSSS-PSSSS" continued indefinitely.

Never encountered such a thing...
Does it happen even if all audio apps are closed and you record silence?
And what if you used mhWaveEdit/Audacity instead of arecord?

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
sheldonisaac

Joined: 21 Jun 2009
Posts: 725
Location: Philadelphia, PA

PostPosted: Sat 23 Aug 2014, 14:05    Post subject:  

SFR wrote:

sheldonisaac wrote:
But also it contains unpleasant repeating sounds like "PSSSS -PSSSS-PSSSS" continued indefinitely.

Never encountered such a thing...
Does it happen even if all audio apps are closed and you record silence?
And what if you used mhWaveEdit/Audacity instead of arecord?
Greetings!

Thanks for your very prompt response.
I am completely inexperienced in this, so please excuse me.
May I ask for guidance in providing you possible diagnostic info, such as hardware, OS, etc.
I hope I can attach test1.wav, recorded 'silence'
And test2.wav, recorded while pmusic played a radio stream

Oops, .wav is not allowed; I'll rename them with .gz extensions.

Oh, and regarding mhWaveEdit/Audacity : how would one use mhWaveEdit to record an audio stream?
As to Audacity, I don't have it - may I ask for advice?


Thanks again,
Sheldon Isaac
test2.gz
Description 
gz

 Download 
Filename  test2.gz 
Filesize  71.88 KB 
Downloaded  108 Time(s) 
test1.gz
Description 
gz

 Download 
Filename  test1.gz 
Filesize  137.54 KB 
Downloaded  142 Time(s) 

_________________
Dell E6410: Xenial, etc
Dell Mini 9, Acer Aspire One, EeePC 1018P, PowerBook G4
Intel D865GBF, Intel DQ35JOE
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1661

PostPosted: Sat 23 Aug 2014, 14:53    Post subject:  

sheldonisaac wrote:
Oh, and regarding mhWaveEdit/Audacity : how would one use mhWaveEdit to record an audio stream?
As to Audacity, I don't have it - may I ask for advice?

Have a look at my first post in this very thread for the info about configuring mhWaveEdit.
Audacity should be available in PPM.

sheldonisaac wrote:
test1.wav, recorded 'silence'

I looked into these files via hexdump and I think I know what's going on: older versions of arecord send the visual representation of VU meter's output to stdout (newer - to stderr), so it's being saved in WAV file along with audio stream, hence the artifacts.
Me and William (mcewanw) were struggling with that mess lately, while fixing a bug in p(av)record.
Try without VU meter:
Code:
arecord -f dat -D looprec > /root/test.wav

Hopefully, should be fine now.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
sheldonisaac

Joined: 21 Jun 2009
Posts: 725
Location: Philadelphia, PA

PostPosted: Sat 23 Aug 2014, 15:24    Post subject:  

SFR wrote:
sheldonisaac wrote:
Oh, and regarding mhWaveEdit/Audacity : how would one use mhWaveEdit to record an audio stream?
As to Audacity, I don't have it - may I ask for advice?

Have a look at my first post in this very thread for the info about configuring mhWaveEdit.
Audacity should be available in PPM.

sheldonisaac wrote:
test1.wav, recorded 'silence'

I looked into these files via hexdump and I think I know what's going on: older versions of arecord send the visual representation of VU meter's output to stdout (newer - to stderr), so it's being saved in WAV file along with audio stream, hence the artifacts.
Me and William (mcewanw) were struggling with that mess lately, while fixing a bug in p(av)record.
Try without VU meter:
Code:
arecord -f dat -D looprec > /root/test.wav

Hopefully, should be fine now.

Greetings!

SFR, you have been VERY generous with your time and knowledge; thank you again.
Audacity works. And regarding the arecord and mhWaveEdit., thanks also; I will work on that (and probably be back for more help Smile

_________________
Dell E6410: Xenial, etc
Dell Mini 9, Acer Aspire One, EeePC 1018P, PowerBook G4
Intel D865GBF, Intel DQ35JOE
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0815s ][ Queries: 12 (0.0215s) ][ GZIP on ]