LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2015, 02:00 AM   #1
GreyBeard
Member
 
Registered: Oct 2003
Location: Taxachusetts, USA
Distribution: Slackware
Posts: 45

Rep: Reputation: 1
Can't record sound going to speakers. Slackware error? Where is /dev/dsp? What?


I run Slackware Linux 14.1 using KDE version 4.10.5 as my desktop manager, an it all runs on an Intel D5410M0 "Atom" Mini ITX board.

All I want to do is make a copy of whatever sounds are going to my speakers. I've been looking around for how to do this and I seen and tried commands like
ffmpeg -f oss -i /dev/dsp -ac 2 out.wav
or
arecord -f cd -d 10 -D default out.wav
I have tried many such commands with every "input" I can find which does not produce an error on the command line. (The "arecord -L" output is at the end of this post.) The commands which run yields either a silent .WAV file or a .WAV file which is just white noise. Obviously I am connecting to no input or to the wrong input.

I may have multiple problems here.


First off there is no /dev/dsp. If there is an equivalent I don't know what it is. The closest I get is /dev/snd/ which I presume has something to do with sound. The files under it are below, and they are the only "audio" group files under /dev.

root $?=0> ls -laF -R /dev/snd

/dev/snd:
total 0
drwxr-xr-x 3 root root 220 Mar 25 06:28 ./
drwxr-xr-x 16 root root 5540 Apr 9 19:42 ../
drwxr-xr-x 2 root root 60 Mar 25 06:28 by-path/
crw-rw---- 1 root audio 116, 7 Mar 25 10:28 controlC0
crw-rw---- 1 root audio 116, 6 Mar 25 10:28 hwC0D2
crw-rw---- 1 root audio 116, 5 Apr 9 19:45 pcmC0D0c
crw-rw---- 1 root audio 116, 4 Apr 9 19:46 pcmC0D0p
crw-rw---- 1 root audio 116, 3 Mar 25 10:28 pcmC0D1p
crw-rw---- 1 root audio 116, 2 Mar 25 10:28 pcmC0D2c
crw-rw---- 1 root audio 116, 1 Mar 25 06:28 seq
crw-rw---- 1 root audio 116, 33 Mar 25 10:28 timer

/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root 60 Mar 25 06:28 ./
drwxr-xr-x 3 root root 220 Mar 25 06:28 ../
lrwxrwxrwx 1 root root 12 Mar 25 10:28 pci-0000:00:1b.0 -> ../controlC0
When I try the above under ffmpeg I get different errors for different devices:

[oss @ 0x9e55fc0] SNDCTL_DSP_SETFMT: Inappropriate ioctl for device
/dev/snd/pcmC0D0c: Input/output error
for most devices or, for hwC0D2, I get

[oss @ 0x9d22fc0] /dev/snd/hwC0D2: Permission denied
/dev/snd/hwC0D2: Input/output error
Note that I have checked file permissions and they are OK. Both my user account and root can do an LS of /dev/snd/hwC0D2 but not even root can read that file. I am a member of the "audio" group. There is no /lib/udev/rules.d/40-alsa.rules file.


The second problem is that when I log in a message box pops up with an error message. If I click on it or wait a while it goes away. It says:
Multimedia System
The audio playback device HDA Intel (ALC662 rev1 Analog) does
not work. Falling back to HDA Intel (ALC662 rev1 Analog).
Aside from not being able to record sound the rest of my sound system seems to work, ie I get sound from videos on Firefox, music or videos played through mplayer, the occasional system beep, etc. Nothing fancy, but the sound system works for me.

I seem to recall that this error message only showed up when I went to Slackware 14.0 or 14.1, I forget which. Since my sound system continued to work and the error message "falls back" to the same device which failed, I have ignored it. This is also why I am posting this here in Slackware first.

I tried running alsaconf but it just says, "No supported PnP or PCI card found. Would you like to probe legacy ISA sound cards/chips?" I looked at the legacy list and proceded no further. No help there.


And of course the third problem here is that this is well outside my area of expertise or, to be more accurate, when it comes to sound (and video) I have no idea what I am doing.

All I want to do is record the same sound that goes to my speakers. That should not be this hard. Suggestions or solutions would be much appreciated.


Thanks In Advance. :-)

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

root $?=0> arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
HDA Intel, ALC662 rev1 Analog
Default Audio Device
sysdefault:CARD=Intel
HDA Intel, ALC662 rev1 Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, ALC662 rev1 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers


root $?=0> arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: ALC662 rev1 Alt Analog [ALC662 rev1 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
 
Old 04-10-2015, 05:05 AM   #2
arfon
Member
 
Registered: Apr 2004
Distribution: Slackware & RHEL
Posts: 376

Rep: Reputation: Disabled
Let me tell you what I learned when trying to do this...
1) It's hard (because like most opensource things, documentation absolutely sucks).

2) You need to enable/setup a loopback in your mixer.

3) It has nothing to do with /dev/dsp

That's as far as I got before giving up and putting an audio device on my outputs.
 
1 members found this post helpful.
Old 04-10-2015, 05:44 AM   #3
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 411

Rep: Reputation: 181Reputation: 181
/dev/dsp is specific to OSS. Almost no one uses OSS for audio output anymore, this is all done by ALSA. Some even use another layer on top of that with Pulseaudio, Jack etc.

You can record the sound of your speakers in ALSA. But by default, any recording application is blocking the sound card, so you can either hear the sounds or record them.

I made a blog post about that a while ago - basically, it's setting up a loopback device and record the audio of the loopback device while still getting it out to the speakers:

http://schmatzler.de/en/2014/11/29/s...ulseaudiojack/

It's overly complicated to just record some things. I chose this approach since Pulseaudio doesn't run here (like the usual Poettering software), but it should work out-of-the-box with Pulseaudio.

