Copy to a sound device in /dev

5,696

Solution 1

This, in a terminal:

cat /vmlinuz | padsp tee /dev/dsp > /dev/null

Ubuntu uses PulseAudio as its sound server (before I think ALSA's dmix was used, I believe. I don't remember.)

padsp is a PulseAudio tool that wraps /dev/dsp to PulseAudio.

The oss-compat package, as suggested by MrShunz, enables ALSA's OSS compatibility layer, so it has to go through ALSA to get to PulseAudio which finally uses ALSA to access the sound device. So:

oss-compat: OSS->ALSA->PulseAudio->ALSA
padsp: OSS->PulseAudio->ALSA

padsp is also already installed by default, I think. If it isn't though, bash will tell you which package contains it :)

Solution 2

Newer versions of alsa have the sound devices under the directory /dev/snd/. Look for pcmXXXX devices.

Or you can always install the oss-compat package to have the /dev/dsp back:

# aptitude show oss-compat

Package: oss-compat                      
State: not installed
Version: 0.0.4+nmu3
Priority: extra
Section: universe/sound
Maintainer: Ubuntu MOTU Developers <[email protected]>
Uncompressed Size: 61.4 k
Depends: module-init-tools | modutils | hurd
Description: OSS compatibility package
 This package ensures that OSS support is provided in some way.  On Linux, it enables the ALSA compatibility modules.  On other
 kernels where OSS is the default interface, no action is taken. 

 The purpose of this package is for applications that only support OSS to depend on it, hence preventing common "/dev/dsp not found"
 errors that would confuse unexperienced users.
Share:
5,696

Related videos on Youtube

Christian Ivicevic
Author by

Christian Ivicevic

Updated on September 18, 2022

Comments

  • Christian Ivicevic
    Christian Ivicevic over 1 year

    Years ago i was able to pipe the kernel to the sound device via

    cat /vmlinuz > /dev/dsp
    

    However, i do not have the sound device in Natty 11.04 anymore. Any idea, how i can do this in this new version of Ubuntu?

    • samme4life
      samme4life over 12 years
      You mean this? cat /vmlinuz | aplay
    • MestreLion
      MestreLion over 12 years
      Err... sorry for my ignorance, but.. what would be the point of this? You want to literally hear the bits and bytes of your kernel binary code in your speakers?
    • runlevel0
      runlevel0 about 7 years
      LOL, I thought I was the only one XD I'm listening to ls -R / right now ;)