Posts Tagged ‘alsamixer’

Play Audio Music CDs in Linux console / terminal in the 21 Century mission hard but possible

Tuesday, July 30th, 2024


Compact discs (CD's)
ain't dead yet but there easy straigh use on free operating systems Linux / FreeBSD / OpenBSD is starting to deteriorate. That is quite normal I guess, as CDs are no longer officially produced or sold for few years in America and there is no Audio CD bookstores, neither in europe and perhaps there are just few in europe, perhaps CD are used somewhere in Africa and Asia, but most modern world has officially buried them.

However as I love old stuff and I had the opportunity, I bought an old Audio CD (fake copy one 🙂 of Judas Priest Screaming for Vengence and the famous Jimi Hendrix  (Best Complilation) Experience an improvised shelf-book store selling books by a half deaf aging guy who sells books for years in Dobrich in the center.
And to remember the young years of Rock Roll wanted to play it on my very old but still kicking Lenovo Thinkpad R61 notebook (that is now 16 years old but thanksfully it still works and kicks ass with a Debian GNU / Linux 10 Buster.)

The task is very easy and as I have a Window Maker (Wmaker) on it in order to save myself an extra loading of this a kind of "archaic machine" and tried to play my CDs with everything at hand thus I tried first to play the CD in console with the good old but gold cdplay with which I have played a dozens of Audio CDs back in the days … 

# cdplay

just to find out the CD got red and started to roll but I get no sound via the Sound Card 🙁

Next thing, i assumed was the problem might be the pulseaudio process blocking the sound card to be used, preventing cdplay to be able to properly channel the sound to the sound card, that used to be quite of classical problem, if you remember, thus I tried to run the cdplay via the aoss (Wrapper script to facilitate use of alsa oss compatibility library.)

Before using oss of course i've loaded the snd-pcm-oss kernel module, to make the sound blaster be able to use the old obsolete Open Sound System.

# modprobe snd-pcm-oss

# aoss cdplay

Though that aoss trick worked for some programs that used old Open Sound System scheme to output sound, it doesn't unfortunately, at that case.
 

Strange enough my sound card is properly identified by the Debian Linux and I can play MP3 songs, as well browse videos in youtube and other Internet resources in Firefox and even the pulseaudio process that is running in the background is spitting sounds out of the Notebook Speakers.

The laptop doesn't seem to have any sound driver or Sound Card issues, as I can normally play my old .XM and .MOD  sound extension files with the good old mikmod

 

# mikmod

as well as I can even normally play MIDI audio files by using the timidity tool as well as with playmidi

# timidity HitTheLights.mid

# playmidi HitTheLights.mid


Just to proove the MIDIs can be played normally via the Sound Blaster (for a more on the topic check my previous article talking in depth about Linux and MIDI – Play Midis on Linux / Make Linux MIDI Ready for the Future – Enable embedded MIDI music to play in a Browser, Play MIDIs with VLC and howto enjoy Midis in Text Console.

Next logically to make sure, something is not wrong with audio drivers, I tried to play some music normally with, the standard console players I have played with for years on Linux mpg123 / mpg321 for reference check my Listening music in text mode in Linux console but this was no luck again …

I tried even to install the opencubicplayer ( Linux port) music player and tried to open the CD, but even though the CD can be heard to be rolling in the CD drive no sound was outputed out of the laptop speakers.

 

open-cubic-player-screenshot-on-linux

Thus to resolve tried everything at power starting from increasing any missing volumes via the aumix command, as often in the past I remember the problem in such situations is the sound volume is decreased to zero percentage or completely muted.

# aumix


aumix-with-linux-htop-screenshot-animated-gif

as well as with 

# alsamixer


Alsamixer-control-sound-volume-linux-screenshot

Nevertheless, every possible volume up volume was raised and everything looked cool as I could play normally music on machine or in a browser, the AUDIO CD Music refused to play out of the Speakers.
 

Playing the Audio CD via success with mplayer

The work around to make it play was up to a one liner with mplayer

# mplayer -cdrom-device /dev/cdrom cdda://

To easify the play of CDs I've created for my self a tiny one liner script to run it.

 

#!/bin/bash
mplayer -cdrom-device /dev/cdrom cdda://

I've called the script playcd.sh, made it executable and placed it under /usr/local/bin

# vim /usr/local/bin/playcd.sh
#!/bin/bash
mplayer -cdrom-device /dev/cdrom cdda://


# chmod +x /usr/local/bin/playcd.sh

 

Playing Audio CDs with VLC (VideoLAN Media Player)

I've vlc client installed on my Linux box, if you don't have it, do:

# apt install –yes vlc

Then roll on the CD with vlc with passing it the location to the CD, usually one of the down two pointers should work:

# vlc vcd:///dev/sr0

# vlc vcd:///dev/cdrom

If you want to loop the Tracks to play forever

# vlc –loop vcd:///dev/cdrom

By the way vlc can do much more than you think as you can even play youtube with it, for example you can try it with the Axel Folly classics Mod file, by running it like this.

# vlc https://www.youtube.com/watch?v=SlyK_elUmIw


Cheers and Enjoy CD audio on Linux  ! 🙂

Solve ALSA audio and mic issues on Lenovo Thinkpads on Debian and Ubuntu Linux

Wednesday, January 11th, 2012

Since I've blogged about my recent skype issues. I've played a lot with pulseaudio, alsa, alsa-oss to experimented a lot until I figured out why Skype was failing to properly delivery sound and record via my embedded laptop mic.

Anyways, while researching on the cause of my Thinkpad r61 mic issues, I've red a bunch of blog posts by people experiencing microphone oddities with Lenovo Thinkpads

Throughout the search I come across one very good article, which explained that in many cases the Thinkpad sound problems are caused by the snd-hda-intel alsa kernel module. snd-hda-intel fails to automatically set proper sb model type argument during Linux install when the soundcard is initialized with some argument like options snd-hda-intel model=auto

Hence, the suggested fix which should resolve this on many Thinkpad notebooks is up to passing the right module argument:

To fix its neceessery to edit /etc/modprobe.d/alsa-base.conf .

debian:~# vim /etc/modprobe.d/alsa-base.conf

Find the line in the file starting with:
options snd-hda-intel model=

and substitute with:

options snd-hda-intel model=thinkpad

Finally a restart of Advaned Linux Sound Architecture (alsa) is required:

debian:~# /etc/init.d/alsa restart
...

At most cases just restarting the alsa via its init script is not enough, since the ssnd-hda-intel kernel module is already in use by some program or something, so its best to do a reboot to make sure the module is loaded with the new model=thinkpad argument.

My exact laptop sound card model is:

debian:~# lspci |grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

After changing the module and using alsamixer and aumix to make sure mic is unmuted and its volume is high enough, mic sound rec works fine.