Guest User

ALSA config file, aplay/amixer outputs and forked-daapd.conf

a guest
Apr 5th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.97 KB | None | 0 0
  1. pi@raspberrypi:~ $ cat ~/.asoundrc
  2. ctl.!default {
  3. type hw
  4. card 0
  5. }
  6.  
  7. pcm.!default {
  8. type plug
  9. slave.pcm "dmixer"
  10. }
  11.  
  12. pcm.dmixer {
  13. type dmix
  14. ipc_key 1024
  15. ipc_key_add_uid false
  16. ipc_perm 0666
  17.  
  18. slave {
  19. pcm "hw:0,0"
  20. period_time 0
  21. period_size 4096
  22. buffer_size 22052
  23. rate 44100
  24. }
  25. }
  26.  
  27. ctl.dmixer {
  28. type hw
  29. card 0 # underlying device
  30. device 0
  31. }
  32. pi@raspberrypi:~ $ aplay -l
  33. **** List of PLAYBACK Hardware Devices ****
  34. card 0: Audio [NAD USB Audio], device 0: USB Audio [USB Audio]
  35. Subdevices: 1/1
  36. Subdevice #0: subdevice #0
  37. card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  38. Subdevices: 7/7
  39. Subdevice #0: subdevice #0
  40. Subdevice #1: subdevice #1
  41. Subdevice #2: subdevice #2
  42. Subdevice #3: subdevice #3
  43. Subdevice #4: subdevice #4
  44. Subdevice #5: subdevice #5
  45. Subdevice #6: subdevice #6
  46. card 1: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  47. Subdevices: 1/1
  48. Subdevice #0: subdevice #0
  49. card 1: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  50. Subdevices: 1/1
  51. Subdevice #0: subdevice #0
  52. pi@raspberrypi:~ $ aplay -L
  53. null
  54. Discard all samples (playback) or generate zero samples (capture)
  55. default
  56. dmixer
  57. sysdefault:CARD=Audio
  58. NAD USB Audio, USB Audio
  59. Default Audio Device
  60. front:CARD=Audio,DEV=0
  61. NAD USB Audio, USB Audio
  62. Front speakers
  63. surround21:CARD=Audio,DEV=0
  64. NAD USB Audio, USB Audio
  65. 2.1 Surround output to Front and Subwoofer speakers
  66. surround40:CARD=Audio,DEV=0
  67. NAD USB Audio, USB Audio
  68. 4.0 Surround output to Front and Rear speakers
  69. surround41:CARD=Audio,DEV=0
  70. NAD USB Audio, USB Audio
  71. 4.1 Surround output to Front, Rear and Subwoofer speakers
  72. surround50:CARD=Audio,DEV=0
  73. NAD USB Audio, USB Audio
  74. 5.0 Surround output to Front, Center and Rear speakers
  75. surround51:CARD=Audio,DEV=0
  76. NAD USB Audio, USB Audio
  77. 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  78. surround71:CARD=Audio,DEV=0
  79. NAD USB Audio, USB Audio
  80. 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  81. iec958:CARD=Audio,DEV=0
  82. NAD USB Audio, USB Audio
  83. IEC958 (S/PDIF) Digital Audio Output
  84. dmix:CARD=Audio,DEV=0
  85. NAD USB Audio, USB Audio
  86. Direct sample mixing device
  87. dsnoop:CARD=Audio,DEV=0
  88. NAD USB Audio, USB Audio
  89. Direct sample snooping device
  90. hw:CARD=Audio,DEV=0
  91. NAD USB Audio, USB Audio
  92. Direct hardware device without any conversions
  93. plughw:CARD=Audio,DEV=0
  94. NAD USB Audio, USB Audio
  95. Hardware device with all software conversions
  96. sysdefault:CARD=ALSA
  97. bcm2835 ALSA, bcm2835 ALSA
  98. Default Audio Device
  99. dmix:CARD=ALSA,DEV=0
  100. bcm2835 ALSA, bcm2835 ALSA
  101. Direct sample mixing device
  102. dmix:CARD=ALSA,DEV=1
  103. bcm2835 ALSA, bcm2835 IEC958/HDMI
  104. Direct sample mixing device
  105. dmix:CARD=ALSA,DEV=2
  106. bcm2835 ALSA, bcm2835 IEC958/HDMI1
  107. Direct sample mixing device
  108. dsnoop:CARD=ALSA,DEV=0
  109. bcm2835 ALSA, bcm2835 ALSA
  110. Direct sample snooping device
  111. dsnoop:CARD=ALSA,DEV=1
  112. bcm2835 ALSA, bcm2835 IEC958/HDMI
  113. Direct sample snooping device
  114. dsnoop:CARD=ALSA,DEV=2
  115. bcm2835 ALSA, bcm2835 IEC958/HDMI1
  116. Direct sample snooping device
  117. hw:CARD=ALSA,DEV=0
  118. bcm2835 ALSA, bcm2835 ALSA
  119. Direct hardware device without any conversions
  120. hw:CARD=ALSA,DEV=1
  121. bcm2835 ALSA, bcm2835 IEC958/HDMI
  122. Direct hardware device without any conversions
  123. hw:CARD=ALSA,DEV=2
  124. bcm2835 ALSA, bcm2835 IEC958/HDMI1
  125. Direct hardware device without any conversions
  126. plughw:CARD=ALSA,DEV=0
  127. bcm2835 ALSA, bcm2835 ALSA
  128. Hardware device with all software conversions
  129. plughw:CARD=ALSA,DEV=1
  130. bcm2835 ALSA, bcm2835 IEC958/HDMI
  131. Hardware device with all software conversions
  132. plughw:CARD=ALSA,DEV=2
  133. bcm2835 ALSA, bcm2835 IEC958/HDMI1
  134. Hardware device with all software conversions
  135. pi@raspberrypi:~ $ amixer -c 0
  136. Simple mixer control 'Master',0
  137. Capabilities: volume
  138. Playback channels: Front Left - Front Right
  139. Capture channels: Front Left - Front Right
  140. Limits: 0 - 255
  141. Front Left: 127 [50%]
  142. Front Right: 127 [50%]
  143. Simple mixer control 'PCM',0
  144. Capabilities: volume
  145. Playback channels: Front Left - Front Right
  146. Capture channels: Front Left - Front Right
  147. Limits: 0 - 255
  148. Front Left: 225 [88%]
  149. Front Right: 225 [88%]
  150.  
  151. pi@raspberrypi:~ $ cat /etc/forked-daapd.conf
  152. # A quick guide to configuring forked-daapd:
  153. #
  154. # For regular use, the most important setting to configure is "directories",
  155. # which should be the location of your media. Whatever user you have set as
  156. # "uid" must have read access to this location. If the location is a network
  157. # mount, please see the README.
  158. #
  159. # In all likelihood, that's all you need to do!
  160.  
  161. general {
  162. # Username
  163. # Make sure the user has read access to the library directories you set
  164. # below, and full access to the databases, log and local audio
  165. uid = "root"
  166.  
  167. # Database location
  168. # db_path = "/var/cache/forked-daapd/songs3.db"
  169.  
  170. # Log file and level
  171. # Available levels: fatal, log, warning, info, debug, spam
  172. logfile = "/var/log/forked-daapd.log"
  173. loglevel = log
  174.  
  175. # Admin password for the web interface
  176. # Note that access to the web interface from computers in
  177. # "trusted_network" (see below) does not require password
  178. # admin_password = ""
  179.  
  180. # Websocket port for the web interface.
  181. # websocket_port = 3688
  182.  
  183. # Sets who is allowed to connect without authorisation. This applies to
  184. # client types like Remotes, DAAP clients (iTunes) and to the web
  185. # interface. Options are "any", "localhost" or the prefix to one or
  186. # more ipv4/6 networks. The default is { "localhost", "192.168", "fd" }
  187. # trusted_networks = { "localhost", "192.168", "fd" }
  188.  
  189. # Enable/disable IPv6
  190. ipv6 = yes
  191.  
  192. # Location of cache database
  193. # cache_path = "/var/cache/forked-daapd/cache.db"
  194.  
  195. # DAAP requests that take longer than this threshold (in msec) get their
  196. # replies cached for next time. Set to 0 to disable caching.
  197. # cache_daap_threshold = 1000
  198.  
  199. # When starting playback, autoselect speaker (if none of the previously
  200. # selected speakers/outputs are available)
  201. # speaker_autoselect = yes
  202.  
  203. # Most modern systems have a high-resolution clock, but if you are on an
  204. # unusual platform and experience audio drop-outs, you can try changing
  205. # this option
  206. # high_resolution_clock = yes
  207. }
  208.  
  209. # Library configuration
  210. library {
  211. # Name of the library as displayed by the clients (%h: hostname). If you
  212. # change the name after pairing with Remote you may have to re-pair.
  213. name = "My Music on %h"
  214.  
  215. # TCP port to listen on. Default port is 3689 (daap)
  216. port = 3689
  217.  
  218. # Password for the library. Optional.
  219. # password = ""
  220.  
  221. # Directories to index
  222. directories = { "/media/Music" }
  223.  
  224. # Follow symlinks. Default: true.
  225. # follow_symlinks = true
  226.  
  227. # Directories containing podcasts
  228. # For each directory that is indexed the path is matched against these
  229. # names. If there is a match all items in the directory are marked as
  230. # podcasts. Eg. if you index /srv/music, and your podcasts are in
  231. # /srv/music/Podcasts, you can set this to "/Podcasts".
  232. # (changing this setting only takes effect after rescan, see the README)
  233. podcasts = { "/Podcasts" }
  234.  
  235. # Directories containing audiobooks
  236. # For each directory that is indexed the path is matched against these
  237. # names. If there is a match all items in the directory are marked as
  238. # audiobooks.
  239. # (changing this setting only takes effect after rescan, see the README)
  240. audiobooks = { "/Audiobooks" }
  241.  
  242. # Directories containing compilations (eg soundtracks)
  243. # For each directory that is indexed the path is matched against these
  244. # names. If there is a match all items in the directory are marked as
  245. # compilations.
  246. # (changing this setting only takes effect after rescan, see the README)
  247. compilations = { "/Compilations" }
  248.  
  249. # Compilations usually have many artists, and sometimes no album artist.
  250. # If you don't want every artist to be listed in artist views, you can
  251. # set a single name which will be used for all compilation tracks
  252. # without an album artist, and for all tracks in the compilation
  253. # directories.
  254. # (changing this setting only takes effect after rescan, see the README)
  255. compilation_artist = "Various Artists"
  256.  
  257. # If your album and artist lists are cluttered, you can choose to hide
  258. # albums and artists with only one track. The tracks will still be
  259. # visible in other lists, e.g. songs and playlists. This setting
  260. # currently only works in some remotes.
  261. # hide_singles = false
  262.  
  263. # Internet streams in your playlists will by default be shown in the
  264. # "Radio" library, like iTunes does. However, some clients (like
  265. # TunesRemote+) won't show the "Radio" library. If you would also like
  266. # to have them shown like normal playlists, you can enable this option.
  267. # radio_playlists = false
  268.  
  269. # These are the default playlists. If you want them to have other names,
  270. # you can set it here.
  271. # name_library = "Library"
  272. # name_music = "Music"
  273. # name_movies = "Movies"
  274. # name_tvshows = "TV Shows"
  275. # name_podcasts = "Podcasts"
  276. # name_audiobooks = "Audiobooks"
  277. # name_radio = "Radio"
  278.  
  279. # Artwork file names (without file type extension)
  280. # forked-daapd will look for jpg and png files with these base names
  281. # artwork_basenames = { "artwork", "cover", "Folder", "folder" }
  282.  
  283. # Enable searching for artwork corresponding to each individual media
  284. # file instead of only looking for album artwork. This is disabled by
  285. # default to reduce cache size.
  286. # artwork_individual = false
  287.  
  288. # File types the scanner should ignore
  289. # Non-audio files will never be added to the database, but here you
  290. # can prevent the scanner from even probing them. This might improve
  291. # scan time. By default .db, .ini, .db-journal, .pdf and .metadata are
  292. # ignored.
  293. # filetypes_ignore = { ".db", ".ini", ".db-journal", ".pdf", ".metadata" }
  294.  
  295. # File paths the scanner should ignore
  296. # If you want to exclude files on a more advanced basis you can enter
  297. # one or more POSIX regular expressions, and any file with a matching
  298. # path will be ignored.
  299. # filepath_ignore = { "myregex" }
  300.  
  301. # Disable startup file scanning
  302. # When forked-daapd starts it will do an initial file scan of your
  303. # library (and then watch it for changes). If you are sure your library
  304. # never changes while forked-daapd is not running, you can disable the
  305. # initial file scan and save some system ressources. Disabling this scan
  306. # may lead to forked-daapd's database coming out of sync with the
  307. # library. If that happens read the instructions in the README on how
  308. # to trigger a rescan.
  309. filescan_disable = true
  310.  
  311. # Should metadata from m3u playlists, e.g. artist and title in EXTINF,
  312. # override the metadata we get from radio streams?
  313. # m3u_overrides = false
  314.  
  315. # Should iTunes metadata override ours?
  316. # itunes_overrides = false
  317.  
  318. # Should we import the content of iTunes smart playlists?
  319. # itunes_smartpl = false
  320.  
  321. # Decoding options for DAAP clients
  322. # Since iTunes has native support for mpeg, mp4a, mp4v, alac and wav,
  323. # such files will be sent as they are. Any other formats will be decoded
  324. # to raw wav. If forked-daapd detects a non-iTunes DAAP client, it is
  325. # assumed to only support mpeg and wav, other formats will be decoded.
  326. # Here you can change when to decode. Note that these settings have no
  327. # effect on AirPlay.
  328. # Formats: mp4a, mp4v, mpeg, alac, flac, mpc, ogg, wma, wmal, wmav, aif, wav
  329. # Formats that should never be decoded
  330. # no_decode = { "format", "format" }
  331. # Formats that should always be decoded
  332. # force_decode = { "format", "format" }
  333.  
  334. # Watch named pipes in the library for data and autostart playback when
  335. # there is data to be read. To exclude specific pipes from watching,
  336. # consider using the above _ignore options.
  337. # pipe_autostart = true
  338.  
  339. # Enable automatic rating updates
  340. # If enabled, rating is automatically updated after a song has either been
  341. # played or skipped (only skipping to the next song is taken into account).
  342. # The calculation is taken from the beets plugin "mpdstats" (see
  343. # https://beets.readthedocs.io/en/latest/plugins/mpdstats.html).
  344. # It consist of calculating a stable rating based only on the play- and
  345. # skipcount and a rolling rating based on the current rating and the action
  346. # (played or skipped). Both results are combined with a mix-factor of 0.75:
  347. # new rating = 0.75 * stable rating + 0.25 * rolling rating)
  348. # rating_updates = false
  349.  
  350. # Allows creating, deleting and modifying m3u playlists in the library directories.
  351. # Only supported by the player web interface and some mpd clients
  352. # Defaults to being disabled.
  353. # allow_modifying_stored_playlists = false
  354.  
  355. # A directory in one of the library directories that will be used as the default
  356. # playlist directory. forked-dapd creates new playlists in this directory if only
  357. # a playlist name is provided (requires "allow_modify_stored_playlists" set to true).
  358. # default_playlist_directory = ""
  359. }
  360.  
  361. # Local audio output
  362. audio {
  363. # Name - used in the speaker list in Remote
  364. nickname = "Computer"
  365.  
  366. # Type of the output (alsa, pulseaudio, dummy or disabled)
  367. type = "alsa"
  368.  
  369. # For pulseaudio output, an optional server hostname or IP can be
  370. # specified (e.g. "localhost"). If not set, connection is made via local
  371. # socket.
  372. # server = ""
  373.  
  374. # Audio PCM device name for local audio output - ALSA only
  375. card = "default"
  376.  
  377. # Mixer channel to use for volume control - ALSA only
  378. # If not set, PCM will be used if available, otherwise Master.
  379. mixer = "Master"
  380.  
  381. # Mixer device to use for volume control - ALSA only
  382. # If not set, the value for "card" will be used.
  383. mixer_device = "hw:0"
  384.  
  385. # Enable or disable audio resampling to keep local audio in sync with
  386. # e.g. Airplay. This feature relies on accurate ALSA measurements of
  387. # delay, and some devices don't provide that. If that is the case you
  388. # are better off disabling the feature.
  389. # sync_disable = false
  390.  
  391. # Here you can adjust when local audio is started relative to other
  392. # speakers, e.g. Airplay. Negative values correspond to moving local
  393. # audio ahead, positive correspond to delaying it. The unit is
  394. # milliseconds. The offset must be between -1000 and 1000 (+/- 1 sec).
  395. # offset_ms = 0
  396.  
  397. # To calculate what and if resampling is required, local audio delay is
  398. # measured each second. After a period the collected measurements are
  399. # used to estimate drift and latency, which determines if corrections
  400. # are required. This setting sets the length of that period in seconds.
  401. # adjust_period_seconds = 100
  402. }
  403.  
  404. # ALSA device settings
  405. # If you have multiple ALSA devices you can configure them individually via
  406. # sections like the below. Make sure to set the "card name" correctly. See the
  407. # README about ALSA for details. Note that these settings will override the ALSA
  408. # settings in the "audio" section above.
  409. #alsa "card name" {
  410. # Name - used in the speaker list in Remote
  411. # If not set, the card name will be used
  412. # nickname = "Computer"
  413.  
  414. # Mixer channel to use for volume control
  415. # If not set, PCM will be used if available, otherwise Master
  416. # mixer = ""
  417.  
  418. # Mixer device to use for volume control
  419. # If not set, the card name will be used
  420. # mixer_device = ""
  421. #}
  422.  
  423. # Pipe output
  424. # Allows forked-daapd to output audio data to a named pipe
  425. #fifo {
  426. # nickname = "fifo"
  427. # path = "/path/to/fifo"
  428. #}
  429.  
  430. # AirPlay/Airport Express device settings
  431. # (make sure you get the capitalization of the device name right)
  432. #airplay "My AirPlay device" {
  433. # forked-daapd's volume goes to 11! If that's more than you can handle
  434. # you can set a lower value here
  435. # max_volume = 11
  436.  
  437. # Enable this option to exclude a particular AirPlay device from the
  438. # speaker list
  439. # exclude = false
  440.  
  441. # Enable this option to keep a particular AirPlay device in the speaker
  442. # list and thus ignore mdns notifications about it no longer being
  443. # present. The speaker will remain until restart of forked-daapd.
  444. # permanent = false
  445.  
  446. # AirPlay password
  447. # password = "s1kr3t"
  448. #}
  449.  
  450. # Chromecast settings
  451. # (make sure you get the capitalization of the device name right)
  452. #chromecast "My Chromecast device" {
  453. # Enable this option to exclude a particular device from the speaker
  454. # list
  455. # exclude = false
  456. #}
  457.  
  458. # Spotify settings (only have effect if Spotify enabled - see README/INSTALL)
  459. spotify {
  460. # Directory where user settings should be stored (credentials)
  461. # settings_dir = "/var/cache/forked-daapd/libspotify"
  462.  
  463. # Cache directory
  464. # cache_dir = "/tmp"
  465.  
  466. # Set preferred bitrate for music streaming
  467. # 0: No preference (default), 1: 96kbps, 2: 160kbps, 3: 320kbps
  468. # bitrate = 0
  469.  
  470. # Your Spotify playlists will by default be put in a "Spotify" playlist
  471. # folder. If you would rather have them together with your other
  472. # playlists you can set this option to true.
  473. # base_playlist_disable = false
  474.  
  475. # Spotify playlists usually have many artist, and if you don't want
  476. # every artist to be listed when artist browsing in Remote, you can set
  477. # the artist_override flag to true. This will use the compilation_artist
  478. # as album artist for Spotify items.
  479. # artist_override = false
  480.  
  481. # Similar to the different artists in Spotify playlists, the playlist
  482. # items belong to different albums, and if you do not want every album
  483. # to be listed when browsing in Remote, you can set the album_override
  484. # flag to true. This will use the playlist name as album name for
  485. # Spotify items. Notice that if an item is in more than one playlist,
  486. # it will only appear in one album when browsing (in which album is
  487. # random).
  488. # album_override = false
  489. }
  490.  
  491. # MPD configuration (only have effect if MPD enabled - see README/INSTALL)
  492. mpd {
  493. # TCP port to listen on for MPD client requests.
  494. # Default port is 6600, set to 0 to disable MPD support.
  495. # port = 6600
  496.  
  497. # HTTP port to listen for artwork requests (only supported by some MPD
  498. # clients and will need additional configuration in the MPD client to
  499. # work). Set to 0 to disable serving artwork over http.
  500. # http_port = 0
  501.  
  502. # By default forked-daapd will - like iTunes - clear the playqueue if
  503. # playback stops. Setting clear_queue_on_stop_disable to true will keep
  504. # the playlist like MPD does. Note that some dacp clients do not show
  505. # the playqueue if playback is stopped.
  506. # clear_queue_on_stop_disable = false
  507. }
  508.  
  509. # SQLite configuration (allows to modify the operation of the SQLite databases)
  510. # Make sure to read the SQLite documentation for the corresponding PRAGMA
  511. # statements as changing them from the defaults may increase the possibility of
  512. # database corruptions! By default the SQLite default values are used.
  513. sqlite {
  514. # Cache size in number of db pages for the library database
  515. # (SQLite default page size is 1024 bytes and cache size is 2000 pages)
  516. # pragma_cache_size_library = 2000
  517.  
  518. # Cache size in number of db pages for the daap cache database
  519. # (SQLite default page size is 1024 bytes and cache size is 2000 pages)
  520. # pragma_cache_size_cache = 2000
  521.  
  522. # Sets the journal mode for the database
  523. # DELETE (default), TRUNCATE, PERSIST, MEMORY, WAL, OFF
  524. # pragma_journal_mode = DELETE
  525.  
  526. # Change the setting of the "synchronous" flag
  527. # 0: OFF, 1: NORMAL, 2: FULL (default)
  528. # pragma_synchronous = 2
  529.  
  530. # Number of bytes set aside for memory-mapped I/O for the library database
  531. # (requires sqlite 3.7.17 or later)
  532. # 0: disables mmap (default), any other value > 0: number of bytes for mmap
  533. # pragma_mmap_size_library = 0
  534.  
  535. # Number of bytes set aside for memory-mapped I/O for the cache database
  536. # (requires sqlite 3.7.17 or later)
  537. # 0: disables mmap (default), any other value > 0: number of bytes for mmap
  538. # pragma_mmap_size_cache = 0
  539.  
  540. # Should the database be vacuumed on startup? (increases startup time,
  541. # but may reduce database size). Default is yes.
  542. # vacuum = yes
  543. }
  544.  
  545. # Streaming audio settings for remote connections (ie stream.mp3)
  546. streaming {
  547. # Sample rate, typically 44100 or 48000
  548. # sample_rate = 44100
  549.  
  550. # Set the MP3 streaming bit rate (in kbps), valid options: 64 / 96 / 128 / 192 / 320
  551. # bit_rate = 192
  552. }
Add Comment
Please, Sign In to add comment