Last edited by schmatzler; 04-10-2015 at 05:48 AM.
 
Old 04-10-2015, 06:52 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
At almost the same time as schmatzler (well, one month later) I wrote a similar article: http://alien.slackbook.org/blog/a-jo...-in-slackware/ followed by an article how to setup Jack Audio: http://alien.slackbook.org/blog/sett...-in-slackware/

The first link will be helpful, the second link may be helpful.
 
1 members found this post helpful.
Old 04-10-2015, 08:39 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
a while back i played around with netcat-ing sound from one machine to another. something like
Code:
##### pc1 #####
netcat -l 1515 > /dev/dsp
netcat <ip-address-of-pc2> 5151 < dev/dsp

##### pc2 #####
netcat -l 5151 > /dev/dsp
netcat <ip-address-of-pc1> 1515 < dev/dsp
i think there is a program called padsp to help emulate this old functionality.
 
Old 04-10-2015, 09:34 AM   #6
slacktroll
Member
 
Registered: May 2011
Distribution: Slackware64/current
Posts: 175

Rep: Reputation: 45
Your INTEL HDA soundcard is probably crippled and won't support recording what's played up.
hope it's not. Mine is on my laptop. But on a older Laptop (X60 instead of X61) it works
 
Old 04-10-2015, 03:54 PM   #7
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
OSS is done by emulation through ALSA.

In Slackware, OSS is disabled by default. To enable it, run:

Code:
chmod +x /etc/rc.d/rc.aoss
And then restart ALSA:

Code:
/etc/rc.d/rc.alsa restart
This will allow Alsa's OSS to setup the correct device nodes as needed for /dev/dsp and associated nodes and load appropriate modules.

Last edited by ReaperX7; 04-10-2015 at 03:55 PM.
 
Old 04-10-2015, 04:20 PM   #8
Nh3xus
Member
 
Registered: Jan 2013
Location: France
Distribution: Slackware 14.1 32 bits
Posts: 211

Rep: Reputation: 57
You can also create a virtual Alsa device that is bound to your actual (as in regular) soundcard.
 
Old 04-10-2015, 04:42 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,237

Rep: Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321Reputation: 5321
You need /dev/dsp, set /etc.rc.d/rc.aoss executable and run it.

EDIT: ReaperX already posted.
 
Old 04-10-2015, 05:30 PM   #10
commandlinegamer
Member
 
Registered: Dec 2007
Posts: 163

Rep: Reputation: 51
I needed to use OSS in the past when ALSA couldn't reliably run my Envy24 onboard sound (Chaintech motherboard). But that was a decade ago, and unfortunately recent attempts to use it just seemed to cause more problems than they solved.

Not that I'm impressed with ALSA. Having to craft configuration files by hand strikes me as little better than having to calculate one's own modelines for X (I've done that in the past, but I can't imagine anyone suggesting that would be acceptable nowadays unless you're trying to run some seriously ancient hardware).
 
1 members found this post helpful.
Old 04-10-2015, 07:41 PM   #11
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Although it's not recommended, especially when many apps look specifically for ALSA in Linux, you can use the OSSv4 driver.

You may have to rebuild MANY packages to use this driver, and honestly, I don't recommend it.

There is an ALSA toolkit specially for Envy24, last I knew, so you might want to look into it.
 
Old 04-11-2015, 02:06 AM   #12
GreyBeard
Member
 
Registered: Oct 2003
Location: Taxachusetts, USA
Distribution: Slackware
Posts: 45

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by ReaperX7 View Post
OSS is done by emulation through ALSA.

In Slackware, OSS is disabled by default. To enable it, run:

Code:
chmod +x /etc/rc.d/rc.aoss
And then restart ALSA:

Code:
/etc/rc.d/rc.alsa restart
This will allow Alsa's OSS to setup the correct device nodes as needed for /dev/dsp and associated nodes and load appropriate modules.
There is no "/etc/rc.d/rc.aoss" file on my machine. When I install Slackware I install everything, tho I do not enable many of the services. Is there some service I am not running which creates this file? Did you install some package which does not come with the released Slackware? BTW, I checked this on my Slackware 14.1 machine on which I am trying to record sound and also my older Slackware 11.0.0 server machine. There is no rc.aoss file on either machine.

Thanks.
 
Old 04-11-2015, 03:09 AM   #13
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Did you perform a complete install?

Alsa's OSS package has the required file.

Can you run:

Code:
ls /etc/rc.d/
And post the readout?

Last edited by ReaperX7; 04-11-2015 at 03:12 AM.
 
Old 04-11-2015, 05:49 AM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Alsa's OSS package has the required file.
No. In Slackware the Alsa OSS package includes shared libraries, the script /usr/bin/aoss and its associated man page but no startup script.
 
Old 04-11-2015, 06:13 AM   #15
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Correction, the file name is /etc/rc.d/rc.alsa-oss and it's part of alsa-utils.

Sorry, but I'm not on Linux ATM to get everything completely correct. Often, you should double check the directories yourself rather than just follow what is posted so you can make sure you know what is needed in case a file name isn't exactly correct. This way you also learn your system also and get familiar with it better.

Last edited by ReaperX7; 04-11-2015 at 06:25 AM.
 
  


Reply

Tags
alsa, audio, slackware, sound



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/dsp missing, no sound Slackware 12.2 zeelog Slackware 10 07-21-2009 06:41 PM
devfs and devfsd don't create /dev/dsp or /dev/sound/dsp ? behmjose Linux - Hardware 2 10-02-2006 12:27 PM
no sound in GNOME(/dev/dsp error) kushalkoolwal Debian 12 03-05-2006 10:57 PM
How to Record Sound Directly from /dev/dsp flamesrock Linux - Software 2 03-03-2005 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration