0

I use the cmus console music player through ssh on a device with OSMC (Kodi, based on Debian Jessie) installed. My problem is that the sound is played to the HDMI, and I want to play music to the jack output.

I tried to use alsamixer, amixer, aplay, etc... but these are not installed and sudo apt-get install alsamixer doesn't help. (Package not found - Maybe there's a better option than installing alsamixer anyway).

I tried to read man cmus, which seems to offer the possibility to change some alsa settings : link to the online manual page, but I don't understand which settings are relevant for me, nor which values to put... Anyway : cmus is maybe not the source of my issue.

How can I achieve what I want to, using only the terminal (I am through SSH) ?

--

PS : I finally installed alsamixer (actually the package's name was alsa-utils). And results that my jack output is not recognised. But I know it is working since other programs use it.

4
  • Do you run Pulseaudio (check with ps axu)? If no, alsamixer and amixer are in package alsa-utils. If yes, use pacmd (see pacmd help).
    – dirkt
    Feb 17, 2018 at 14:45
  • No I don't. I have installed alsa-utils, but it doesn't help : I can't find my jack output port in order to select it Feb 17, 2018 at 14:54
  • Hm. You wrote device, so what kind of device exactly? Maybe something exotic? Please edit question with output of lspci -nn | grep Audio, cat /proc/asound/pcm and lsmod | grep snd.
    – dirkt
    Feb 17, 2018 at 15:00
  • My answer assumed you were on a raspberry pi, for some reason (osmc, hdmi, jack plug). if not, add the output of aplay --list-devices to your post.
    – meuh
    Feb 17, 2018 at 15:21

1 Answer 1

3

This 2018 article explains how you can dynamically switch the audio output between hdmi and analogue on a Raspberry Pi. From the command line use

amixer cset numid=3 2

for hdmi and

amixer cset numid=3 1

for analogue. This information is no longer in the current version of that page, so may no longer work. The May 2020 blog says they have changed the sound architecture to handle the hdmi and analogue output as 2 independent devices: Alsa card 0 will be HDMI, and card 1 will be the headphone jack. The default is 0, but to use 1 you can create a ~/.asoundrc file with

defaults.pcm.card 1
defaults.ctl.card 1

This presumably requires you to login again.

You can generate a stereo test tone with another command from alsa-utils:

speaker-test -c 2 -s 1 -t sine -f 440
4
  • There is no explaination of what meur is doing. Also the source linked to the same none intelligible documentation type as complained about in the question. It also only linked a start page, not even to a relevant place. Might of as well pointed to the moon when talking about sandstone, it is equivalent to that, be there for hours, and most will get lost or far to many even its one and will die there before they ever found out what sandstone is. I had to read entire pages of that book to get to nothing at all, and after all that it was only a copy paste of the man page, it added nothing.
    – abc
    Dec 27, 2020 at 3:36
  • It was not an article, it was the exactly the same unintelligible secretariat short hand technique jargon. A mnemonic device. Like a doctors writing, it was more codified jargon.
    – abc
    Dec 27, 2020 at 3:48
  • A mnemonic device, like a doctors secret writing system or the laziest that can possibly do in life. It it was more of the exactly the same codified jargon. Like some dependency hell program. It had great potential but was undermined by industry personnel and the bourgeoisie which GNU/Linux/* had sworn an allegiance to combat.
    – abc
    Dec 27, 2020 at 3:55
  • Sadly, the web page has changed a lot from 2018, so it is no longer obvious where to find the information, and the actual information has even been removed from the documentation. Perhaps this means the above no longer works. I've updated the link to the archive.org versioon of the page. If you are using raspian from May 2020 the audio architecture has changed, see the blog under Other Changes.
    – meuh
    Dec 27, 2020 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.