LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-05-2012, 02:45 PM   #1
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Rep: Reputation: 0
Record live radio streams with Slackware 13.37


Hello,
i want to record audio from a live radio stream in SLackware. I already tried with Audacity but it is recording only from microphone but not the audio that is coming from the radio stream. What i need to do to fix it. The stream is encoded in AAC audio. I read some previous threads but i am not sure if they concern my case. Here is some more data:

Code:
lspci -k
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel modules: intel-agp
00:01.0 PCI bridge: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port (rev 07)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: ehci_hcd
	Kernel modules: ehci-hcd
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1893
	Kernel driver in use: HDA Intel
	Kernel modules: snd-hda-intel
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 03)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: ehci_hcd
	Kernel modules: ehci-hcd
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel modules: iTCO_wdt
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: ahci
01:00.0 VGA compatible controller: nVidia Corporation G98 [GeForce 9300M GS] (rev a1)
	Subsystem: ASUSTeK Computer Inc. U6V laptop
	Kernel driver in use: nouveau
	Kernel modules: nouveau, nvidiafb
03:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)
	Subsystem: AzureWave Device 1067
	Kernel driver in use: ath9k
	Kernel modules: ath9k
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
	Subsystem: ASUSTeK Computer Inc. U6V laptop
	Kernel driver in use: r8169
	Kernel modules: r8169
09:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: firewire_ohci
	Kernel modules: firewire-ohci
09:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: sdhci-pci
	Kernel modules: sdhci-pci
09:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
	Subsystem: ASUSTeK Computer Inc. Device 1897
09:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)
	Subsystem: ASUSTeK Computer Inc. Device 1897
	Kernel driver in use: r852
	Kernel modules: r852
