public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominique Michel <dominique.c.michel@gmail.com>
To: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Cc: Jude DaShiell <jdashiel@panix.com>, linux-msdos@vger.kernel.org
Subject: Re: can dosemu use this sound card?
Date: Wed, 28 Apr 2021 11:29:04 +0200	[thread overview]
Message-ID: <20210428112904.2e2938ee@tux> (raw)
In-Reply-To: <f52a8fa6-29c5-cd5a-8792-a2ba9fead8cb@gmail.com>

Le Tue, 27 Apr 2021 22:32:57 +0200,
Julius Schwartzenberg <julius.schwartzenberg@gmail.com> a écrit :

> I don't think the type of card matters as long as you have a single 
> device, but using a non-default device might require that you switch
> the output device through pulseaudio or possibly you can instruct SDL
> to use another device.

The default audio kernel driver on linux is ALSA. You can define the
sound cards number and order in /etc/modprobe.d/alsa.conf and
~/.asoundrc to set the default sound card. ~/.asoundrc can be modified
on the fly, at least for ALSA. I have no idea if pulseaudio will like
it as I don't use it but prefer JACK. To set the card order is
important especially with usb cards, that because they can or not be
present at boot time and no guaranty can be made if that order is not
specified.

alsa.conf:
# Alsa kernel modules' configuration file.
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
# On most system, the OSS sections could be removed, but if these
# modules are installed, it doesn't arm.
alias char-major-14 soundcore
# You need to customise this section for your specific sound card(s)
# and then run `update-modules' command. Not sure if it is still
necessary.
#  ALSA portion
alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-virmidi
#  OSS/Free portion
alias sound-slot-0 snd-hda-intel
alias sound-slot-1 snd-virmidi
# cards order and options, index start at 0
options snd-hda-intel index=0 model=alc271-dmic
options snd-virmidi index=1
# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
##  OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the physical number of cards.
options snd cards_limit=2


In ~/.asoundrc, you will have to configure pcm.!default used by ALSA to
the card you want to use. Mine use the pcm jack ALSA plugin, that in
order to route the audio from the ALSA only applications to jack. Yours
will be simpler (see the ALSA driver documentation):

# default ALSA card
pcm.!default {
    type plug
    slave { pcm "jack" }
}

# card 0 is snd-aloop
pcm.jack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

# define a mixer volume for that card
ctl.mixer0 {
    type hw
    card 0
}

Or you can define the USB card as card 0 in /etc/modprobe.d/alsa.conf
and remove ~/.asoundrc.

When done and if using pulse, you may or not need to restart it
and/or adjust its configuration.

> 
> Op 26-04-2021 om 02:34 schreef Jude DaShiell:
> > A run of lsusb on Linux got this line back for the sound card I'm
> > using. Bus 004 Device 002: ID 0d8c:0001 C-Media Electronics, Inc.
> > Audio Device Can dosemu be configured to use that sound card?
> > 

  reply	other threads:[~2021-04-28  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  0:34 can dosemu use this sound card? Jude DaShiell
2021-04-27 20:32 ` Julius Schwartzenberg
2021-04-28  9:29   ` Dominique Michel [this message]
2021-04-28 14:59     ` Jude DaShiell
2021-04-29 18:33       ` Julius Schwartzenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210428112904.2e2938ee@tux \
    --to=dominique.c.michel@gmail.com \
    --cc=jdashiel@panix.com \
    --cc=julius.schwartzenberg@gmail.com \
    --cc=linux-msdos@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox