LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-10-2014, 12:07 PM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Recording streaming audio questions


I'm trying to capture an audio stream but all I seem to get is a file full of silence.

Configuration:

OpenSUSE 12.2, SB Live! soundcard, sound driver emu10k1

I've been trying the command:
Code:
ffmpeg -f alsa -i hw:0,0 stream.wav
and
Code:
ffmpeg -f alas -i hw:0,0 -acodec libmp3lame stream.mp3
In both cases it appears that something's being recorded (well... the output file is growing in size while the commands are running), but in neither case does the resulting file seem to have and audio recorded in it.
I've also tried:
Code:
arecord -f cd stream.wav
which gets me the same result.

UPDATE: A WAV file created using the first ffmpeg command and allowed to run for about 15s looks like this when viewed:
Code:
$ od -c stream.wav
0000000   R   I   F   F 250 035   '  \0   W   A   V   E   f   m   t    
0000020 022  \0  \0  \0 001  \0 002  \0 200 273  \0  \0  \0 356 002  \0
0000040 004  \0 020  \0  \0  \0   L   I   S   T 032  \0  \0  \0   I   N
0000060   F   O   I   S   F   T 016  \0  \0  \0   L   a   v   f   5   5
0000100   .   3   3   .   1   0   0  \0   d   a   t   a   ` 035   '  \0
0000120  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
11616660
Any hints on where to begin debugging this?

I've seen a post where someone mentioned that you could have problems if your sound card prevented you from capturing from the PCM device. Am I getting burned by this with the SB Live!?

Any hints, tip, gotchas are welcomed.

TIA...

--
Rick

Last edited by rnturn; 06-10-2014 at 12:54 PM. Reason: Added dump of WAV file format.
 
Old 06-10-2014, 02:25 PM   #2
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Have you tried using streamripper ?
 
Old 06-10-2014, 07:41 PM   #3
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by metaschima View Post
Have you tried using streamripper ?
Tried it but one it seems to be limited in the streaming formats it supports. And wouldn't you know it that the first source I tried to capture with it failed with an unsupported format error. (That site I was trying to capture was the site that got me interested in being able to capture streaming audio in the first place.)

Anyway... I figure that once it's gotten to the PCM device -- or some other sound device on the way to the speakers -- it's been through the decoding process and I wouldn't have to worry about Shoutcast/Icecast/SomeOtherCast formats. Unfortunately, what I'm getting is a whole lot of silence so either I'm connecting to the wrong device, some ffmpeg switch I'm using is wrong, or I've forgotten an important switch.

Still hoping someone'll set me on the right path.

--
Rick
 
Old 06-10-2014, 07:48 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I would try using mplayer -dump* options.
 
Old 06-13-2014, 03:47 PM   #5
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
The problem is with your particular sound card. It may or may not support full duplex. See the compatibility list for details.
 
Old 06-13-2014, 10:20 PM   #6
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by DJ Shaji View Post
The problem is with your particular sound card. It may or may not support full duplex. See the compatibility list for details.
Parts of the ALSA site don't seem to have had much in the way of updates since 2006 (at least not the pages related to the card/driver I'm using). The driver listed on the site is only a couple of minor maintenance releases newer than the one I'm using that came bundled with OpenSUSE 12.2 -- 1.0.25 vs. 1.0.27.

The card (PCI512) is an old one that I've had running in several different computers over its lifetime. It would not surprise me if it weren't lacking in some newer features. On the other hand I've been using a pretty bare-bones ".asoundrc" file so it's always possible a more sophisticated configuration file would enable access to some slicker features. I'll be looking at what I might be missing in .asoundrc that could be preventing recording from working.

Still slogging away at this (not full-time).

Later...

--
Rick
 
Old 06-13-2014, 10:36 PM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by metaschima View Post
I would try using mplayer -dump* options.
Heh, heh...

I still haven't been able to get Mplayer to even play a stream. When I enter a URL, I see messages that appear to indicate that it's connecting and that some information is being downloaded (and buffered) and then... nothing. I'm guessing that the "stations" I want to listen to are not using a format that's Shoutcast/Icecast-compatible. Nothing on the station web pages indicate any of the specs for how they're streaming though I can listen via Firefox. Maybe there's an option (or two) for mplayer that can select a different format but I haven't plowed through all 145 pages[1] of mplayer(1) yet. BTW, I haven't run across a clear explanation (i.e. example command line) of any "dump" switch yet. Probably best to figure out "play" first... then "dump" later.

--
Rick

[1] - That's how many pages you get when you run the mplayer(1) man page file through groff. Whew!
 
Old 06-13-2014, 10:43 PM   #8
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Interim report:

I was able to make a recording of the radio program I was interested in grabbing but I had to use a completely non-Linux solution: recording the OTA signal on my Cowon and then downloading and converting the WMA-format file to WAV and MP3 versions.

I'm still forging ahead to be able to do recording from the streaming data, though.

--
Rick
 
Old 06-14-2014, 11:06 AM   #9
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Try using audacity to record it, I've used it in the past and it seems to work.
 
Old 06-14-2014, 12:44 PM   #10
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by metaschima View Post
Try using audacity to record it, I've used it in the past and it seems to work.
One of the first applications I tried was Audacity. No luck. I'm looking at my sound card configuration at a very low-level to see what might be wrong. Not rant too much about it but the introduction of Pulse Audio has made things much harder to work with. You're never sure just piece of software is not working when things go south. Though playback has always seemed to work OK, it's been a couple of OpenSUSE/SUSE releases since I've been able to record anything but back then I wasn't much interested in recording. Now that I am sound setup has turned into a pain in the butt. (Thanks a pile RedHat.)

Later... (It's too nice a day to get frustrated over sound when my bike is calling me. )

--
Rick
 
Old 06-14-2014, 01:08 PM   #11
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Try without pulseaudio (live CD)...

My tests were only done on distros without pulseaudio, so I have never dealt with it.
 
Old 06-14-2014, 02:19 PM   #12
nyc_rr
LQ Newbie
 
Registered: May 2014
Distribution: Linux Mint 16 Petra
Posts: 26

Rep: Reputation: 25
@ rnturn

If your distro is using pulseaudio add the -i pulse to ffmpeg. It works for me

Code:
ffmpeg -f alsa -i pulse -acodec libmp3lame out.mp3
 
Old 06-14-2014, 05:04 PM   #13
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Hi again! See, I actually have a SoundBlaster Live! 5.1 vx card that I brought specifically for recording, and I can tell you the driver (CA0106) has some issues with full duplex. You may or may not be able to record, but the solution lies in that direction. Pulseaudio has nothing to do with it. It's a driver issue. See here and here for info. You can record with any software once you resolve the driver issue. I have to set some options in alsamixer for recording through MIC/LINE IN, and I suppose you have to do something similar. Do check the above pages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
recording streaming audio/video on fedora swarrier9 Linux - Newbie 2 01-30-2011 12:04 PM
Considering switching... Audio recording - general setup questions Rocket Boy Linux - Software 1 07-29-2006 01:11 PM
Two questions re: accessing ripped music & listening to streaming audio unterkauf Linux - Software 8 10-14-2005 01:03 AM
questions - dual xeons and audio recording Motown Linux - General 1 10-23-2004 01:36 AM
Recording streaming audio bassgenerator Linux - Software 3 10-01-2004 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:20 PM.

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