Code:
cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf7ff8000 irq 49
Code:
lsmod
Module                  Size  Used by
snd_seq_dummy           1479  0 
snd_seq_oss            30116  0 
snd_seq_midi_event      5708  1 snd_seq_oss
snd_seq                52486  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device          5473  3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss            40089  0 
snd_mixer_oss          17282  1 snd_pcm_oss
ipv6                  275315  39 
cpufreq_ondemand        9164  2 
acpi_cpufreq            6079  1 
freq_table              2435  2 cpufreq_ondemand,acpi_cpufreq
mperf                   1195  1 acpi_cpufreq
lp                      9781  0 
ppdev                   6021  0 
parport_pc             21214  0 
parport                30087  3 lp,ppdev,parport_pc
fuse                   66651  1 
ath9k                  84386  0 
snd_hda_codec_hdmi     22985  1 
mac80211              204017  1 ath9k
ath9k_common            1941  1 ath9k
nouveau               555137  4 
snd_hda_codec_realtek   293594  1 
asus_laptop            15682  0 
uvcvideo               62696  0 
ath9k_hw              269347  2 ath9k,ath9k_common
ath                    13709  2 ath9k,ath9k_hw
cfg80211              142106  3 ath9k,mac80211,ath
ttm                    52981  1 nouveau
snd_hda_intel          21915  10 
drm_kms_helper         27035  1 nouveau
joydev                 10279  0 
sparse_keymap           2984  1 asus_laptop
snd_hda_codec          71748  3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
drm                   177345  6 nouveau,ttm,drm_kms_helper
snd_hwdep               6254  1 snd_hda_codec
snd_pcm                73762  6 snd_pcm_oss,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer              19671  4 snd_seq,snd_pcm
i2c_algo_bit            5055  1 nouveau
snd                    58334  28 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore               5681  1 snd
video                  11949  1 nouveau
snd_page_alloc          7297  2 snd_hda_intel,snd_pcm
videodev               65968  1 uvcvideo
v4l1_compat            15658  2 uvcvideo,videodev
v4l2_compat_ioctl32    11199  1 videodev
btusb                  11689  0 
thermal                 8082  0 
r852                   11229  0 
bluetooth              53772  1 btusb
rfkill                 16442  4 asus_laptop,cfg80211,bluetooth
firewire_ohci          27301  0 
r8169                  37529  0 
usbhid                 36859  0 
processor              25982  3 acpi_cpufreq
thermal_sys            13862  3 video,thermal,processor
sm_common               7530  1 r852
nand                   46002  2 r852,sm_common
hid                    77723  1 usbhid
i2c_core               19769  5 nouveau,drm_kms_helper,drm,i2c_algo_bit,videodev
firewire_core          51107  1 firewire_ohci
nand_ids                6529  1 nand
sdhci_pci               7550  0 
nand_ecc                3556  1 nand
output                  2020  1 video
mii                     3906  1 r8169
sdhci                  17079  1 sdhci_pci
battery                10535  0 
button                  5013  1 nouveau
mtd                    18279  2 sm_common,nand
ac                      3249  0 
evdev                   9813  17 
hwmon                   1473  1 thermal_sys
rtc_cmos                9374  0 
rtc_core               14471  1 rtc_cmos
rtc_lib                 1978  1 rtc_core
intel_agp              10824  0 
intel_gtt              14862  1 intel_agp
agpgart                28874  4 ttm,drm,intel_agp,intel_gtt
sg                     26495  0 
mmc_core               64800  1 sdhci
psmouse                47222  0 
serio_raw               4534  0
Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC663 Analog [ALC663 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC663 Digital [ALC663 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Please let me know what i need to do in order to be able to record audio from the soundcard. Every help will be appreciated. Thank you!
 
Old 05-05-2012, 03:56 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980Reputation: 3980
You can either record from the soundcard using arecord or directly dump the stream with mplayer. Have a look at this older but useful article: http://lwn.net/Articles/182954/
 
Old 05-05-2012, 06:23 PM   #3
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 643

Rep: Reputation: 90
What is the address of the stream?
 
Old 05-06-2012, 12:37 AM   #4
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Original Poster
Rep: Reputation: 0
Hi, there are several URLs but i think the encoding is the same for all. Here is the playlist:
http://www.hitradioveronica.nl/player/hitradio.pls
 
Old 05-06-2012, 01:02 AM   #5
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 643

Rep: Reputation: 90
Some variation of this perhaps:

Code:
#!/bin/sh

mplayer -cache 2048 -cache-min 80 -bandwidth 1000000 \
        -playlist http://www.hitradioveronica.nl/player/hitradio.pls \
        -vc null -vo null -ao pcm:fast:waveheader:file=streamtheworld.wav &

sleep 5m
kill $!

oggenc -q 6 streamtheworld.wav -o streamtheworld.ogg 

rm streamtheworld.wav
This records only 5 minutes but it is the limit of my ability to listen to this particular station .
 
Old 05-06-2012, 01:53 AM   #6
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Original Poster
Rep: Reputation: 0
Hi Andrew

I saved what you had written in a .sh file and made it executable. When i ran it, there was that error:
Code:
ERROR: Cannot open input file "streamtheworld.wav": No such file or directory
rm: cannot remove „streamtheworld.wav“: No such file or directory
Can you help me how to set the destination directory and the filename? I could not find such file also on my computer.
I even tried to write /home/user/streamtheworld.wav but actually i got the same error. Do you know where are those temporary files stored from mplayer? I could not understand from mplayer's man page.

Thanks!
 
Old 05-06-2012, 02:04 AM   #7
andrew.46
Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 643

Rep: Reputation: 90
Have a look at this page:

Slackware and "For The God Who Sings"
http://www.andrews-corner.org/ftgws.html

which expands a little further the method I have demonstrated here.
 
Old 05-06-2012, 04:24 AM   #8
-cyrus-
LQ Newbie
 
Registered: Mar 2008
Location: Auckland
Distribution: CentOS (Server), Arch (Laptop)
Posts: 19

Rep: Reputation: 1
Have you tried 'streamripper' that is easy from the command line.

Code:
streamripper http://radiostation.pls
 
Old 05-06-2012, 05:32 AM   #9
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,380

Rep: Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840Reputation: 840
you can also use named pipes to avoid the intermediate wav
Code:
#!/bin/sh

mkfifo /tmp/audiofifo.tmp

oggenc -q 6 /tmp/audiofifo.tmp -o /tmp/streamtheworld.ogg &
mplayer -cache 2048 -cache-min 80 -bandwidth 1000000 \
        -playlist http://www.hitradioveronica.nl/player/hitradio.pls \
        -vc null -vo null -ao pcm:fast:waveheader:file=/tmp/audiofifo.tmp

Last edited by ponce; 05-06-2012 at 05:34 AM.
 
Old 05-06-2012, 10:18 AM   #10
glupa4e
Member
 
Registered: Jan 2011
Posts: 96

Original Poster
Rep: Reputation: 0
Unfortunately, i tried the solutions proposed by andrew46 and ponce but i had the same error as described above. Andrew46, your article was though very helpful. Thank you all guys! Finally i got the stream recorded via streamripper in .aac fromat.
I wish you all the best!
 
  


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
LXer: Use MPlayer to record live streams from the Internet LXer Syndicated Linux News 0 09-29-2010 07:20 PM
BBC Radio Streams rkfb Slackware 4 06-03-2010 08:01 AM
Radio streams in Amarok playlist pwabrahams Linux - Software 3 08-08-2008 07:13 AM
LXer: Consolidate your radio streams with streamtuner LXer Syndicated Linux News 0 01-05-2007 04:54 PM
Radio Streams and Handhelds linuxhippy Linux - Laptop and Netbook 6 01-08-2006 02:57 PM


All times are GMT -5. The time now is 09:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration